After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772478 - Missing video stream from SDP
Missing video stream from SDP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.8.3
Other Linux
: Normal normal
: 1.10.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-05 21:02 UTC by Xavier Claessens
Modified: 2016-10-31 14:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stream: Fix randomly missing streams from SDP with dynamic elements (1.38 KB, patch)
2016-10-06 15:55 UTC, Xavier Claessens
committed Details | Review

Description Xavier Claessens 2016-10-05 21:02:11 UTC
I have an RTSP server streaming local files. Those files could have audio or video or both. I'm using "dynpay0" to add pads dynamically depending on what's on the file when I start it. Sometimes when playing a stream that should have both audio and video, the client receives an SDP that has only audio.

My understanding (but I'm not sure yet) is that rtsp-media gets into  pad_added_cb() code path then calls gst_rtsp_stream_join_bin(). That function will connect to "notify::caps" signal on priv->send_src[0]. But since the media is in PAUSED state already, caps could already be set on the pad and notify signal won't be emitted. In that case priv->caps stay to NULL. In that case gst_rtsp_sdp_from_stream() won't have the caps and thus will ignore that stream.
Comment 1 Xavier Claessens 2016-10-06 15:55:08 UTC
Created attachment 337077 [details] [review]
stream: Fix randomly missing streams from SDP with dynamic elements

When using dynamic elements, gst_rtsp_stream_join_bin() is called from
"pad-added" signal. In that case priv->srcpad could already have its caps,
and they'll be sent to priv->send_src[0] pad. That means that when it
connects "notify::caps" signal, that pad could already have received its
caps and the signal won't be emitted anymore.

In that case priv->caps stay to NULL and when building the SDP that stream
gets ignored. Leading to missing video or audio when playing in client side.
Comment 2 Sebastian Dröge (slomo) 2016-10-06 15:58:26 UTC
Comment on attachment 337077 [details] [review]
stream: Fix randomly missing streams from SDP with dynamic elements

Check if priv->caps is set already, and you need to lock here and in caps_notify callback.
Comment 3 Xavier Claessens 2016-10-06 16:00:48 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Check if priv->caps is set already, and you need to lock here and in
> caps_notify callback.

It already has priv->lock and caps_notify gets it as well. priv->caps cannot be already set because only caps_notify() set it and it just connected the signal there.
Comment 4 Sebastian Dröge (slomo) 2016-10-06 16:02:31 UTC
Comment on attachment 337077 [details] [review]
stream: Fix randomly missing streams from SDP with dynamic elements

Does not apply to git master
Comment 5 Sebastian Dröge (slomo) 2016-10-06 16:06:07 UTC
Attachment 337077 [details] pushed as c0f24fe - stream: Fix randomly missing streams from SDP with dynamic elements
Comment 6 Sebastian Dröge (slomo) 2016-10-06 16:06:47 UTC
Comment on attachment 337077 [details] [review]
stream: Fix randomly missing streams from SDP with dynamic elements

It does when manually applying it with patch --merge