Skip to content

Commit 14e4421

Browse files
authored
streaming: add support for bufferkf_ms and bufferkf_bytes (#63)
* streaming: add support for bufferkf_ms and bufferkf_bytes
1 parent 458d16c commit 14e4421

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/plugins/streaming-plugin.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,13 @@ class StreamingHandle extends Handle {
582582
* @param {string} [params.video.rtpmap] - rtpmap that will be used
583583
* @param {boolean} [params.video.skew] - Set skew compensation
584584
* @param {string} [params.video.fmtp] - fmtp that will be used
585-
* @param {boolean} [params.video.buffer] - Enable buffering of the keyframes
585+
* @param {boolean} [params.video.buffer] - Enable buffering of the keyframes (deprecated, see bufferkf_ms and bufferkf_bytes)
586586
* @param {Object} [params.data] - The datachannel descriptor for the mp
587587
* @param {number} [params.data.port] - Port used for datachannels packets
588588
* @param {boolean} [params.data.buffer] - Enable buffering of the datachannels
589589
* @param {object[]} [params.media] - [multistream] The media object, each media includes type, mid, port, pt ...
590+
* @param {number} [params.bufferkf_ms] - Enable buffering of the video keyframes (milliseconds)
591+
* @param {number} [params.bufferkf_bytes] - Enable buffering of the video keyframes (bytes)
590592
* @param {number} [params.threads] - The number of helper threads used in this mp
591593
* @param {Object} [params.metadata] - An opaque metadata to add to the mp
592594
* @param {number} [params.collision] - The stream collision discarding time in number of milliseconds (0=disabled)
@@ -603,7 +605,7 @@ class StreamingHandle extends Handle {
603605
* @param {boolean} [params.rtsp.notifyChanges] - Whether subscribers should receive an event when connection to the RTSP server is lost/restored
604606
* @returns {Promise<module:streaming-plugin~STREAMING_EVENT_CREATED>}
605607
*/
606-
async createRtpMountpoint({ id = 0, name, description, secret, pin, admin_key, permanent = false, is_private = false, e2ee = false, audio, video, data, media, threads, metadata, collision, rtsp}) {
608+
async createRtpMountpoint({ id = 0, name, description, secret, pin, admin_key, permanent = false, is_private = false, e2ee = false, audio, video, data, media, bufferkf_ms, bufferkf_bytes, threads, metadata, collision, rtsp}) {
607609
const body = {
608610
request: REQUEST_CREATE,
609611
type: 'rtp',
@@ -657,6 +659,8 @@ class StreamingHandle extends Handle {
657659
if (typeof data.buffer === 'boolean') body.databuffermsg = data.buffer;
658660
}
659661
}
662+
if (typeof bufferkf_ms === 'number') body.bufferkf_ms = bufferkf_ms;
663+
if (typeof bufferkf_bytes === 'number') body.bufferkf_bytes = bufferkf_bytes;
660664
if (typeof threads === 'number' && threads > 0) body.threads = threads;
661665
if (metadata) body.metadata = metadata;
662666
if (typeof collision === 'number') body.collision = collision;

0 commit comments

Comments
 (0)