Skip to content

Commit

Permalink
src: stream: sink: Use pipeline clock for the WebRTC's RTP
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso authored and patrickelectric committed Mar 9, 2024
1 parent f10f896 commit 486d295
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/stream/sink/webrtc_sink.rs
Expand Up @@ -342,6 +342,20 @@ impl WebRTCSink {
rx.recv()??
};

// Configure RTP
let webrtcbin = webrtcbin.downcast::<gst::Bin>().unwrap();
webrtcbin
.iterate_elements()
.filter(|e| e.name().starts_with("rtpbin"))
.into_iter()
.for_each(|res| {
let Ok(rtp_bin) = res else { return };

// Use the pipeline clock time. This will ensure that the timestamps from the source are correct.
rtp_bin.set_property_from_str("ntp-time-source", "clock-time");
});
let webrtcbin = webrtcbin.upcast::<gst::Element>();

let webrtcbin_sink_pad = webrtcbin
.request_pad_simple("sink_%u")
.context("Failed requesting sink pad for webrtcsink")?;
Expand Down

0 comments on commit 486d295

Please sign in to comment.