rtsp-client: vmethod for modifying tunnel GET response

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
This commit is contained in:
David Svensson Fors 2014-03-06 13:52:02 +01:00 committed by Wim Taymans
parent dffdbbf090
commit faf0b31cbb
2 changed files with 23 additions and 2 deletions

View 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

View 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);