Commit b17d11c6 authored by Martin Storsjö's avatar Martin Storsjö

Add separate method/url parameters to the rtsp_send_cmd functions

Originally committed as revision 22675 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c5c20ae4
This diff is collapsed.
......@@ -330,13 +330,16 @@ extern int rtsp_rtp_port_max;
* Send a command to the RTSP server without waiting for the reply.
*
* @param s RTSP (de)muxer context
* @param cmd the full first line of the request
* @param method the method for the request
* @param url the target url for the request
* @param headers extra header lines to include in the request
* @param send_content if non-null, the data to send as request body content
* @param send_content_length the length of the send_content data, or 0 if
* send_content is null
*/
void ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
const char *cmd,
const char *method, const char *url,
const char *headers,
const unsigned char *send_content,
int send_content_length);
/**
......@@ -344,13 +347,16 @@ void ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
*
* @see rtsp_send_cmd_with_content_async
*/
void ff_rtsp_send_cmd_async(AVFormatContext *s, const char *cmd);
void ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method,
const char *url, const char *headers);
/**
* Send a command to the RTSP server and wait for the reply.
*
* @param s RTSP (de)muxer context
* @param cmd the full first line of the request
* @param method the method for the request
* @param url the target url for the request
* @param headers extra header lines to include in the request
* @param reply pointer where the RTSP message header will be stored
* @param content_ptr pointer where the RTSP message body, if any, will
* be stored (length is in reply)
......@@ -359,7 +365,8 @@ void ff_rtsp_send_cmd_async(AVFormatContext *s, const char *cmd);
* send_content is null
*/
void ff_rtsp_send_cmd_with_content(AVFormatContext *s,
const char *cmd,
const char *method, const char *url,
const char *headers,
RTSPMessageHeader *reply,
unsigned char **content_ptr,
const unsigned char *send_content,
......@@ -370,7 +377,8 @@ void ff_rtsp_send_cmd_with_content(AVFormatContext *s,
*
* @see rtsp_send_cmd_with_content
*/
void ff_rtsp_send_cmd(AVFormatContext *s, const char *cmd,
void ff_rtsp_send_cmd(AVFormatContext *s, const char *method,
const char *url, const char *headers,
RTSPMessageHeader *reply, unsigned char **content_ptr);
/**
......
......@@ -36,11 +36,9 @@ static int rtsp_write_record(AVFormatContext *s)
char cmd[1024];
snprintf(cmd, sizeof(cmd),
"RECORD %s RTSP/1.0\r\n"
"Range: npt=%0.3f-\r\n",
rt->control_uri,
(double) 0);
ff_rtsp_send_cmd(s, cmd, reply, NULL);
ff_rtsp_send_cmd(s, "RECORD", rt->control_uri, cmd, reply, NULL);
if (reply->status_code != RTSP_STATUS_OK)
return -1;
rt->state = RTSP_STATE_STREAMING;
......@@ -159,12 +157,8 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
static int rtsp_write_close(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
char cmd[1024];
snprintf(cmd, sizeof(cmd),
"TEARDOWN %s RTSP/1.0\r\n",
rt->control_uri);
ff_rtsp_send_cmd_async(s, cmd);
ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
ff_rtsp_close_streams(s);
url_close(rt->rtsp_hd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment