summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-11-21 23:29:56 +1100
committerMatthew Waters <matthew@centricular.com>2016-11-23 23:09:26 +1100
commit5011f59b421922aae6fbfce680f0edc3ec13c6b1 (patch)
tree087e174782ac51df85964d55c1127fdf87ab0423
parent8164844ee3533796e280041dfe89d21922ed22f9 (diff)
stream: block the output of rtpbin instead of the source pipeline
85c52e194bcb81928b96614be0ae47d59eccb1ce introduced a more correct detection of the srtp rollover counter to add to the SDP. Unfortunately, it was incomplete for live pipelines where the logic blocks the source bin before creating the SDP and thus would never have the necessary informaiton to create a correct SDP with srtp encryption. Move the pad blocks to rtpbin's output pads instead so that the necessary information can be created before we need the information for the SDP. https://bugzilla.gnome.org/show_bug.cgi?id=770239
-rw-r--r--gst/rtsp-server/rtsp-stream.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c
index f5b5cf2d45..d10b1392b8 100644
--- a/gst/rtsp-server/rtsp-stream.c
+++ b/gst/rtsp-server/rtsp-stream.c
@@ -149,7 +149,7 @@ struct _GstRTSPStreamPrivate
gint dscp_qos;
/* stream blocking */
- gulong blocked_id;
+ gulong blocked_id[2];
gboolean blocking;
/* pt->caps map for RECORD streams */
@@ -3689,6 +3689,7 @@ gboolean
gst_rtsp_stream_set_blocked (GstRTSPStream * stream, gboolean blocked)
{
GstRTSPStreamPrivate *priv;
+ int i;
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE);
@@ -3697,18 +3698,22 @@ gst_rtsp_stream_set_blocked (GstRTSPStream * stream, gboolean blocked)
g_mutex_lock (&priv->lock);
if (blocked) {
priv->blocking = FALSE;
- if (priv->blocked_id == 0) {
- priv->blocked_id = gst_pad_add_probe (priv->srcpad,
- GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_BUFFER |
- GST_PAD_PROBE_TYPE_BUFFER_LIST, pad_blocking,
- g_object_ref (stream), g_object_unref);
+ for (i = 0; i < 2; i++) {
+ if (priv->blocked_id[i] == 0) {
+ priv->blocked_id[i] = gst_pad_add_probe (priv->send_src[i],
+ GST_PAD_PROBE_TYPE_BLOCK | GST_PAD_PROBE_TYPE_BUFFER |
+ GST_PAD_PROBE_TYPE_BUFFER_LIST, pad_blocking,
+ g_object_ref (stream), g_object_unref);
+ }
}
} else {
- if (priv->blocked_id != 0) {
- gst_pad_remove_probe (priv->srcpad, priv->blocked_id);
- priv->blocked_id = 0;
- priv->blocking = FALSE;
+ for (i = 0; i < 2; i++) {
+ if (priv->blocked_id[i] != 0) {
+ gst_pad_remove_probe (priv->send_src[i], priv->blocked_id[i]);
+ priv->blocked_id[i] = 0;
+ }
}
+ priv->blocking = FALSE;
}
g_mutex_unlock (&priv->lock);