diff options
author | Andriy Rysin <arysin@bcsii.net> | 2003-04-04 13:29:58 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-04 13:29:58 +0000 |
commit | 0df65975baf9090b4d9e6eced343c50e5ccd1689 (patch) | |
tree | f072807bcc11cafb1d5314d95065dd915cd8f057 /ffserver.c | |
parent | 98ca7790e32dab39fd57b5aadf29eed59e790896 (diff) | |
download | ffmpeg-0df65975baf9090b4d9e6eced343c50e5ccd1689.tar.gz |
RTSP "OPTIONS" command patch by (Andriy Rysin <arysin at bcsii dot net>)
Originally committed as revision 1728 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c index 173ae8457b..e55169e164 100644 --- a/ffserver.c +++ b/ffserver.c @@ -245,6 +245,7 @@ static int compute_send_delay(HTTPContext *c); /* RTSP handling */ static int rtsp_parse_request(HTTPContext *c); static void rtsp_cmd_describe(HTTPContext *c, const char *url); +static void rtsp_cmd_options(HTTPContext *c, const char *url); static void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPHeader *h); static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPHeader *h); static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h); @@ -2613,6 +2614,8 @@ static int rtsp_parse_request(HTTPContext *c) if (!strcmp(cmd, "DESCRIBE")) { rtsp_cmd_describe(c, url); + } else if (!strcmp(cmd, "OPTIONS")) { + rtsp_cmd_options(c, url); } else if (!strcmp(cmd, "SETUP")) { rtsp_cmd_setup(c, url, header); } else if (!strcmp(cmd, "PLAY")) { @@ -2724,6 +2727,15 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, return -1; } +static void rtsp_cmd_options(HTTPContext *c, const char *url) +{ +// rtsp_reply_header(c, RTSP_STATUS_OK); + url_fprintf(c->pb, "RTSP/1.0 %d %s\r\n", RTSP_STATUS_OK, "OK"); + url_fprintf(c->pb, "CSeq: %d\r\n", c->seq); + url_fprintf(c->pb, "Public: %s\r\n", "OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE"); + url_fprintf(c->pb, "\r\n"); +} + static void rtsp_cmd_describe(HTTPContext *c, const char *url) { FFStream *stream; |