From 4df6d21992cd2e69c878266e350417d8c8abc48a Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 15 Oct 2018 20:45:57 +0200 Subject: [PATCH] sendrecv: port all examples to use a max-bundle policy --- webrtc/sendrecv/gst-rust/src/main.rs | 3 +++ webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs | 8 ++++---- webrtc/sendrecv/gst/webrtc-sendrecv.c | 6 +++--- webrtc/sendrecv/gst/webrtc-sendrecv.py | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/webrtc/sendrecv/gst-rust/src/main.rs b/webrtc/sendrecv/gst-rust/src/main.rs index 5d6041c..531a133 100644 --- a/webrtc/sendrecv/gst-rust/src/main.rs +++ b/webrtc/sendrecv/gst-rust/src/main.rs @@ -316,6 +316,7 @@ fn add_video_source(pipeline: &gst::Pipeline, webrtcbin: &gst::Element) -> Resul let vp8enc = gst::ElementFactory::make("vp8enc", None).unwrap(); videotestsrc.set_property_from_str("pattern", "ball"); + videotestsrc.set_property("is-live", &true).unwrap(); vp8enc.set_property("deadline", &1i64).unwrap(); let rtpvp8pay = gst::ElementFactory::make("rtpvp8pay", None).unwrap(); @@ -355,6 +356,7 @@ fn add_audio_source(pipeline: &gst::Pipeline, webrtcbin: &gst::Element) -> Resul let queue3 = gst::ElementFactory::make("queue", None).unwrap(); audiotestsrc.set_property_from_str("wave", "red-noise"); + audiotestsrc.set_property("is-live", &true).unwrap(); pipeline.add_many(&[ &audiotestsrc, @@ -430,6 +432,7 @@ impl AppControl { pipeline.add(&webrtcbin)?; webrtcbin.set_property_from_str("stun-server", STUN_SERVER); + webrtcbin.set_property_from_str("bundle-policy", "max-bundle"); add_video_source(&pipeline, &webrtcbin)?; add_audio_source(&pipeline, &webrtcbin)?; diff --git a/webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs b/webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs index 15f79db..f7de6a9 100644 --- a/webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs +++ b/webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs @@ -16,10 +16,10 @@ namespace GstWebRTCDemo { const string SERVER = "wss://127.0.0.1:8443"; - const string PIPELINE_DESC = @"webrtcbin name=sendrecv - videotestsrc pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! + const string PIPELINE_DESC = @"webrtcbin name=sendrecv bundle-policy=max-bundle + videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! sendrecv. - audiotestsrc wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! + audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv."; readonly int _id; @@ -306,4 +306,4 @@ namespace GstWebRTCDemo } } -} \ No newline at end of file +} diff --git a/webrtc/sendrecv/gst/webrtc-sendrecv.c b/webrtc/sendrecv/gst/webrtc-sendrecv.c index b6bc6ff..685ab79 100644 --- a/webrtc/sendrecv/gst/webrtc-sendrecv.c +++ b/webrtc/sendrecv/gst/webrtc-sendrecv.c @@ -330,10 +330,10 @@ start_pipeline (void) GError *error = NULL; pipe1 = - gst_parse_launch ("webrtcbin name=sendrecv " STUN_SERVER - "videotestsrc pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! " + gst_parse_launch ("webrtcbin bundle-policy=max-bundle name=sendrecv " STUN_SERVER + "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! " "queue ! " RTP_CAPS_VP8 "96 ! sendrecv. " - "audiotestsrc wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! " + "audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! " "queue ! " RTP_CAPS_OPUS "97 ! sendrecv. ", &error); diff --git a/webrtc/sendrecv/gst/webrtc-sendrecv.py b/webrtc/sendrecv/gst/webrtc-sendrecv.py index e5220c2..88870b1 100644 --- a/webrtc/sendrecv/gst/webrtc-sendrecv.py +++ b/webrtc/sendrecv/gst/webrtc-sendrecv.py @@ -16,10 +16,10 @@ gi.require_version('GstSdp', '1.0') from gi.repository import GstSdp PIPELINE_DESC = ''' -webrtcbin name=sendrecv - videotestsrc pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! +webrtcbin name=sendrecv bundle-policy=max-bundle + videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! sendrecv. - audiotestsrc wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! + audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! sendrecv. ''' -- 2.7.4