sendrecv: port all examples to use a max-bundle policy
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 15 Oct 2018 18:45:57 +0000 (20:45 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Mon, 15 Oct 2018 18:46:28 +0000 (20:46 +0200)
webrtc/sendrecv/gst-rust/src/main.rs
webrtc/sendrecv/gst-sharp/WebRTCSendRecv.cs
webrtc/sendrecv/gst/webrtc-sendrecv.c
webrtc/sendrecv/gst/webrtc-sendrecv.py

index 5d6041c..531a133 100644 (file)
@@ -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)?;
index 15f79db..f7de6a9 100644 (file)
@@ -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
+}
index b6bc6ff..685ab79 100644 (file)
@@ -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);
 
index e5220c2..88870b1 100644 (file)
@@ -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.
 '''