Commit 202a6697 authored by Colin McQuillan's avatar Colin McQuillan Committed by Ronald S. Bultje

Use named initializers and use new/free_context() instead of extradata()

for context allocators. Patch by Colin McQuillan m niloc googlemail com.

Originally committed as revision 19518 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent fccb1770
...@@ -511,7 +511,7 @@ ff_real_parse_sdp_a_line (AVFormatContext *s, int stream_index, ...@@ -511,7 +511,7 @@ ff_real_parse_sdp_a_line (AVFormatContext *s, int stream_index,
} }
static PayloadContext * static PayloadContext *
rdt_new_extradata (void) rdt_new_context (void)
{ {
PayloadContext *rdt = av_mallocz(sizeof(PayloadContext)); PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
...@@ -521,7 +521,7 @@ rdt_new_extradata (void) ...@@ -521,7 +521,7 @@ rdt_new_extradata (void)
} }
static void static void
rdt_free_extradata (PayloadContext *rdt) rdt_free_context (PayloadContext *rdt)
{ {
int i; int i;
...@@ -538,13 +538,13 @@ rdt_free_extradata (PayloadContext *rdt) ...@@ -538,13 +538,13 @@ rdt_free_extradata (PayloadContext *rdt)
#define RDT_HANDLER(n, s, t) \ #define RDT_HANDLER(n, s, t) \
static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \ static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
s, \ .enc_name = s, \
t, \ .codec_type = t, \
CODEC_ID_NONE, \ .codec_id = CODEC_ID_NONE, \
rdt_parse_sdp_line, \ .parse_sdp_a_line = rdt_parse_sdp_line, \
rdt_new_extradata, \ .open = rdt_new_context, \
rdt_free_extradata, \ .close = rdt_free_context, \
rdt_parse_packet \ .parse_packet = rdt_parse_packet \
}; };
RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", CODEC_TYPE_VIDEO); RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", CODEC_TYPE_VIDEO);
......
...@@ -274,13 +274,13 @@ asfrtp_free_context (PayloadContext *asf) ...@@ -274,13 +274,13 @@ asfrtp_free_context (PayloadContext *asf)
#define RTP_ASF_HANDLER(n, s, t) \ #define RTP_ASF_HANDLER(n, s, t) \
RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
s, \ .enc_name = s, \
t, \ .codec_type = t, \
CODEC_ID_NONE, \ .codec_id = CODEC_ID_NONE, \
asfrtp_parse_sdp_line, \ .parse_sdp_a_line = asfrtp_parse_sdp_line, \
asfrtp_new_context, \ .open = asfrtp_new_context, \
asfrtp_free_context, \ .close = asfrtp_free_context, \
asfrtp_parse_packet, \ .parse_packet = asfrtp_parse_packet, \
}; };
RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", CODEC_TYPE_VIDEO); RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", CODEC_TYPE_VIDEO);
......
...@@ -316,7 +316,7 @@ static int h264_handle_packet(AVFormatContext *ctx, ...@@ -316,7 +316,7 @@ static int h264_handle_packet(AVFormatContext *ctx,
} }
/* ---------------- public code */ /* ---------------- public code */
static PayloadContext *h264_new_extradata(void) static PayloadContext *h264_new_context(void)
{ {
PayloadContext *data = PayloadContext *data =
av_mallocz(sizeof(PayloadContext) + av_mallocz(sizeof(PayloadContext) +
...@@ -329,7 +329,7 @@ static PayloadContext *h264_new_extradata(void) ...@@ -329,7 +329,7 @@ static PayloadContext *h264_new_extradata(void)
return data; return data;
} }
static void h264_free_extradata(PayloadContext *data) static void h264_free_context(PayloadContext *data)
{ {
#ifdef DEBUG #ifdef DEBUG
int ii; int ii;
...@@ -406,11 +406,11 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index, ...@@ -406,11 +406,11 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
This is the structure for expanding on the dynamic rtp protocols (makes everything static. yay!) This is the structure for expanding on the dynamic rtp protocols (makes everything static. yay!)
*/ */
RTPDynamicProtocolHandler ff_h264_dynamic_handler = { RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
"H264", .enc_name = "H264",
CODEC_TYPE_VIDEO, .codec_type = CODEC_TYPE_VIDEO,
CODEC_ID_H264, .codec_id = CODEC_ID_H264,
parse_h264_sdp_line, .parse_sdp_a_line = parse_h264_sdp_line,
h264_new_extradata, .open = h264_new_context,
h264_free_extradata, .close = h264_free_context,
h264_handle_packet .parse_packet = h264_handle_packet
}; };
...@@ -143,12 +143,12 @@ ff_vorbis_parse_fmtp_config(AVCodecContext * codec, ...@@ -143,12 +143,12 @@ ff_vorbis_parse_fmtp_config(AVCodecContext * codec,
return result; return result;
} }
static PayloadContext *vorbis_new_extradata(void) static PayloadContext *vorbis_new_context(void)
{ {
return av_mallocz(sizeof(PayloadContext)); return av_mallocz(sizeof(PayloadContext));
} }
static void vorbis_free_extradata(PayloadContext * data) static void vorbis_free_context(PayloadContext * data)
{ {
av_free(data); av_free(data);
} }
...@@ -208,11 +208,11 @@ vorbis_handle_packet(AVFormatContext * ctx, ...@@ -208,11 +208,11 @@ vorbis_handle_packet(AVFormatContext * ctx,
} }
RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = { RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
"vorbis", .enc_name = "vorbis",
CODEC_TYPE_AUDIO, .codec_type = CODEC_TYPE_AUDIO,
CODEC_ID_VORBIS, .codec_id = CODEC_ID_VORBIS,
NULL, .parse_sdp_a_line = NULL,
vorbis_new_extradata, .open = vorbis_new_context,
vorbis_free_extradata, .close = vorbis_free_context,
vorbis_handle_packet .parse_packet = vorbis_handle_packet
}; };
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