summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-12-15 11:07:01 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-01-08 13:26:01 +0000
commitac5213dcdf09f95c71329005a865a39867c3e7c1 (patch)
tree7735c01e7ae8b0bfb9b6204f655c0839f72ba571
parentd6d3ecaafb3d3027f081cfc167e05ea676acbbd7 (diff)
rtspclientsink: Add "update-sdp" signal that allows updating the SDP before sending it to the server
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/178>
-rw-r--r--docs/gst_plugins_cache.json9
-rw-r--r--gst/rtsp-sink/gstrtspclientsink.c19
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/gst_plugins_cache.json b/docs/gst_plugins_cache.json
index 5d695dc..3df5ca6 100644
--- a/docs/gst_plugins_cache.json
+++ b/docs/gst_plugins_cache.json
@@ -414,6 +414,15 @@
],
"return-type": "GstCaps",
"when": "last"
+ },
+ "update-sdp": {
+ "args": [
+ {
+ "name": "arg0",
+ "type": "GstSDPMessage"
+ }
+ ],
+ "return-type": "void"
}
}
}
diff --git a/gst/rtsp-sink/gstrtspclientsink.c b/gst/rtsp-sink/gstrtspclientsink.c
index c420e46..090a264 100644
--- a/gst/rtsp-sink/gstrtspclientsink.c
+++ b/gst/rtsp-sink/gstrtspclientsink.c
@@ -246,6 +246,7 @@ enum
SIGNAL_NEW_PAYLOADER,
SIGNAL_REQUEST_RTCP_KEY,
SIGNAL_ACCEPT_CERTIFICATE,
+ SIGNAL_UPDATE_SDP,
LAST_SIGNAL
};
@@ -805,6 +806,22 @@ gst_rtsp_client_sink_class_init (GstRTSPClientSinkClass * klass)
G_TYPE_BOOLEAN, 3, G_TYPE_TLS_CONNECTION, G_TYPE_TLS_CERTIFICATE,
G_TYPE_TLS_CERTIFICATE_FLAGS);
+ /**
+ * GstRTSPClientSink::update-sdp:
+ * @rtsp_client_sink: a #GstRTSPClientSink
+ * @sdp: a #GstSDPMessage
+ *
+ * Emitted right before the ANNOUNCE request is sent to the server with the
+ * generated SDP. The SDP can be updated from signal handlers but the order
+ * and number of medias must not be changed.
+ *
+ * Since: 1.20
+ */
+ gst_rtsp_client_sink_signals[SIGNAL_UPDATE_SDP] =
+ g_signal_new_class_handler ("update-sdp", G_TYPE_FROM_CLASS (klass),
+ 0, 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 1, GST_TYPE_SDP_MESSAGE | G_SIGNAL_TYPE_STATIC_SCOPE);
+
gstelement_class->provide_clock = gst_rtsp_client_sink_provide_clock;
gstelement_class->change_state = gst_rtsp_client_sink_change_state;
gstelement_class->request_new_pad =
@@ -4453,6 +4470,8 @@ gst_rtsp_client_sink_record (GstRTSPClientSink * sink, gboolean async)
if (res < 0)
goto create_request_failed;
+ g_signal_emit (sink, gst_rtsp_client_sink_signals[SIGNAL_UPDATE_SDP], 0, sdp);
+
gst_rtsp_message_add_header (&request, GST_RTSP_HDR_CONTENT_TYPE,
"application/sdp");