@apocaliss92/nodelink-js 0.4.35 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -7890,12 +7890,23 @@ declare class ReolinkBaichuanApi {
7890
7890
  * This is more reliable than autoPt in SupportInfo which can be a false positive
7891
7891
  * (e.g., NVR channels report autoPt=1 but don't actually support autotracking).
7892
7892
  *
7893
+ * Doorbell exception (mirrors the {@link computeDeviceCapabilities} floodlight
7894
+ * rule): video-doorbell firmwares (doorbellVersion > 0) ship AiCfg with
7895
+ * `smartTrackMode=1` (the current mode) yet `smartTrackModeAbility=0` (the
7896
+ * firmware's own "no, this device cannot autotrack" flag). Without a PT
7897
+ * motor a doorbell physically cannot autotrack, so when the caller flags the
7898
+ * device as a doorbell AND the firmware admits `smartTrackModeAbility=0`,
7899
+ * trust the firmware and return false. Verified against UID
7900
+ * 9527000ICL1T1MDS: smartTrackMode=1, smartTrackModeAbility=0,
7901
+ * ptzType=0, ptzMode="none", doorbellVersion=31.
7902
+ *
7893
7903
  * @param channel - Channel number (0-based)
7894
- * @param options - Optional timeout
7904
+ * @param options - Optional timeout and doorbell context hint
7895
7905
  * @returns true if autotracking is supported, false otherwise
7896
7906
  */
7897
7907
  probeAutotrackingSupport(channel: number, options?: {
7898
7908
  timeoutMs?: number;
7909
+ isDoorbell?: boolean;
7899
7910
  }): Promise<boolean>;
7900
7911
  /**
7901
7912
  * Returns AI object-detection types for a channel via cmd 299 (AiCfg).
@@ -11635,6 +11646,230 @@ declare function encodeMotionScopeBitmap(scope: MotionZoneScope): string;
11635
11646
  */
11636
11647
  declare function fullCoverageScope(columns: number, rows: number, width?: number, height?: number): MotionZoneScope;
11637
11648
 
11649
+ /**
11650
+ * Encode 16-bit signed PCM into IMA ADPCM blocks ready for `TalkSession.sendAudio()`.
11651
+ *
11652
+ * @param pcm 16-bit signed mono PCM samples (typically 16 kHz per Reolink TalkAbility).
11653
+ * @param blockSizeBytes Number of ADPCM payload bytes per block. The block encodes
11654
+ * `blockSizeBytes * 2 + 1` samples (one in the header + two per payload byte).
11655
+ * Reolink's default `lengthPerEncoder=1024` corresponds to a 4-byte header +
11656
+ * 1020 payload bytes per Baichuan ADPCM frame; the caller chooses what to pass.
11657
+ * @returns Concatenated blocks, each `4 + blockSizeBytes` bytes long. An empty
11658
+ * `pcm` yields an empty buffer.
11659
+ */
11660
+ declare function encodeImaAdpcm(pcm: Int16Array, blockSizeBytes: number): Buffer;
11661
+
11662
+ /**
11663
+ * Decode μ-law (G.711-U, "PCMU") bytes into signed 16-bit PCM samples.
11664
+ * Input is treated as one byte per sample at the source rate (usually 8 kHz mono).
11665
+ */
11666
+ declare function mulawToPcm16(bytes: Uint8Array | Buffer): Int16Array;
11667
+ /**
11668
+ * Decode A-law (G.711-A, "PCMA") bytes into signed 16-bit PCM samples.
11669
+ * Some Reolink clients (and some non-Reolink WHEP gateways) advertise PCMA
11670
+ * instead of PCMU on the backchannel; supporting both keeps the bridge generic.
11671
+ */
11672
+ declare function alawToPcm16(bytes: Uint8Array | Buffer): Int16Array;
11673
+
11674
+ /**
11675
+ * Linearly interpolate `src` by an integer `factor` so the output has
11676
+ * `src.length * factor` samples (minus tail) at `factor` times the input rate.
11677
+ *
11678
+ * Example: `upsamplePcm16(eightKhz, 2)` produces a 16 kHz signal.
11679
+ *
11680
+ * Edge cases:
11681
+ * - Empty input returns an empty array.
11682
+ * - factor = 1 returns a copy of the input.
11683
+ * - factor < 1 or non-integer throws.
11684
+ * - The last sample is held (no extrapolation beyond src[n-1]).
11685
+ */
11686
+ declare function upsamplePcm16(src: Int16Array, factor: number): Int16Array;
11687
+
11688
+ type BackchannelCodec = "pcmu" | "pcma";
11689
+ interface RtspBackchannelOptions {
11690
+ /** Lazy opener for the camera talk session. Called once on `start()`. */
11691
+ openTalkSession: () => Promise<TalkSession$1>;
11692
+ /** Used for diagnostic messages; defaults to silent. */
11693
+ logger?: Logger;
11694
+ /**
11695
+ * Maximum PCM (16-bit, 16 kHz) bytes to buffer before dropping older samples
11696
+ * to keep latency bounded. 96 000 bytes ≈ 3 s of audio at 16 kHz mono — much
11697
+ * smaller than that and a momentary stall will starve the camera; much bigger
11698
+ * and the operator hears their own voice with a noticeable delay.
11699
+ */
11700
+ maxPcmBacklogBytes?: number;
11701
+ /**
11702
+ * Override the auto-detected RTP payload type. Useful for clients that send
11703
+ * PCMA without a proper PT header.
11704
+ */
11705
+ forceCodec?: BackchannelCodec;
11706
+ }
11707
+ interface ParsedRtp {
11708
+ payloadType: number;
11709
+ payload: Buffer;
11710
+ }
11711
+ /**
11712
+ * Decode an RTP packet header far enough to extract its payload.
11713
+ * Returns `null` for malformed packets.
11714
+ *
11715
+ * Layout per RFC 3550 §5.1:
11716
+ * 2 bits V (=2) | 1 bit P | 1 bit X | 4 bits CC | 1 bit M | 7 bits PT | 16 bits seq
11717
+ * 32 bits timestamp | 32 bits SSRC | CC * 32 bits CSRC | optional extension | payload
11718
+ */
11719
+ declare function parseRtpPacket(packet: Buffer): ParsedRtp | null;
11720
+ /**
11721
+ * Pipes RTP PCMU / PCMA audio packets coming from a Frigate-style RTSP RECORD
11722
+ * client into a Reolink Baichuan TalkSession.
11723
+ *
11724
+ * The handler is intentionally I/O-free: the surrounding RTSP server (or any
11725
+ * unit test) feeds it RTP packets via `feedRtp()`. Internally it decodes
11726
+ * G.711 → PCM16 @ 8 kHz → upsample to 16 kHz → IMA ADPCM blocks → talk session
11727
+ * `sendAudio()`, clamping a rolling PCM backlog so a stalled camera socket
11728
+ * cannot grow latency unboundedly.
11729
+ */
11730
+ declare class RtspBackchannel {
11731
+ private readonly opts;
11732
+ private session;
11733
+ private pcmTail;
11734
+ private pcmBacklogBytes;
11735
+ private pumping;
11736
+ private active;
11737
+ private starting;
11738
+ private stopping;
11739
+ private lastBacklogClampLogMs;
11740
+ private rtpPacketsReceived;
11741
+ private rtpPacketsDropped;
11742
+ private adpcmBlocksSent;
11743
+ /** Lazily-set on the first decoded RTP packet so we log the negotiated codec exactly once. */
11744
+ private observedCodec;
11745
+ /** Sampled every `STATS_LOG_INTERVAL_MS` while audio flows. */
11746
+ private lastStatsLogMs;
11747
+ private lastStatsAdpcmBlocks;
11748
+ private lastStatsRtpPackets;
11749
+ private startedAtMs;
11750
+ private static readonly STATS_LOG_INTERVAL_MS;
11751
+ constructor(opts: RtspBackchannelOptions);
11752
+ get isActive(): boolean;
11753
+ get stats(): Readonly<{
11754
+ rtpPacketsReceived: number;
11755
+ rtpPacketsDropped: number;
11756
+ adpcmBlocksSent: number;
11757
+ }>;
11758
+ /** Open the underlying TalkSession. Safe to call concurrently; resolves to the same session. */
11759
+ start(): Promise<TalkSession$1>;
11760
+ /**
11761
+ * Feed one inbound RTP packet (as carried in TCP-interleaved framing or UDP
11762
+ * datagram). Discards malformed packets and packets received before `start()`.
11763
+ * The actual audio dispatch to the TalkSession is awaited internally; callers
11764
+ * may fire-and-forget.
11765
+ */
11766
+ feedRtp(packet: Buffer): void;
11767
+ /**
11768
+ * Throttled progress log (~every 5s while audio is flowing) so operators
11769
+ * can confirm the pipeline is making progress without per-packet noise.
11770
+ */
11771
+ private maybeLogStats;
11772
+ /** Flush remaining audio and stop the talk session. Idempotent. */
11773
+ stop(): Promise<void>;
11774
+ private enqueuePcm;
11775
+ private pumpAdpcm;
11776
+ }
11777
+
11778
+ /**
11779
+ * Dedicated, profile-independent RTSP server that ONLY exposes the
11780
+ * client→server talk-back audio leg of a Reolink camera.
11781
+ *
11782
+ * The Baichuan TalkSession is a per-camera concept (one talk slot per channel,
11783
+ * regardless of how many video stream profiles the camera advertises) so this
11784
+ * server lives next to the per-profile {@link BaichuanRtspServer} instances
11785
+ * rather than inside them. Frigate / go2rtc point a single stream URL at it
11786
+ * (typically with `?backchannel=1` so go2rtc switches to RECORD mode) and the
11787
+ * dedicated path carries no `main`/`sub`/`ext` profile suffix.
11788
+ *
11789
+ * Wire protocol: minimal subset of RTSP-over-TCP — OPTIONS, DESCRIBE, SETUP,
11790
+ * RECORD, TEARDOWN, optional Digest auth. The DESCRIBE SDP advertises a single
11791
+ * `audiobackchannel` track (PCMU 8 kHz, `a=sendonly`, ONVIF-style); SETUP
11792
+ * negotiates TCP-interleaved RTP channels; RECORD opens a dedicated
11793
+ * TalkSession on the underlying API and `RtspBackchannel` pumps audio.
11794
+ */
11795
+ interface BaichuanRtspBackchannelServerOptions {
11796
+ api: ReolinkBaichuanApi;
11797
+ /** Camera channel on the device (NVR child or 0 for standalone). */
11798
+ channel: number;
11799
+ /** Host to bind the listener to. Default 127.0.0.1. */
11800
+ listenHost?: string;
11801
+ /** TCP port to bind. Default 8555. */
11802
+ listenPort?: number;
11803
+ /**
11804
+ * Camera-level RTSP path served by this listener. Profile-agnostic by
11805
+ * design — e.g. `/talk/camera_studio` or `/camera_studio`. Default: `/talk`.
11806
+ */
11807
+ path?: string;
11808
+ logger?: Logger;
11809
+ /**
11810
+ * Optional Digest credentials. When set, every method except OPTIONS
11811
+ * requires the client to authenticate with one of these users.
11812
+ */
11813
+ credentials?: Array<{
11814
+ username: string;
11815
+ password: string;
11816
+ } | {
11817
+ username: string;
11818
+ password?: string;
11819
+ ha1: string;
11820
+ }>;
11821
+ requireAuth?: boolean;
11822
+ authRealm?: string;
11823
+ /**
11824
+ * Optional identifier passed to `createDedicatedTalkSession` so log lines
11825
+ * downstream (BaichuanClient, socket pool) attribute the talk socket to a
11826
+ * specific camera/device.
11827
+ */
11828
+ deviceId?: string;
11829
+ }
11830
+ declare class BaichuanRtspBackchannelServer extends EventEmitter<{
11831
+ client: [string];
11832
+ clientDisconnected: [string];
11833
+ error: [Error];
11834
+ }> {
11835
+ private readonly api;
11836
+ private readonly channel;
11837
+ private readonly listenHost;
11838
+ private readonly listenPort;
11839
+ private readonly path;
11840
+ private readonly logger;
11841
+ private readonly authCredentials;
11842
+ private readonly requireAuth;
11843
+ private readonly authRealm;
11844
+ private readonly deviceId;
11845
+ private server;
11846
+ /** Active backchannel sessions keyed by their per-client unique id. */
11847
+ private readonly sessionByClient;
11848
+ private readonly nonces;
11849
+ private static readonly NONCE_TTL_MS;
11850
+ constructor(options: BaichuanRtspBackchannelServerOptions);
11851
+ get listening(): boolean;
11852
+ start(): Promise<void>;
11853
+ stop(): Promise<void>;
11854
+ private handleConnection;
11855
+ /**
11856
+ * Drain pending bytes from the per-client buffer. Each iteration first
11857
+ * peels off any TCP-interleaved `$` frames at the head (routing them to
11858
+ * the session's RtspBackchannel handler when their channel matches) and
11859
+ * then attempts to parse a complete RTSP request.
11860
+ *
11861
+ * Implemented as a thin loop so the parser can yield back to the event
11862
+ * loop when the buffer is partial — no async work between frames keeps
11863
+ * the data path tight.
11864
+ */
11865
+ private drainBuffer;
11866
+ private handleRequest;
11867
+ private buildSdp;
11868
+ private wwwAuthenticate;
11869
+ private nonceFor;
11870
+ private validateDigest;
11871
+ }
11872
+
11638
11873
  /**
11639
11874
  * Optional STARTTLS support for the email-push SMTP server.
11640
11875
  *
@@ -11752,4 +11987,4 @@ interface CreateEmailPushServerParams {
11752
11987
  declare function getCameraEmailAddress(cameraId: string, domain: string): string;
11753
11988
  declare function createEmailPushServer(params: CreateEmailPushServerParams): EmailPushServerInstance;
11754
11989
 
11755
- export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, testChannelStreams, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
11990
+ export { type AIDetectionState, type AIEvent, type AIState, ALL_UDP_DISCOVERY_METHODS, type AbilityInfo, type AccessUserListConfig, AesStreamDecryptor, type AiAlarmConfig, type AiConfig, type AiDenoiseConfig, type AiDetectCfgZone, type AiKey, type AiTypesCacheEntry, type AnyBuffer, type AudioAlarmParams, type AudioCfgConfig, type AudioConfig, type AudioNoiseConfig, type AudioTaskConfig, type AutoDetectInputs, type AutoDetectMode, type AutoDetectResult, type AutoFocusConfig, type AutoRebootConfig, type AutoRebootConfigPatch, AutodiscoveryClient, type AutodiscoveryClientOptions, BC_AES_IV, BC_CLASS_FILE_DOWNLOAD, BC_CLASS_LEGACY, BC_CLASS_MODERN_20, BC_CLASS_MODERN_24, BC_CLASS_MODERN_24_ALT, BC_CMD_ID_ABILITY_INFO, BC_CMD_ID_ALARM_EVENT_LIST, BC_CMD_ID_AUDIO_ALARM_PLAY, BC_CMD_ID_CHANNEL_INFO_ALL, BC_CMD_ID_CMD_123, BC_CMD_ID_CMD_209, BC_CMD_ID_CMD_265, BC_CMD_ID_CMD_440, BC_CMD_ID_COVER_PREVIEW, BC_CMD_ID_COVER_RESPONSE, BC_CMD_ID_COVER_STANDALONE_458, BC_CMD_ID_COVER_STANDALONE_459, BC_CMD_ID_COVER_STANDALONE_460, BC_CMD_ID_COVER_STANDALONE_461, BC_CMD_ID_COVER_STANDALONE_462, BC_CMD_ID_DING_DONG_CTRL, BC_CMD_ID_DING_DONG_OPT, BC_CMD_ID_FILE_INFO_LIST_CLOSE, BC_CMD_ID_FILE_INFO_LIST_DL_VIDEO, BC_CMD_ID_FILE_INFO_LIST_DOWNLOAD, BC_CMD_ID_FILE_INFO_LIST_GET, BC_CMD_ID_FILE_INFO_LIST_OPEN, BC_CMD_ID_FILE_INFO_LIST_REPLAY, BC_CMD_ID_FILE_INFO_LIST_STOP, BC_CMD_ID_FIND_REC_VIDEO_CLOSE, BC_CMD_ID_FIND_REC_VIDEO_GET, BC_CMD_ID_FIND_REC_VIDEO_OPEN, BC_CMD_ID_FLOODLIGHT_STATUS_LIST, BC_CMD_ID_GET_ABILITY_SUPPORT, BC_CMD_ID_GET_ACCESS_USER_LIST, BC_CMD_ID_GET_AI_ALARM, BC_CMD_ID_GET_AI_CFG, BC_CMD_ID_GET_AI_DENOISE, BC_CMD_ID_GET_AUDIO_ALARM, BC_CMD_ID_GET_AUDIO_CFG, BC_CMD_ID_GET_AUDIO_TASK, BC_CMD_ID_GET_AUTO_FOCUS, BC_CMD_ID_GET_AUTO_REBOOT, BC_CMD_ID_GET_BATTERY_INFO, BC_CMD_ID_GET_BATTERY_INFO_LIST, BC_CMD_ID_GET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_GET_DAY_RECORDS, BC_CMD_ID_GET_DING_DONG_CFG, BC_CMD_ID_GET_DING_DONG_LIST, BC_CMD_ID_GET_DING_DONG_SILENT, BC_CMD_ID_GET_DST, BC_CMD_ID_GET_EMAIL, BC_CMD_ID_GET_EMAIL_TASK, BC_CMD_ID_GET_ENC, BC_CMD_ID_GET_FTP_TASK, BC_CMD_ID_GET_HDD_INFO_LIST, BC_CMD_ID_GET_KIT_AP_CFG, BC_CMD_ID_GET_LED_STATE, BC_CMD_ID_GET_MOTION_ALARM, BC_CMD_ID_GET_NTP, BC_CMD_ID_GET_ONLINE_USER_LIST, BC_CMD_ID_GET_OSD_DATETIME, BC_CMD_ID_GET_PIR_INFO, BC_CMD_ID_GET_PRIVACY_MASK, BC_CMD_ID_GET_PTZ_POSITION, BC_CMD_ID_GET_PTZ_PRESET, BC_CMD_ID_GET_PUSH_TASK, BC_CMD_ID_GET_RECORD, BC_CMD_ID_GET_RECORD_CFG, BC_CMD_ID_GET_REC_ENC_CFG, BC_CMD_ID_GET_SIREN_STATUS, BC_CMD_ID_GET_SLEEP_STATE, BC_CMD_ID_GET_SNAPSHOT, BC_CMD_ID_GET_STREAM_INFO_LIST, BC_CMD_ID_GET_SUPPORT, BC_CMD_ID_GET_SYSTEM_GENERAL, BC_CMD_ID_GET_TIMELAPSE_CFG, BC_CMD_ID_GET_UID, BC_CMD_ID_GET_VERSION_INFO, BC_CMD_ID_GET_VIDEO_INPUT, BC_CMD_ID_GET_WHITE_LED, BC_CMD_ID_GET_WIFI, BC_CMD_ID_GET_WIFI_SIGNAL, BC_CMD_ID_GET_ZOOM_FOCUS, BC_CMD_ID_LOGIN, BC_CMD_ID_LOGOUT, BC_CMD_ID_PING, BC_CMD_ID_PTZ_CONTROL, BC_CMD_ID_PTZ_CONTROL_PRESET, BC_CMD_ID_PUSH_COORDINATE_POINT_LIST, BC_CMD_ID_PUSH_DINGDONG_LIST, BC_CMD_ID_PUSH_NET_INFO, BC_CMD_ID_PUSH_SERIAL, BC_CMD_ID_PUSH_SLEEP_STATUS, BC_CMD_ID_PUSH_VIDEO_INPUT, BC_CMD_ID_QUICK_REPLY_PLAY, BC_CMD_ID_SET_AI_ALARM, BC_CMD_ID_SET_AI_CFG, BC_CMD_ID_SET_AI_DENOISE, BC_CMD_ID_SET_AUDIO_CFG, BC_CMD_ID_SET_AUDIO_TASK, BC_CMD_ID_SET_AUTO_FOCUS, BC_CMD_ID_SET_AUTO_REBOOT, BC_CMD_ID_SET_DAY_NIGHT_THRESHOLD, BC_CMD_ID_SET_DING_DONG_CFG, BC_CMD_ID_SET_DING_DONG_SILENT, BC_CMD_ID_SET_DST, BC_CMD_ID_SET_EMAIL, BC_CMD_ID_SET_EMAIL_TASK, BC_CMD_ID_SET_ENC, BC_CMD_ID_SET_LED_STATE, BC_CMD_ID_SET_MOTION_ALARM, BC_CMD_ID_SET_NTP, BC_CMD_ID_SET_OSD_DATETIME, BC_CMD_ID_SET_PIR_INFO, BC_CMD_ID_SET_PRIVACY_MASK, BC_CMD_ID_SET_PUSH_TASK, BC_CMD_ID_SET_RECORD, BC_CMD_ID_SET_RECORD_CFG, BC_CMD_ID_SET_SYSTEM_GENERAL, BC_CMD_ID_SET_VIDEO_INPUT, BC_CMD_ID_SET_WHITE_LED_STATE, BC_CMD_ID_SET_WHITE_LED_TASK, BC_CMD_ID_SET_ZOOM_FOCUS, BC_CMD_ID_SUPPORT, BC_CMD_ID_TALK, BC_CMD_ID_TALK_ABILITY, BC_CMD_ID_TALK_CONFIG, BC_CMD_ID_TALK_RESET, BC_CMD_ID_TEST_EMAIL, BC_CMD_ID_UDP_KEEP_ALIVE, BC_CMD_ID_VIDEO, BC_CMD_ID_VIDEO_STOP, BC_MAGIC, BC_MAGIC_REV, BC_TCP_DEFAULT_PORT, BC_XML_KEY, type BackchannelCodec, type BaichuanCachedPush, BaichuanClient, type BaichuanClientOptions, type BaichuanCoordinatePointListPush, type BaichuanDingdongListPush, type BaichuanEndpointsServerOptions, BaichuanEventEmitter, type BaichuanFloodlightStatusPush, type BaichuanFrame, BaichuanFrameParser, type BaichuanGetOsdDatetimeResult, type BaichuanHeader, BaichuanHlsServer, type BaichuanHlsServerOptions, BaichuanHttpStreamServer, type BaichuanHttpStreamServerOptions, type BaichuanLedState, BaichuanMjpegServer, type BaichuanMjpegServerOptions, type BaichuanNetInfoPush, type BaichuanOsdChannelName, type BaichuanOsdDatetime, type BaichuanRecordCfg, type BaichuanRecordSchedule, BaichuanRtspBackchannelServer, type BaichuanRtspBackchannelServerOptions, BaichuanRtspServer, type BaichuanRtspServerOptions, type BaichuanSerialPush, type BaichuanSettingsPushCacheEntry, type BaichuanSirenStatusPush, type BaichuanSleepState, type BaichuanSleepStatusPush, type BaichuanStreamEncodeTable, type BaichuanStreamInfo, type BaichuanStreamInfoList, type BaichuanTransport, type BaichuanVersionInfo, type BaichuanVideoInputPush, BaichuanVideoStream, type BaichuanVideoStreamOptions, BaichuanWebRTCServer, type BaichuanWebRTCServerOptions, type BaichuanWifi, type BaichuanWifiSignal, type BatteryInfo, type BatteryInfoResponse, type BcMedia, type BcMediaAac, type BcMediaAdpcm, BcMediaAnnexBDecoder, type BcMediaAnnexBDecoderStats, type BcMediaAnnexBInfo, type BcMediaAudioFrame, type BcMediaAudioType, BcMediaCodec, type BcMediaIframe, type BcMediaInfoV1, type BcMediaInfoV2, type BcMediaPframe, type BcMediaType, type BcMediaVideoFrame, type BcMediaVideoType, type BcUdpDiscoveryMethod, BcUdpStream, type BcUdpStreamOptions, type CgiAbility, type CgiAbilityChn, type CgiAbilityLeaf, type CgiAiAlarm, type CgiAiCfg, type CgiAiKey, type CgiAiStateValue, type CgiAudioAlarm, type CgiAudioAlarmPlayParam, type CgiAudioCfg, type CgiAudioNoise, type CgiAutoFocus, type CgiBattery, type CgiChannelStatusEntry, type CgiChnTypeInfoValue, type CgiDetectionState, type CgiDevInfo, type CgiDeviceInfoEntries, type CgiEmail, type CgiEnc, type CgiEncStream, type CgiEncValue, type CgiGetAbilityResponse, type CgiGetAbilityValue, type CgiGetAiAlarmValue, type CgiGetAiCfgValue, type CgiGetAiStateResponse, type CgiGetAudioAlarmValue, type CgiGetAudioCfgValue, type CgiGetAudioNoiseValue, type CgiGetAutoFocusValue, type CgiGetChannelstatusResponse, type CgiGetChannelstatusValue, type CgiGetChnTypeInfoResponse, type CgiGetDevInfoResponse, type CgiGetDevInfoValue, type CgiGetEmailValue, type CgiGetEncResponse, type CgiGetImageValue, type CgiGetIrLightsValue, type CgiGetIspValue, type CgiGetMaskValue, type CgiGetMdAlarmValue, type CgiGetOsdValue, type CgiGetPushValue, type CgiGetRecValue, type CgiGetRtspUrlResponse, type CgiGetRtspUrlValue, type CgiGetVideoclipsParams, type CgiImage, type CgiIrLights, type CgiIsp, type CgiMask, type CgiMaskShelter, type CgiMdAlarm, type CgiMdAlarmScope, type CgiMdAlarmSens, type CgiNetPort, type CgiOsd, type CgiPirInfo, type CgiPtzPreset, type CgiPush, type CgiRec, type CgiRecSchedule, type CgiSetAiAlarmParam, type CgiSetAiCfgParam, type CgiSetAudioAlarmParam, type CgiSetAudioCfgParam, type CgiSetAudioNoiseParam, type CgiSetAutoFocusParam, type CgiSetEmailParam, type CgiSetEncParam, type CgiSetImageParam, type CgiSetIrLightsParam, type CgiSetIspParam, type CgiSetMaskParam, type CgiSetMdAlarmParam, type CgiSetOsdParam, type CgiSetPirInfoParam, type CgiSetPushParam, type CgiSetRecParam, type CgiSetWhiteLedParam, type CgiWhiteLed, type ChannelPushCacheEntry, type ChannelPushDataEntry, type ChannelRecordingFile, type ChannelStreamMetadata, type ChimeAlarmCfg, type ChimeCfg, type ChimeDevice, type ChimeParams, type CollectNvrDiagnosticsOptions, CompositeRtspServer, type CompositeRtspServerOptions, CompositeStream, type CompositeStreamOptions, type CompositeStreamPipOptions, type CompressionStream, type CreateEmailPushServerParams, DEFAULT_SHELTER_CANVAS, DUAL_LENS_DUAL_MOTION_MODELS, DUAL_LENS_MODELS, DUAL_LENS_SINGLE_MOTION_MODELS, type DayNightThresholdConfig, type DayOfWeek, type DebugConfig, type DebugOptions, type DeviceAbilities, type DeviceCapabilities, type DeviceCapabilitiesCacheEntry, type DeviceCapabilitiesDebugInfo, type DeviceCapabilitiesResult, type DeviceInfoResponse, type DeviceInputData, type DeviceObjectType, type DeviceStatusResponse, type DeviceSupportFlags, type DeviceType, type DiagnosticsCollectorResult, type DiagnosticsStreamKind, type DiscoveredDevice, type DiscoveryOptions, type DownloadRecordingParams, type DstConfig, type DstConfigPatch, type DualLensChannelAnalysis, type DualLensChannelInfo, type EmailAttachmentType, type EmailConfig, type EmailConfigPatch, type EmailPushEvent, type EmailPushInferredType, type EmailPushLogger, type EmailPushServerConfig, type EmailPushServerInstance, type EmailPushServerStatus, type EmailPushTlsOptions, type EmailTaskConfig, type EmailTaskScheduleItem, type EmailTextType, type EncConfig, type EncOptions, type EncResolutionOption, type EncStreamOptions, type EncStreamPatch, type EncryptionProtocol, type Events, type EventsResponse, type FloodlightTaskConfig, type FloodlightTaskState, type FtpTaskConfig, type GetRecordingVideoResult, type GetRecordingVideoStats, type GetVideoclipsParams, type GetVodUrlParams, Go2rtcTcpServer, type Go2rtcTcpServerOptions, H264RtpDepacketizer, H265RtpDepacketizer, type HardwiredChimeState, type HddInfoListConfig, type HlsCodec, type HlsHttpResponse, type HlsServerStatus, type HlsSession, HlsSessionManager, type HlsSessionManagerOptions, type HlsSessionParams, Intercom, type IntercomOptions, type IrLightsConfig, type IspConfig, type JsonObject, type JsonPrimitive, type JsonValue, type LastSleepProbe, type LoadTlsParams, type LogLevel, type Logger, type LoggerCallback, type LoginResponseValue, type MaskConfig, type MaxEncryption, type MediaStream, type MjpegFrame, MjpegTransformer, type MjpegTransformerOptions, type ModelFixtureCaptureResult, type MotionAlarmConfig, type MotionEvent, type MotionSensitivityBand, type MotionZoneScope, MpegTsMuxer, type MpegTsMuxerOptions, NVR_HUB_EXACT_TYPES, NVR_HUB_MODEL_PATTERNS, type NativeVideoStreamVariant, type NtpConfig, type NtpConfigPatch, type NvrChannelsSummaryCacheEntry, type OnlineUserListConfig, type OsdChannel, type OsdConfig, type OsdDateFormat, type OsdTime, type ParsedRecordingFileName, type PipPosition, type PirConfig, type PirState, type PlaybackSnapshotStreamInfo, type PrivacyMaskZones, type PtzCommand, type PtzPosition, type PtzPreset, type RecEncConfig, type RecordingAudioCodec, type RecordingDetectionClass, type RecordingDevType, type RecordingFile, type RecordingPlaybackUrls, type RecordingStreamType, type RecordingVideoCodec, type RecordingVodFlags, type RecordingVodStreamHint, type RecordingsCacheEntry, type RecordingsQueueItem, type ReolinkAiNotification, ReolinkBaichuanApi, type ReolinkBaichuanChannelIdentity, type ReolinkBaichuanChannelInfo, type ReolinkBaichuanDeviceSummary, type ReolinkBaichuanNetworkInfo, type ReolinkBaichuanPorts, ReolinkCgiApi, type ReolinkCmdRequest, type ReolinkCmdResponse, type ReolinkCmdResponseExt, type ReolinkDayNightNotification, type ReolinkDetectionBox, type ReolinkDetectionDecodeState, type ReolinkDetectionEvent, type ReolinkDeviceInfo, type ReolinkDeviceInfoTag, type ReolinkEvent, ReolinkHttpClient, type ReolinkHttpClientOptions, type ReolinkJson, type ReolinkMotionNotification, type ReolinkNvrChannelInfo, type ReolinkNvrDeviceGroupSummary, type ReolinkNvrDeviceGroupsResult, type ReolinkSimpleEvent, type ReolinkSimpleEventType, type ReolinkSupportedStream, type ReolinkVideoStreamOptionsResult, type ReolinkVisitorNotification, type ReplayHttpServer, type ReplayHttpServerOptions, type ResponseMediaStreamOptions, type Rfc4571ApiFactoryContext, type Rfc4571Client, Rfc4571Muxer, type Rfc4571ReplayServer, type Rfc4571ReplayServerOptions, type Rfc4571TcpServer, type Rfc4571TcpServerOptions, type RtpPacketizationOptions, RtspBackchannel, type RtspBackchannelOptions, type RtspCreateOptions, type RtspProxyServerOptions, type RtspStreamProfile, type RunAllDiagnosticsConsecutivelyParams, type RunAllDiagnosticsConsecutivelyResult, type RunMultifocalDiagnosticsConsecutivelyParams, type RunMultifocalDiagnosticsConsecutivelyResult, type ShelterCanvas, type ShelterRect, type SirenState, type SirenStatusConfig, type SleepInferenceDecision, type SleepInferenceInput, type SleepInferencePending, type SleepState, type SleepStatus, type StreamMetadata, type StreamProfile, type StreamSamplingOptions, type StreamSamplingSelection, type SupportConfig, type SupportInfo, type SupportItem, type SystemGeneralConfig, type SystemGeneralPatch, type TalkAbility$1 as TalkAbility, type TalkAudioConfig, type TalkConfig, type TalkSession$1 as TalkSession, type TalkSessionInfo, type TimeFormat, type TimelapseCfgConfig, type TrackShelterRect, type TwoWayAudioConfig, type UdpDiscoveryMethod, type UnknownChunkListener, type VideoCodec, type VideoInputConfig, type VideoParamSets, type VideoStreamOptions, type VideoStreamOptionsCacheEntry, type VideoType, type VideoclipClientInfo, type VideoclipModeDecision, type VideoclipThumbnailResult, type VideoclipTranscodeMode, type VodFile, type VodSearchResponse, type VodSearchResult, type VodSearchStatus, type WakeUpOptions, type WebRTCAnswer, type WebRTCIceCandidate, type WebRTCOffer, type WebRTCSessionInfo, type WhiteLedConfig, type WhiteLedState, type WirelessChimeSilentState, type XmlJsonObject, type XmlJsonPrimitive, type XmlJsonValue, type ZoomFocusStatus, type ZoomFocusTriplet, _resetEmailPushBusForTests, abilitiesHasAny, aesDecrypt, aesEncrypt, alawToPcm16, applyStreamPatch, applyXmlTagPatch, asLogger, autoDetectDeviceType, bcDecrypt, bcEncrypt, bcHeaderHasPayloadOffset, buildAacAudioSpecificConfigHex, buildAbilityInfoExtensionXml, buildBinaryExtensionXml, buildChannelExtensionXml, buildFloodlightManualXml, buildHlsRedirectUrl, buildLoginXml, buildLogoutXml, buildPreviewStopXml, buildPreviewStopXmlV11, buildPreviewXml, buildPreviewXmlV11, buildPtzControlXml, buildPtzPresetXml, buildPtzPresetXmlV2, buildRfc4571Sdp, buildRtspPath, buildRtspUrl, buildSirenManualXml, buildSirenTimesXml, buildStartZoomFocusXml, buildWhiteLedStateXml, captureModelFixtures, collectCgiDiagnostics, collectMultifocalDiagnostics, collectNativeDiagnostics, collectNvrDiagnostics, computeDeviceCapabilities, computeExpectedStreamCompatibility, convertToAnnexB as convertH265ToAnnexB, convertToAnnexB$1 as convertToAnnexB, convertToLengthPrefixed, createBaichuanEndpointsServer, createDebugGateLogger, createDiagnosticsBundle, createEmailPushServer, createLogger, createMjpegBoundary, createNativeStream, createNullLogger, createReplayHttpServer, createRfc4571TcpServer, createRfc4571TcpServerForReplay, createRtspProxyServer, createTaggedLogger, decideSleepInferenceTransition, decideVideoclipTranscodeMode, decodeAiDetectCfg, decodeHeader, decodeMotionScopeBitmap, decodePrivacyMaskZones, decodeShelterCoord, deriveAesKey, detectIosClient, detectVideoCodecFromNal, discoverReolinkDevices, discoverViaArpTable, discoverViaDhcpListener, discoverViaHttpScan, discoverViaOnvif, discoverViaTcpPortScan, discoverViaUdpBroadcast, discoverViaUdpDirect, emitEmailPushEvent, encodeHeader, encodeImaAdpcm, encodeMotionScopeBitmap, encodeMotionSensitivityListXml, encodeShelterCoord, encodeShelterListXml, encodeTrackShelterListXml, ensureXmlHeader, extractCanvasFromShelterXml, extractH264ParamSetsFromAccessUnit, extractH265ParamSetsFromAccessUnit, extractPpsFromAnnexB, extractSpsFromAnnexB, extractVpsFromAnnexB, flattenAbilitiesForChannel, formatMjpegFrame, fullCoverageScope, getCameraEmailAddress, getConstructedVideoStreamOptions, getEmailPushCameraResolver, getGlobalLogger, getH265NalType, getLastEmailPushEvent, getMjpegContentType, getRecentEmailPushEvents, getSupportItemForChannel, getVideoStream, getVideoclipClientInfo, getXmlText, hasStartCodes as hasH265StartCodes, hasStartCodes$1 as hasStartCodes, isDualLenseModel, isH264KeyframeAnnexB, isH265Irap, isH265KeyframeAnnexB, isNvrHubModel, isTcpFailureThatShouldFallbackToUdp, isValidH264AnnexBAccessUnit, isValidH265AnnexBAccessUnit, loadEmailPushTls, mapEmailPushInferredType, maskUid, md5HexUpper, md5StrModern, mulawToPcm16, normalizeDayNightMode, normalizeOpenClose, normalizeUid, onEmailPushEvent, packetizeAacAdtsFrame, packetizeAacRawFrame, packetizeH264, packetizeH265, parseAdtsHeader, parseBcMedia, parseRecordingFileName, parseRtpPacket, parseSupportXml, patchAiDetectCfgXml, patchMotionSensitivityListXml, patchNestedTag, patchShelterXml, printNvrDiagnostics, runAllDiagnosticsConsecutively, runMultifocalDiagnosticsConsecutively, sampleStreams, sanitizeFixtureData, selectViableUdpMethods, setEmailPushCameraResolver, setGlobalLogger, splitAnnexBToNalPayloads$1 as splitAnnexBToNalPayloads, splitAnnexBToNals, splitAnnexBToNalPayloads as splitH265AnnexBToNalPayloads, testChannelStreams, upsamplePcm16, upsertXmlTag, xmlEscape, xmlIndicatesFloodlight, zipDirectory };
package/dist/index.d.ts CHANGED
@@ -221,6 +221,13 @@ export declare type AiTypesCacheEntry = {
221
221
  updatedAtMs: number;
222
222
  };
223
223
 
224
+ /**
225
+ * Decode A-law (G.711-A, "PCMA") bytes into signed 16-bit PCM samples.
226
+ * Some Reolink clients (and some non-Reolink WHEP gateways) advertise PCMA
227
+ * instead of PCMU on the backchannel; supporting both keeps the bridge generic.
228
+ */
229
+ export declare function alawToPcm16(bytes: Uint8Array | Buffer): Int16Array;
230
+
224
231
  /**
225
232
  * All BCUDP discovery methods, in the order they should be raced when a UID is available.
226
233
  */
@@ -507,6 +514,8 @@ export declare interface AutoRebootConfig {
507
514
 
508
515
  export declare type AutoRebootConfigPatch = Partial<AutoRebootConfig>;
509
516
 
517
+ export declare type BackchannelCodec = "pcmu" | "pcma";
518
+
510
519
  export declare type BaichuanCachedPush<T> = {
511
520
  updatedAtMs: number;
512
521
  value: T;
@@ -1433,6 +1442,102 @@ export declare type BaichuanRecordSchedule = {
1433
1442
  }>;
1434
1443
  };
1435
1444
 
1445
+ export declare class BaichuanRtspBackchannelServer extends EventEmitter<{
1446
+ client: [string];
1447
+ clientDisconnected: [string];
1448
+ error: [Error];
1449
+ }> {
1450
+ private readonly api;
1451
+ private readonly channel;
1452
+ private readonly listenHost;
1453
+ private readonly listenPort;
1454
+ private readonly path;
1455
+ private readonly logger;
1456
+ private readonly authCredentials;
1457
+ private readonly requireAuth;
1458
+ private readonly authRealm;
1459
+ private readonly deviceId;
1460
+ private server;
1461
+ /** Active backchannel sessions keyed by their per-client unique id. */
1462
+ private readonly sessionByClient;
1463
+ private readonly nonces;
1464
+ private static readonly NONCE_TTL_MS;
1465
+ constructor(options: BaichuanRtspBackchannelServerOptions);
1466
+ get listening(): boolean;
1467
+ start(): Promise<void>;
1468
+ stop(): Promise<void>;
1469
+ private handleConnection;
1470
+ /**
1471
+ * Drain pending bytes from the per-client buffer. Each iteration first
1472
+ * peels off any TCP-interleaved `$` frames at the head (routing them to
1473
+ * the session's RtspBackchannel handler when their channel matches) and
1474
+ * then attempts to parse a complete RTSP request.
1475
+ *
1476
+ * Implemented as a thin loop so the parser can yield back to the event
1477
+ * loop when the buffer is partial — no async work between frames keeps
1478
+ * the data path tight.
1479
+ */
1480
+ private drainBuffer;
1481
+ private handleRequest;
1482
+ private buildSdp;
1483
+ private wwwAuthenticate;
1484
+ private nonceFor;
1485
+ private validateDigest;
1486
+ }
1487
+
1488
+ /**
1489
+ * Dedicated, profile-independent RTSP server that ONLY exposes the
1490
+ * client→server talk-back audio leg of a Reolink camera.
1491
+ *
1492
+ * The Baichuan TalkSession is a per-camera concept (one talk slot per channel,
1493
+ * regardless of how many video stream profiles the camera advertises) so this
1494
+ * server lives next to the per-profile {@link BaichuanRtspServer} instances
1495
+ * rather than inside them. Frigate / go2rtc point a single stream URL at it
1496
+ * (typically with `?backchannel=1` so go2rtc switches to RECORD mode) and the
1497
+ * dedicated path carries no `main`/`sub`/`ext` profile suffix.
1498
+ *
1499
+ * Wire protocol: minimal subset of RTSP-over-TCP — OPTIONS, DESCRIBE, SETUP,
1500
+ * RECORD, TEARDOWN, optional Digest auth. The DESCRIBE SDP advertises a single
1501
+ * `audiobackchannel` track (PCMU 8 kHz, `a=sendonly`, ONVIF-style); SETUP
1502
+ * negotiates TCP-interleaved RTP channels; RECORD opens a dedicated
1503
+ * TalkSession on the underlying API and `RtspBackchannel` pumps audio.
1504
+ */
1505
+ export declare interface BaichuanRtspBackchannelServerOptions {
1506
+ api: ReolinkBaichuanApi;
1507
+ /** Camera channel on the device (NVR child or 0 for standalone). */
1508
+ channel: number;
1509
+ /** Host to bind the listener to. Default 127.0.0.1. */
1510
+ listenHost?: string;
1511
+ /** TCP port to bind. Default 8555. */
1512
+ listenPort?: number;
1513
+ /**
1514
+ * Camera-level RTSP path served by this listener. Profile-agnostic by
1515
+ * design — e.g. `/talk/camera_studio` or `/camera_studio`. Default: `/talk`.
1516
+ */
1517
+ path?: string;
1518
+ logger?: Logger;
1519
+ /**
1520
+ * Optional Digest credentials. When set, every method except OPTIONS
1521
+ * requires the client to authenticate with one of these users.
1522
+ */
1523
+ credentials?: Array<{
1524
+ username: string;
1525
+ password: string;
1526
+ } | {
1527
+ username: string;
1528
+ password?: string;
1529
+ ha1: string;
1530
+ }>;
1531
+ requireAuth?: boolean;
1532
+ authRealm?: string;
1533
+ /**
1534
+ * Optional identifier passed to `createDedicatedTalkSession` so log lines
1535
+ * downstream (BaichuanClient, socket pool) attribute the talk socket to a
1536
+ * specific camera/device.
1537
+ */
1538
+ deviceId?: string;
1539
+ }
1540
+
1436
1541
  /**
1437
1542
  * BaichuanRtspServer - RTSP server that serves a Baichuan video stream.
1438
1543
  *
@@ -4964,6 +5069,19 @@ export declare function encodeHeader(h: Omit<BaichuanHeader, "magic"> & {
4964
5069
  magic?: AnyBuffer;
4965
5070
  }): AnyBuffer;
4966
5071
 
5072
+ /**
5073
+ * Encode 16-bit signed PCM into IMA ADPCM blocks ready for `TalkSession.sendAudio()`.
5074
+ *
5075
+ * @param pcm 16-bit signed mono PCM samples (typically 16 kHz per Reolink TalkAbility).
5076
+ * @param blockSizeBytes Number of ADPCM payload bytes per block. The block encodes
5077
+ * `blockSizeBytes * 2 + 1` samples (one in the header + two per payload byte).
5078
+ * Reolink's default `lengthPerEncoder=1024` corresponds to a 4-byte header +
5079
+ * 1020 payload bytes per Baichuan ADPCM frame; the caller chooses what to pass.
5080
+ * @returns Concatenated blocks, each `4 + blockSizeBytes` bytes long. An empty
5081
+ * `pcm` yields an empty buffer.
5082
+ */
5083
+ export declare function encodeImaAdpcm(pcm: Int16Array, blockSizeBytes: number): Buffer;
5084
+
4967
5085
  /**
4968
5086
  * Encode a `width × height` boolean grid back into the camera's
4969
5087
  * `columns × rows` `valueTable`. Bits outside the active region stay 0,
@@ -6290,6 +6408,12 @@ export declare interface MpegTsMuxerOptions {
6290
6408
  includeAudio?: boolean;
6291
6409
  }
6292
6410
 
6411
+ /**
6412
+ * Decode μ-law (G.711-U, "PCMU") bytes into signed 16-bit PCM samples.
6413
+ * Input is treated as one byte per sample at the source rate (usually 8 kHz mono).
6414
+ */
6415
+ export declare function mulawToPcm16(bytes: Uint8Array | Buffer): Int16Array;
6416
+
6293
6417
  declare type NativeFrame = {
6294
6418
  audio: boolean;
6295
6419
  data: Buffer;
@@ -6467,6 +6591,11 @@ export declare interface ParsedRecordingFileName {
6467
6591
  heightRaw?: string;
6468
6592
  }
6469
6593
 
6594
+ declare interface ParsedRtp {
6595
+ payloadType: number;
6596
+ payload: Buffer;
6597
+ }
6598
+
6470
6599
  /**
6471
6600
  * Best-effort parse of Reolink VOD recording filenames.
6472
6601
  *
@@ -6480,6 +6609,16 @@ export declare interface ParsedRecordingFileName {
6480
6609
  */
6481
6610
  export declare function parseRecordingFileName(fileName: string): ParsedRecordingFileName | undefined;
6482
6611
 
6612
+ /**
6613
+ * Decode an RTP packet header far enough to extract its payload.
6614
+ * Returns `null` for malformed packets.
6615
+ *
6616
+ * Layout per RFC 3550 §5.1:
6617
+ * 2 bits V (=2) | 1 bit P | 1 bit X | 4 bits CC | 1 bit M | 7 bits PT | 16 bits seq
6618
+ * 32 bits timestamp | 32 bits SSRC | CC * 32 bits CSRC | optional extension | payload
6619
+ */
6620
+ export declare function parseRtpPacket(packet: Buffer): ParsedRtp | null;
6621
+
6483
6622
  export declare function parseSupportXml(xml: string): SupportInfo | undefined;
6484
6623
 
6485
6624
  /**
@@ -8880,12 +9019,23 @@ export declare class ReolinkBaichuanApi {
8880
9019
  * This is more reliable than autoPt in SupportInfo which can be a false positive
8881
9020
  * (e.g., NVR channels report autoPt=1 but don't actually support autotracking).
8882
9021
  *
9022
+ * Doorbell exception (mirrors the {@link computeDeviceCapabilities} floodlight
9023
+ * rule): video-doorbell firmwares (doorbellVersion > 0) ship AiCfg with
9024
+ * `smartTrackMode=1` (the current mode) yet `smartTrackModeAbility=0` (the
9025
+ * firmware's own "no, this device cannot autotrack" flag). Without a PT
9026
+ * motor a doorbell physically cannot autotrack, so when the caller flags the
9027
+ * device as a doorbell AND the firmware admits `smartTrackModeAbility=0`,
9028
+ * trust the firmware and return false. Verified against UID
9029
+ * 9527000ICL1T1MDS: smartTrackMode=1, smartTrackModeAbility=0,
9030
+ * ptzType=0, ptzMode="none", doorbellVersion=31.
9031
+ *
8883
9032
  * @param channel - Channel number (0-based)
8884
- * @param options - Optional timeout
9033
+ * @param options - Optional timeout and doorbell context hint
8885
9034
  * @returns true if autotracking is supported, false otherwise
8886
9035
  */
8887
9036
  probeAutotrackingSupport(channel: number, options?: {
8888
9037
  timeoutMs?: number;
9038
+ isDoorbell?: boolean;
8889
9039
  }): Promise<boolean>;
8890
9040
  /**
8891
9041
  * Returns AI object-detection types for a channel via cmd 299 (AiCfg).
@@ -11387,6 +11537,83 @@ declare class RtpWriter {
11387
11537
  writePacket(payload: Buffer, marker: boolean): Buffer;
11388
11538
  }
11389
11539
 
11540
+ /**
11541
+ * Pipes RTP PCMU / PCMA audio packets coming from a Frigate-style RTSP RECORD
11542
+ * client into a Reolink Baichuan TalkSession.
11543
+ *
11544
+ * The handler is intentionally I/O-free: the surrounding RTSP server (or any
11545
+ * unit test) feeds it RTP packets via `feedRtp()`. Internally it decodes
11546
+ * G.711 → PCM16 @ 8 kHz → upsample to 16 kHz → IMA ADPCM blocks → talk session
11547
+ * `sendAudio()`, clamping a rolling PCM backlog so a stalled camera socket
11548
+ * cannot grow latency unboundedly.
11549
+ */
11550
+ export declare class RtspBackchannel {
11551
+ private readonly opts;
11552
+ private session;
11553
+ private pcmTail;
11554
+ private pcmBacklogBytes;
11555
+ private pumping;
11556
+ private active;
11557
+ private starting;
11558
+ private stopping;
11559
+ private lastBacklogClampLogMs;
11560
+ private rtpPacketsReceived;
11561
+ private rtpPacketsDropped;
11562
+ private adpcmBlocksSent;
11563
+ /** Lazily-set on the first decoded RTP packet so we log the negotiated codec exactly once. */
11564
+ private observedCodec;
11565
+ /** Sampled every `STATS_LOG_INTERVAL_MS` while audio flows. */
11566
+ private lastStatsLogMs;
11567
+ private lastStatsAdpcmBlocks;
11568
+ private lastStatsRtpPackets;
11569
+ private startedAtMs;
11570
+ private static readonly STATS_LOG_INTERVAL_MS;
11571
+ constructor(opts: RtspBackchannelOptions);
11572
+ get isActive(): boolean;
11573
+ get stats(): Readonly<{
11574
+ rtpPacketsReceived: number;
11575
+ rtpPacketsDropped: number;
11576
+ adpcmBlocksSent: number;
11577
+ }>;
11578
+ /** Open the underlying TalkSession. Safe to call concurrently; resolves to the same session. */
11579
+ start(): Promise<TalkSession>;
11580
+ /**
11581
+ * Feed one inbound RTP packet (as carried in TCP-interleaved framing or UDP
11582
+ * datagram). Discards malformed packets and packets received before `start()`.
11583
+ * The actual audio dispatch to the TalkSession is awaited internally; callers
11584
+ * may fire-and-forget.
11585
+ */
11586
+ feedRtp(packet: Buffer): void;
11587
+ /**
11588
+ * Throttled progress log (~every 5s while audio is flowing) so operators
11589
+ * can confirm the pipeline is making progress without per-packet noise.
11590
+ */
11591
+ private maybeLogStats;
11592
+ /** Flush remaining audio and stop the talk session. Idempotent. */
11593
+ stop(): Promise<void>;
11594
+ private enqueuePcm;
11595
+ private pumpAdpcm;
11596
+ }
11597
+
11598
+ export declare interface RtspBackchannelOptions {
11599
+ /** Lazy opener for the camera talk session. Called once on `start()`. */
11600
+ openTalkSession: () => Promise<TalkSession>;
11601
+ /** Used for diagnostic messages; defaults to silent. */
11602
+ logger?: Logger;
11603
+ /**
11604
+ * Maximum PCM (16-bit, 16 kHz) bytes to buffer before dropping older samples
11605
+ * to keep latency bounded. 96 000 bytes ≈ 3 s of audio at 16 kHz mono — much
11606
+ * smaller than that and a momentary stall will starve the camera; much bigger
11607
+ * and the operator hears their own voice with a noticeable delay.
11608
+ */
11609
+ maxPcmBacklogBytes?: number;
11610
+ /**
11611
+ * Override the auto-detected RTP payload type. Useful for clients that send
11612
+ * PCMA without a proper PT header.
11613
+ */
11614
+ forceCodec?: BackchannelCodec;
11615
+ }
11616
+
11390
11617
  export declare type RtspCreateOptions = {
11391
11618
  listenHost?: string;
11392
11619
  listenPort?: number;
@@ -11920,6 +12147,20 @@ export declare type UnknownChunkListener = (info: {
11920
12147
  skipped: number;
11921
12148
  }) => void;
11922
12149
 
12150
+ /**
12151
+ * Linearly interpolate `src` by an integer `factor` so the output has
12152
+ * `src.length * factor` samples (minus tail) at `factor` times the input rate.
12153
+ *
12154
+ * Example: `upsamplePcm16(eightKhz, 2)` produces a 16 kHz signal.
12155
+ *
12156
+ * Edge cases:
12157
+ * - Empty input returns an empty array.
12158
+ * - factor = 1 returns a copy of the input.
12159
+ * - factor < 1 or non-integer throws.
12160
+ * - The last sample is held (no extrapolation beyond src[n-1]).
12161
+ */
12162
+ export declare function upsamplePcm16(src: Int16Array, factor: number): Int16Array;
12163
+
11923
12164
  /**
11924
12165
  * Like {@link applyXmlTagPatch} but inserts the tag at the end of the block
11925
12166
  * when it is not already present. Required for fields the camera omits on