rtsp-client: add gst_rtsp_client_get_stream_transport()
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 5 Nov 2018 14:34:20 +0000 (15:34 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 6 Jun 2019 16:45:17 +0000 (18:45 +0200)
This will be used in the onvif tests in order to validate the
data transmitted over TCP: for streaming to continue after a
data message has been provided to client->send_func, the client
is responsible for marking the message as sent on the relevant
stream transport.

gst/rtsp-server/rtsp-client.c
gst/rtsp-server/rtsp-client.h

index 0593761..596f54b 100644 (file)
@@ -4581,6 +4581,26 @@ gst_rtsp_client_send_message (GstRTSPClient * client, GstRTSPSession * session,
   return GST_RTSP_OK;
 }
 
+/**
+ * gst_rtsp_client_get_stream_transport:
+ *
+ * This is useful when providing a send function through
+ * gst_rtsp_client_set_send_func() when doing RTSP over TCP:
+ * the send function must call gst_rtsp_stream_transport_message_sent ()
+ * on the appropriate transport when data has been received for streaming
+ * to continue.
+ *
+ * Returns: (transfer none) (nullable): the #GstRTSPStreamTransport associated with @channel.
+ *
+ * Since: 1.18
+ */
+GstRTSPStreamTransport *
+gst_rtsp_client_get_stream_transport (GstRTSPClient * self, guint8 channel)
+{
+  return g_hash_table_lookup (self->priv->transports,
+      GINT_TO_POINTER ((gint) channel));
+}
+
 static gboolean
 do_send_messages (GstRTSPClient * client, GstRTSPMessage * messages,
     guint n_messages, gboolean close, gpointer user_data)
index 2e47203..de958cc 100644 (file)
@@ -272,6 +272,9 @@ GList *                gst_rtsp_client_session_filter    (GstRTSPClient *client,
                                                           GstRTSPClientSessionFilterFunc func,
                                                           gpointer user_data);
 
+GST_RTSP_SERVER_API
+GstRTSPStreamTransport * gst_rtsp_client_get_stream_transport (GstRTSPClient *client,
+                                                               guint8 channel);
 
 
 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC