summaryrefslogtreecommitdiff
path: root/gst
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:08:16 +1100
commitb38eb8e99efe0147b15ed443d2481d3786d9e1df (patch)
tree9187327abca3330f2b90e3da377c118894b67771 /gst
parentf00ac2daf244fecf59272bfd841685cc0af7d512 (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
Diffstat (limited to 'gst')
-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 f5b5cf2..d10b139 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);