stream-transport: add keep-alive method
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 12 Nov 2012 16:11:18 +0000 (17:11 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 12 Nov 2012 16:11:18 +0000 (17:11 +0100)
gst/rtsp-server/rtsp-stream-transport.c
gst/rtsp-server/rtsp-stream-transport.h
gst/rtsp-server/rtsp-stream.c

index 3d97db6..c81a149 100644 (file)
@@ -216,3 +216,16 @@ gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport * trans,
 
   return res;
 }
+
+/**
+ * gst_rtsp_stream_transport_keep_alive:
+ * @trans: a #GstRTSPStreamTransport
+ *
+ * Signal the installed keep_alive callback for @trans.
+ */
+void
+gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport * trans)
+{
+  if (trans->keep_alive)
+    trans->keep_alive (trans->ka_user_data);
+}
index f478805..96bf7b6 100644 (file)
@@ -110,6 +110,8 @@ gboolean                 gst_rtsp_stream_transport_send_rtp      (GstRTSPStreamT
 gboolean                 gst_rtsp_stream_transport_send_rtcp     (GstRTSPStreamTransport *trans,
                                                                   GstBuffer *buffer);
 
+void                     gst_rtsp_stream_transport_keep_alive    (GstRTSPStreamTransport *trans);
+
 G_END_DECLS
 
 #endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */
index f9aba19..de35bc7 100644 (file)
@@ -455,12 +455,10 @@ on_ssrc_active (GObject * session, GObject * source, GstRTSPStream * stream)
 
   trans = check_transport (source, stream);
 
-  if (trans)
+  if (trans) {
     GST_INFO ("%p: source %p in transport %p is active", stream, source, trans);
-
-  if (trans && trans->keep_alive)
-    trans->keep_alive (trans->ka_user_data);
-
+    gst_rtsp_stream_transport_keep_alive (trans);
+  }
 #ifdef DUMP_STATS
   {
     GstStructure *stats;