From: David Svensson Fors Date: Thu, 6 Mar 2014 12:50:27 +0000 (+0100) Subject: rtspconnection: GstRTSPWatch func for tunnel GET response X-Git-Tag: 1.19.3~511^2~4659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=6cd0d10d30569549ede31b15486ec387819f8550;p=platform%2Fupstream%2Fgstreamer.git rtspconnection: GstRTSPWatch func for tunnel GET response 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 --- diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 13ca1d7..f988c0d 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -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; diff --git a/gst-libs/gst/rtsp/gstrtspconnection.h b/gst-libs/gst/rtsp/gstrtspconnection.h index 5d1129d..71686e0 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.h +++ b/gst-libs/gst/rtsp/gstrtspconnection.h @@ -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,