rtsp-client: vmethod for modifying tunnel GET response
authorDavid Svensson Fors <davidsf@axis.com>
Thu, 6 Mar 2014 12:52:02 +0000 (13:52 +0100)
committerWim Taymans <wtaymans@redhat.com>
Tue, 11 Mar 2014 10:17:04 +0000 (11:17 +0100)
Add a vmethod tunnel_http_response where the response to the HTTP GET
for tunneled connections can be modified.

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

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

index 1a3fa45..5ccc5b4 100644 (file)
@@ -2821,6 +2821,22 @@ tunnel_closed:
   }
 }
 
+static GstRTSPResult
+tunnel_http_response (GstRTSPWatch * watch, GstRTSPMessage * request,
+    GstRTSPMessage * response, gpointer user_data)
+{
+  GstRTSPClientClass *klass;
+
+  GstRTSPClient *client = GST_RTSP_CLIENT (user_data);
+  klass = GST_RTSP_CLIENT_GET_CLASS (client);
+
+  if (klass->tunnel_http_response) {
+    klass->tunnel_http_response (client, request, response);
+  }
+
+  return GST_RTSP_OK;
+}
+
 static GstRTSPWatchFuncs watch_funcs = {
   message_received,
   message_sent,
@@ -2829,7 +2845,8 @@ static GstRTSPWatchFuncs watch_funcs = {
   tunnel_start,
   tunnel_complete,
   error_full,
-  tunnel_lost
+  tunnel_lost,
+  tunnel_http_response
 };
 
 static void
index 17086e5..01f8208 100644 (file)
@@ -85,6 +85,8 @@ struct _GstRTSPClient {
  *    RTSP response(ctx->response) via a call to gst_rtsp_message_init_response()
  * @params_get: get parameters. This function should also initialize the
  *    RTSP response(ctx->response) via a call to gst_rtsp_message_init_response()
+ * @tunnel_http_response: called when a response to the GET request is about to
+ *   be sent for a tunneled connection. The response can be modified. Since 1.4
  *
  * The client class structure.
  */
@@ -115,8 +117,10 @@ struct _GstRTSPClientClass {
   void     (*get_parameter_request)   (GstRTSPClient *client, GstRTSPContext *ctx);
   void     (*handle_response)         (GstRTSPClient *client, GstRTSPContext *ctx);
 
+  void     (*tunnel_http_response)    (GstRTSPClient * client, GstRTSPMessage * request,
+                                       GstRTSPMessage * response);
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING_LARGE];
+  gpointer _gst_reserved[GST_PADDING_LARGE-1];
 };
 
 GType                 gst_rtsp_client_get_type          (void);