rtspconnection: GstRTSPWatch func for tunnel GET response
authorDavid Svensson Fors <davidsf@axis.com>
Thu, 6 Mar 2014 12:50:27 +0000 (13:50 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 10 Mar 2014 09:43:03 +0000 (10:43 +0100)
Add a callback in GstRTSPWatch where the response to HTTP GET for
tunneled connections can be modified.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725878

gst-libs/gst/rtsp/gstrtspconnection.c
gst-libs/gst/rtsp/gstrtspconnection.h

index 13ca1d7..f988c0d 100644 (file)
@@ -3138,6 +3138,9 @@ gst_rtsp_source_dispatch_read (GPollableInputStream * stream,
 
         /* queue the response */
         response = gen_tunnel_reply (conn, code, &watch->message);
+        if (watch->funcs.tunnel_http_response)
+          watch->funcs.tunnel_http_response (watch, &watch->message, response,
+              watch->user_data);
         gst_rtsp_watch_send_message (watch, response, NULL);
         gst_rtsp_message_free (response);
         goto read_done;
index 5d1129d..71686e0 100644 (file)
@@ -164,6 +164,9 @@ typedef struct _GstRTSPWatch GstRTSPWatch;
  * @error_full: callback when an error occured with more information than
  *   the @error callback.
  * @tunnel_lost: callback when the post connection of a tunnel is closed.
+ * @tunnel_http_response: callback when an HTTP response to the GET request
+ *   is about to be sent for a tunneled connection. The response can be
+ *   modified in the callback. Since 1.4.
  *
  * Callback functions from a #GstRTSPWatch.
  */
@@ -181,9 +184,13 @@ typedef struct {
                                          GstRTSPMessage *message, guint id,
                                          gpointer user_data);
   GstRTSPResult     (*tunnel_lost)      (GstRTSPWatch *watch, gpointer user_data);
+  GstRTSPResult     (*tunnel_http_response) (GstRTSPWatch *watch,
+                                             GstRTSPMessage *request,
+                                             GstRTSPMessage *response,
+                                             gpointer user_data);
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING];
+  gpointer _gst_reserved[GST_PADDING-1];
 } GstRTSPWatchFuncs;
 
 GstRTSPWatch *     gst_rtsp_watch_new                (GstRTSPConnection *conn,