GST_RTSP_STATE_UNLOCK (src);
}
+static GstRTSPResult
+gst_rtspsrc_init_request (GstRTSPSrc * src, GstRTSPMessage * msg,
+ GstRTSPMethod method, const gchar * uri)
+{
+ GstRTSPResult res;
+
+ res = gst_rtsp_message_init_request (msg, method, uri);
+ if (res < 0)
+ return res;
+
+ /* TODO add common initialization here */
+
+ return res;
+}
+
/* FIXME, handle server request, reply with OK, for now */
static GstRTSPResult
gst_rtspsrc_handle_request (GstRTSPSrc * src, GstRTSPConnection * conn,
if (control == NULL)
goto no_control;
- res = gst_rtsp_message_init_request (&request, method, control);
+ res = gst_rtspsrc_init_request (src, &request, method, control);
if (res < 0)
goto send_error;
/* create SETUP request */
res =
- gst_rtsp_message_init_request (&request, GST_RTSP_SETUP,
+ gst_rtspsrc_init_request (src, &request, GST_RTSP_SETUP,
stream->conninfo.location);
if (res < 0) {
g_free (transports);
/* create OPTIONS */
GST_DEBUG_OBJECT (src, "create options...");
res =
- gst_rtsp_message_init_request (&request, GST_RTSP_OPTIONS,
+ gst_rtspsrc_init_request (src, &request, GST_RTSP_OPTIONS,
src->conninfo.url_str);
if (res < 0)
goto create_request_failed;
/* create DESCRIBE */
GST_DEBUG_OBJECT (src, "create describe...");
res =
- gst_rtsp_message_init_request (&request, GST_RTSP_DESCRIBE,
+ gst_rtspsrc_init_request (src, &request, GST_RTSP_DESCRIBE,
src->conninfo.url_str);
if (res < 0)
goto create_request_failed;
/* do TEARDOWN */
res =
- gst_rtsp_message_init_request (&request, GST_RTSP_TEARDOWN, setup_url);
+ gst_rtspsrc_init_request (src, &request, GST_RTSP_TEARDOWN, setup_url);
if (res < 0)
goto create_request_failed;
}
/* do play */
- res = gst_rtsp_message_init_request (&request, GST_RTSP_PLAY, setup_url);
+ res = gst_rtspsrc_init_request (src, &request, GST_RTSP_PLAY, setup_url);
if (res < 0)
goto create_request_failed;
("Sending PAUSE request"));
if ((res =
- gst_rtsp_message_init_request (&request, GST_RTSP_PAUSE,
+ gst_rtspsrc_init_request (src, &request, GST_RTSP_PAUSE,
setup_url)) < 0)
goto create_request_failed;