@mega-yfue/eufy-sdk 0.5.0-beta.58 → 0.5.0-beta.59
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/core/contracts.d.ts
CHANGED
|
@@ -544,6 +544,12 @@ export interface LiveVideoConfig {
|
|
|
544
544
|
width: number;
|
|
545
545
|
height: number;
|
|
546
546
|
}
|
|
547
|
+
/** Video frame paired with its original SDK source-arrival time. */
|
|
548
|
+
export interface ReceivedVideoFrame {
|
|
549
|
+
readonly frame: LiveVideoFrame;
|
|
550
|
+
/** Wall-clock milliseconds when the shared source received the frame; preserved on replay. */
|
|
551
|
+
readonly timestampMs: number;
|
|
552
|
+
}
|
|
547
553
|
/**
|
|
548
554
|
* Elementary-stream audio codec of a {@link LiveAudioFrame}. The station declares it per frame as a
|
|
549
555
|
* byte in the `CMD_AUDIO_FRAME` header — unlike video, nothing is sniffed. These are the three values
|
|
@@ -823,12 +829,15 @@ export interface MediaProvider {
|
|
|
823
829
|
}): Promise<Buffer>;
|
|
824
830
|
/**
|
|
825
831
|
* Open a video-only `node:stream` Readable over a shared source consumer — raw Annex-B bytes
|
|
826
|
-
* (default) or `objectMode` {@link LiveVideoFrame}s.
|
|
827
|
-
* {@link
|
|
828
|
-
*
|
|
832
|
+
* (default) or `objectMode` {@link LiveVideoFrame}s. With objectMode and arrivalTime, it yields
|
|
833
|
+
* {@link ReceivedVideoFrame} envelopes whose original source-arrival time survives retained replay.
|
|
834
|
+
* Raw mode ignores arrivalTime. Audio is available separately through {@link live} or muxed through
|
|
835
|
+
* {@link recordFragments}; it is never interleaved into raw video. The caller owns the Readable's
|
|
836
|
+
* lifetime, and destroying it releases the shared pull.
|
|
829
837
|
*/
|
|
830
838
|
openReadable?(opts?: {
|
|
831
839
|
objectMode?: boolean;
|
|
840
|
+
arrivalTime?: boolean;
|
|
832
841
|
} & SharedSourceHints & AbortableCall): Promise<import("node:stream").Readable>;
|
|
833
842
|
/**
|
|
834
843
|
* Continuously record the live feed as fragmented-MP4 (CMAF). The caller-owned
|
package/dist/index.js
CHANGED
|
@@ -20396,12 +20396,15 @@ function openReadableFromConsumer(consumer, opts = {}) {
|
|
|
20396
20396
|
cb(err);
|
|
20397
20397
|
}
|
|
20398
20398
|
});
|
|
20399
|
-
|
|
20400
|
-
|
|
20401
|
-
|
|
20399
|
+
consumer.onMedia((item) => {
|
|
20400
|
+
if (item.kind !== "video")
|
|
20401
|
+
return;
|
|
20402
|
+
const value = objectMode ? opts.arrivalTime ? { frame: item.frame, timestampMs: item.timestampMs } : item.frame : item.frame.data;
|
|
20403
|
+
if (!readable.push(value))
|
|
20402
20404
|
consumer.pause();
|
|
20403
|
-
};
|
|
20404
|
-
consumer.on("video",
|
|
20405
|
+
});
|
|
20406
|
+
consumer.on("video", () => {
|
|
20407
|
+
});
|
|
20405
20408
|
consumer.on("stop", () => readable.push(null));
|
|
20406
20409
|
consumer.on("error", (err) => readable.destroy(err));
|
|
20407
20410
|
return readable;
|