Commit 0d2d2743 authored by rbultje's avatar rbultje

Change function prototype of the sdp_parse_a_line in DynamicProtocolHandler.

This function is called in rtsp.c for each a= line in the SDP of the Describe
response after m= RTSP stream descriptors. The function prototype used to
take an AVStream argument. For RDT, however, every RTSPStream represents
a set of streams of identical content, and can thus represent multiple
AVStreams. Therefore, it should not take an AVStream as argument. This
patch modifies it to accept a AVFormatContext (of the RTSP/SDP demuxer)
instead. See discussion in "[PATCH/RFC] change function prototype of
parse_sdp_a_line" thread on ML.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16024 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent aa37adbc
...@@ -405,8 +405,10 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p) ...@@ -405,8 +405,10 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p)
} }
static int static int
rdt_parse_sdp_line (AVStream *stream, PayloadContext *rdt, const char *line) rdt_parse_sdp_line (AVFormatContext *s, int st_index,
PayloadContext *rdt, const char *line)
{ {
AVStream *stream = s->streams[st_index];
const char *p = line; const char *p = line;
if (av_strstart(p, "OpaqueData:buffer;", &p)) { if (av_strstart(p, "OpaqueData:buffer;", &p)) {
......
...@@ -348,9 +348,10 @@ static void h264_free_extradata(PayloadContext *data) ...@@ -348,9 +348,10 @@ static void h264_free_extradata(PayloadContext *data)
av_free(data); av_free(data);
} }
static int parse_h264_sdp_line(AVStream * stream, PayloadContext *h264_data, static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
const char *line) PayloadContext *h264_data, const char *line)
{ {
AVStream *stream = s->streams[st_index];
AVCodecContext *codec = stream->codec; AVCodecContext *codec = stream->codec;
const char *p = line; const char *p = line;
......
...@@ -66,7 +66,8 @@ struct RTPDynamicProtocolHandler_s { ...@@ -66,7 +66,8 @@ struct RTPDynamicProtocolHandler_s {
enum CodecID codec_id; enum CodecID codec_id;
// may be null // may be null
int (*parse_sdp_a_line) (AVStream * stream, int (*parse_sdp_a_line) (AVFormatContext *s,
int st_index,
PayloadContext *priv_data, PayloadContext *priv_data,
const char *line); ///< Parse the a= line from the sdp field const char *line); ///< Parse the a= line from the sdp field
PayloadContext *(*open) (); ///< allocate any data needed by the rtp parsing for this dynamic data. PayloadContext *(*open) (); ///< allocate any data needed by the rtp parsing for this dynamic data.
......
...@@ -518,7 +518,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, ...@@ -518,7 +518,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
rtsp_st = st->priv_data; rtsp_st = st->priv_data;
if (rtsp_st->sdp_payload_type == payload_type) { if (rtsp_st->sdp_payload_type == payload_type) {
if(rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->parse_sdp_a_line) { if(rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->parse_sdp_a_line) {
if(!rtsp_st->dynamic_handler->parse_sdp_a_line(st, rtsp_st->dynamic_protocol_context, buf)) { if(!rtsp_st->dynamic_handler->parse_sdp_a_line(s, i, rtsp_st->dynamic_protocol_context, buf)) {
sdp_parse_fmtp(st, p); sdp_parse_fmtp(st, p);
} }
} else { } else {
...@@ -535,7 +535,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, ...@@ -535,7 +535,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
rtsp_st = st->priv_data; rtsp_st = st->priv_data;
if (rtsp_st->sdp_payload_type == payload_type) { if (rtsp_st->sdp_payload_type == payload_type) {
if(rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->parse_sdp_a_line) { if(rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->parse_sdp_a_line) {
rtsp_st->dynamic_handler->parse_sdp_a_line(st, rtsp_st->dynamic_protocol_context, buf); rtsp_st->dynamic_handler->parse_sdp_a_line(s, i, rtsp_st->dynamic_protocol_context, buf);
} }
} }
} }
...@@ -553,7 +553,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, ...@@ -553,7 +553,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
rtsp_st = s->streams[s->nb_streams - 1]->priv_data; rtsp_st = s->streams[s->nb_streams - 1]->priv_data;
if (rtsp_st->dynamic_handler && if (rtsp_st->dynamic_handler &&
rtsp_st->dynamic_handler->parse_sdp_a_line) rtsp_st->dynamic_handler->parse_sdp_a_line)
rtsp_st->dynamic_handler->parse_sdp_a_line(s->streams[s->nb_streams - 1], rtsp_st->dynamic_handler->parse_sdp_a_line(s, s->nb_streams - 1,
rtsp_st->dynamic_protocol_context, buf); rtsp_st->dynamic_protocol_context, buf);
} }
break; break;
......
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