From b0dbc09ea204b1b194d70ca7aaa4703e3e02db09 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 17 Jul 2023 16:41:25 +0530 Subject: [PATCH] webrtcrenego: Use payload type correctly for the dynamic stream All streams were using pt=96 which is incorrect. In some cases that can cause EOS to be sent to both branches of the receiver. Part-of: --- .../tests/examples/webrtc/webrtcrenego.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c b/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c index a3a9b76cba..416cb2c167 100644 --- a/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c +++ b/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c @@ -8,8 +8,9 @@ static GMainLoop *loop; static GstElement *pipe1, *webrtc1, *webrtc2, *extra_src; static GstBus *bus1; -#define SEND_SRC(pattern) "videotestsrc is-live=true pattern=" pattern " ! timeoverlay ! queue ! vp8enc ! rtpvp8pay ! queue ! " \ - "capsfilter caps=application/x-rtp,media=video,payload=96,encoding-name=VP8" +#define SEND_SRC(pattern, pt) "videotestsrc is-live=true pattern=" pattern \ + " ! timeoverlay ! queue ! vp8enc ! rtpvp8pay ! queue ! capsfilter " \ + " caps=application/x-rtp,media=video,payload=" pt ",encoding-name=VP8" static void _element_message (GstElement * parent, GstMessage * msg) @@ -199,8 +200,8 @@ stream_change (gpointer data) { if (!extra_src) { g_print ("Adding extra stream\n"); - extra_src = - gst_parse_bin_from_description (SEND_SRC ("circular"), TRUE, NULL); + extra_src = gst_parse_bin_from_description (SEND_SRC ("circular", "97"), + TRUE, NULL); gst_element_set_locked_state (extra_src, TRUE); gst_bin_add (GST_BIN (pipe1), extra_src); @@ -249,8 +250,9 @@ main (int argc, char *argv[]) gst_init (&argc, &argv); loop = g_main_loop_new (NULL, FALSE); - pipe1 = gst_parse_launch (SEND_SRC ("smpte") - " ! webrtcbin name=smpte bundle-policy=max-bundle " SEND_SRC ("ball") + pipe1 = gst_parse_launch (SEND_SRC ("smpte", "96") + " ! webrtcbin name=smpte bundle-policy=max-bundle " + SEND_SRC ("ball", "96") " ! webrtcbin name=ball bundle-policy=max-bundle", NULL); g_object_set (pipe1, "message-forward", TRUE, NULL); bus1 = gst_pipeline_get_bus (GST_PIPELINE (pipe1));