mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
sendrecv/gst: Add no-op audio/video converters
This reduces the chance that someone will try to change the audio/video source elements and get an error because they don't know about the conversion elements. They will be no-ops in the usual case. Closes https://github.com/centricular/gstwebrtc-demos/issues/8
This commit is contained in:
parent
7c5fbf1aca
commit
47bfa3cc27
1 changed files with 4 additions and 2 deletions
|
@ -117,6 +117,8 @@ handle_media_stream (GstPad * pad, GstElement * pipe, const char * convert_name,
|
|||
g_assert_nonnull (sink);
|
||||
|
||||
if (g_strcmp0 (convert_name, "audioconvert") == 0) {
|
||||
/* Might also need to resample, so add it just in case.
|
||||
* Will be a no-op if it's not required. */
|
||||
resample = gst_element_factory_make ("audioresample", NULL);
|
||||
g_assert_nonnull (resample);
|
||||
gst_bin_add_many (GST_BIN (pipe), q, conv, resample, sink, NULL);
|
||||
|
@ -279,9 +281,9 @@ start_pipeline (void)
|
|||
|
||||
pipe1 =
|
||||
gst_parse_launch ("webrtcbin name=sendrecv " STUN_SERVER
|
||||
"videotestsrc pattern=ball ! queue ! vp8enc deadline=1 ! rtpvp8pay ! "
|
||||
"videotestsrc pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! "
|
||||
"queue ! " RTP_CAPS_VP8 "96 ! sendrecv. "
|
||||
"audiotestsrc wave=red-noise ! queue ! opusenc ! rtpopuspay ! "
|
||||
"audiotestsrc wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! "
|
||||
"queue ! " RTP_CAPS_OPUS "97 ! sendrecv. ",
|
||||
&error);
|
||||
|
||||
|
|
Loading…
Reference in a new issue