[FFmpeg-cvslog] r19518 - in trunk/libavformat: rdt.c rtp_asf.c rtp_h264.c rtp_vorbis.c

rbultje subversion
Mon Jul 27 16:29:06 CEST 2009


Author: rbultje
Date: Mon Jul 27 16:29:06 2009
New Revision: 19518

Log:
Use named initializers and use new/free_context() instead of extradata()
for context allocators. Patch by Colin McQuillan m niloc googlemail com.

Modified:
   trunk/libavformat/rdt.c
   trunk/libavformat/rtp_asf.c
   trunk/libavformat/rtp_h264.c
   trunk/libavformat/rtp_vorbis.c

Modified: trunk/libavformat/rdt.c
==============================================================================
--- trunk/libavformat/rdt.c	Mon Jul 27 16:03:53 2009	(r19517)
+++ trunk/libavformat/rdt.c	Mon Jul 27 16:29:06 2009	(r19518)
@@ -511,7 +511,7 @@ ff_real_parse_sdp_a_line (AVFormatContex
 }
 
 static PayloadContext *
-rdt_new_extradata (void)
+rdt_new_context (void)
 {
     PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
 
@@ -521,7 +521,7 @@ rdt_new_extradata (void)
 }
 
 static void
-rdt_free_extradata (PayloadContext *rdt)
+rdt_free_context (PayloadContext *rdt)
 {
     int i;
 
@@ -538,13 +538,13 @@ rdt_free_extradata (PayloadContext *rdt)
 
 #define RDT_HANDLER(n, s, t) \
 static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
-    s, \
-    t, \
-    CODEC_ID_NONE, \
-    rdt_parse_sdp_line, \
-    rdt_new_extradata, \
-    rdt_free_extradata, \
-    rdt_parse_packet \
+    .enc_name         = s, \
+    .codec_type       = t, \
+    .codec_id         = CODEC_ID_NONE, \
+    .parse_sdp_a_line = rdt_parse_sdp_line, \
+    .open             = rdt_new_context, \
+    .close            = rdt_free_context, \
+    .parse_packet     = rdt_parse_packet \
 };
 
 RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", CODEC_TYPE_VIDEO);

Modified: trunk/libavformat/rtp_asf.c
==============================================================================
--- trunk/libavformat/rtp_asf.c	Mon Jul 27 16:03:53 2009	(r19517)
+++ trunk/libavformat/rtp_asf.c	Mon Jul 27 16:29:06 2009	(r19518)
@@ -274,13 +274,13 @@ asfrtp_free_context (PayloadContext *asf
 
 #define RTP_ASF_HANDLER(n, s, t) \
 RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
-    s, \
-    t, \
-    CODEC_ID_NONE, \
-    asfrtp_parse_sdp_line, \
-    asfrtp_new_context, \
-    asfrtp_free_context, \
-    asfrtp_parse_packet,   \
+    .enc_name         = s, \
+    .codec_type       = t, \
+    .codec_id         = CODEC_ID_NONE, \
+    .parse_sdp_a_line = asfrtp_parse_sdp_line, \
+    .open             = asfrtp_new_context, \
+    .close            = asfrtp_free_context, \
+    .parse_packet     = asfrtp_parse_packet,   \
 };
 
 RTP_ASF_HANDLER(asf_pfv, "x-asf-pf",  CODEC_TYPE_VIDEO);

Modified: trunk/libavformat/rtp_h264.c
==============================================================================
--- trunk/libavformat/rtp_h264.c	Mon Jul 27 16:03:53 2009	(r19517)
+++ trunk/libavformat/rtp_h264.c	Mon Jul 27 16:29:06 2009	(r19518)
@@ -316,7 +316,7 @@ static int h264_handle_packet(AVFormatCo
 }
 
 /* ---------------- public code */
-static PayloadContext *h264_new_extradata(void)
+static PayloadContext *h264_new_context(void)
 {
     PayloadContext *data =
         av_mallocz(sizeof(PayloadContext) +
@@ -329,7 +329,7 @@ static PayloadContext *h264_new_extradat
     return data;
 }
 
-static void h264_free_extradata(PayloadContext *data)
+static void h264_free_context(PayloadContext *data)
 {
 #ifdef DEBUG
     int ii;
@@ -406,11 +406,11 @@ static int parse_h264_sdp_line(AVFormatC
 This is the structure for expanding on the dynamic rtp protocols (makes everything static. yay!)
 */
 RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
-    "H264",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_H264,
-    parse_h264_sdp_line,
-    h264_new_extradata,
-    h264_free_extradata,
-    h264_handle_packet
+    .enc_name         = "H264",
+    .codec_type       = CODEC_TYPE_VIDEO,
+    .codec_id         = CODEC_ID_H264,
+    .parse_sdp_a_line = parse_h264_sdp_line,
+    .open             = h264_new_context,
+    .close            = h264_free_context,
+    .parse_packet     = h264_handle_packet
 };

Modified: trunk/libavformat/rtp_vorbis.c
==============================================================================
--- trunk/libavformat/rtp_vorbis.c	Mon Jul 27 16:03:53 2009	(r19517)
+++ trunk/libavformat/rtp_vorbis.c	Mon Jul 27 16:29:06 2009	(r19518)
@@ -143,12 +143,12 @@ ff_vorbis_parse_fmtp_config(AVCodecConte
     return result;
 }
 
-static PayloadContext *vorbis_new_extradata(void)
+static PayloadContext *vorbis_new_context(void)
 {
     return av_mallocz(sizeof(PayloadContext));
 }
 
-static void vorbis_free_extradata(PayloadContext * data)
+static void vorbis_free_context(PayloadContext * data)
 {
     av_free(data);
 }
@@ -208,11 +208,11 @@ vorbis_handle_packet(AVFormatContext * c
 }
 
 RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
-    "vorbis",
-    CODEC_TYPE_AUDIO,
-    CODEC_ID_VORBIS,
-    NULL,
-    vorbis_new_extradata,
-    vorbis_free_extradata,
-    vorbis_handle_packet
+    .enc_name         = "vorbis",
+    .codec_type       = CODEC_TYPE_AUDIO,
+    .codec_id         = CODEC_ID_VORBIS,
+    .parse_sdp_a_line = NULL,
+    .open             = vorbis_new_context,
+    .close            = vorbis_free_context,
+    .parse_packet     = vorbis_handle_packet
 };



More information about the ffmpeg-cvslog mailing list