[FFmpeg-cvslog] rtp: Rename the open/close functions to alloc/free

Martin Storsjö git at videolan.org
Sun Apr 24 03:50:10 CEST 2011


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Apr 20 15:36:37 2011 +0300| [9261e6cf3fe579fa02a96761c8e81a77bb3d8b2e] | committer: Martin Storsjö

rtp: Rename the open/close functions to alloc/free

This avoids clashes if we internally want to override the global
open function.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9261e6cf3fe579fa02a96761c8e81a77bb3d8b2e
---

 libavformat/rdt.c          |    4 ++--
 libavformat/rtpdec.h       |    4 ++--
 libavformat/rtpdec_amr.c   |    8 ++++----
 libavformat/rtpdec_asf.c   |    4 ++--
 libavformat/rtpdec_h264.c  |    4 ++--
 libavformat/rtpdec_latm.c  |    4 ++--
 libavformat/rtpdec_mpeg4.c |    8 ++++----
 libavformat/rtpdec_qcelp.c |    4 ++--
 libavformat/rtpdec_qdm2.c  |    4 ++--
 libavformat/rtpdec_qt.c    |    4 ++--
 libavformat/rtpdec_svq3.c  |    4 ++--
 libavformat/rtpdec_vp8.c   |    4 ++--
 libavformat/rtpdec_xiph.c  |    8 ++++----
 libavformat/rtsp.c         |    6 +++---
 14 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index dfb31d1..bc3c17b 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -551,8 +551,8 @@ static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
     .codec_type       = t, \
     .codec_id         = CODEC_ID_NONE, \
     .parse_sdp_a_line = rdt_parse_sdp_line, \
-    .open             = rdt_new_context, \
-    .close            = rdt_free_context, \
+    .alloc            = rdt_new_context, \
+    .free             = rdt_free_context, \
     .parse_packet     = rdt_parse_packet \
 }
 
diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
index da53efc..a4d21aa 100644
--- a/libavformat/rtpdec.h
+++ b/libavformat/rtpdec.h
@@ -126,8 +126,8 @@ struct RTPDynamicProtocolHandler_s {
                              int st_index,
                              PayloadContext *priv_data,
                              const char *line); ///< Parse the a= line from the sdp field
-    PayloadContext *(*open) (void); ///< allocate any data needed by the rtp parsing for this dynamic data.
-    void (*close)(PayloadContext *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
+    PayloadContext *(*alloc) (void); ///< allocate any data needed by the rtp parsing for this dynamic data.
+    void (*free)(PayloadContext *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
     DynamicPayloadPacketHandlerProc parse_packet; ///< parse handler for this dynamic packet.
 
     struct RTPDynamicProtocolHandler_s *next;
diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c
index 802e7c1..b7ff3aa 100644
--- a/libavformat/rtpdec_amr.c
+++ b/libavformat/rtpdec_amr.c
@@ -191,8 +191,8 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_AUDIO,
     .codec_id         = CODEC_ID_AMR_NB,
     .parse_sdp_a_line = amr_parse_sdp_line,
-    .open             = amr_new_context,
-    .close            = amr_free_context,
+    .alloc            = amr_new_context,
+    .free             = amr_free_context,
     .parse_packet     = amr_handle_packet,
 };
 
@@ -201,8 +201,8 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_AUDIO,
     .codec_id         = CODEC_ID_AMR_WB,
     .parse_sdp_a_line = amr_parse_sdp_line,
-    .open             = amr_new_context,
-    .close            = amr_free_context,
+    .alloc            = amr_new_context,
+    .free             = amr_free_context,
     .parse_packet     = amr_handle_packet,
 };
 
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index a8326cf..ecacc0e 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -286,8 +286,8 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
     .codec_type       = t, \
     .codec_id         = CODEC_ID_NONE, \
     .parse_sdp_a_line = asfrtp_parse_sdp_line, \
-    .open             = asfrtp_new_context, \
-    .close            = asfrtp_free_context, \
+    .alloc            = asfrtp_new_context, \
+    .free             = asfrtp_free_context, \
     .parse_packet     = asfrtp_parse_packet,   \
 }
 
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 4c9b8ba..effdc1f 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -398,7 +398,7 @@ RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_VIDEO,
     .codec_id         = CODEC_ID_H264,
     .parse_sdp_a_line = parse_h264_sdp_line,
-    .open             = h264_new_context,
-    .close            = h264_free_context,
+    .alloc            = h264_new_context,
+    .free             = h264_free_context,
     .parse_packet     = h264_handle_packet
 };
diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c
index 5bf4c19..bde34b7 100644
--- a/libavformat/rtpdec_latm.c
+++ b/libavformat/rtpdec_latm.c
@@ -181,7 +181,7 @@ RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = {
     .codec_type         = AVMEDIA_TYPE_AUDIO,
     .codec_id           = CODEC_ID_AAC,
     .parse_sdp_a_line   = latm_parse_sdp_line,
-    .open               = latm_new_context,
-    .close              = latm_free_context,
+    .alloc              = latm_new_context,
+    .free               = latm_free_context,
     .parse_packet       = latm_parse_packet
 };
diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
index 9f2fcb3..7a63cc3 100644
--- a/libavformat/rtpdec_mpeg4.c
+++ b/libavformat/rtpdec_mpeg4.c
@@ -235,8 +235,8 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = {
     .codec_type         = AVMEDIA_TYPE_VIDEO,
     .codec_id           = CODEC_ID_MPEG4,
     .parse_sdp_a_line   = parse_sdp_line,
-    .open               = NULL,
-    .close              = NULL,
+    .alloc              = NULL,
+    .free               = NULL,
     .parse_packet       = NULL
 };
 
@@ -245,7 +245,7 @@ RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = {
     .codec_type         = AVMEDIA_TYPE_AUDIO,
     .codec_id           = CODEC_ID_AAC,
     .parse_sdp_a_line   = parse_sdp_line,
-    .open               = new_context,
-    .close              = free_context,
+    .alloc              = new_context,
+    .free               = free_context,
     .parse_packet       = aac_parse_packet
 };
diff --git a/libavformat/rtpdec_qcelp.c b/libavformat/rtpdec_qcelp.c
index cc16ec1..325683c 100644
--- a/libavformat/rtpdec_qcelp.c
+++ b/libavformat/rtpdec_qcelp.c
@@ -223,7 +223,7 @@ RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = {
     .codec_type         = AVMEDIA_TYPE_AUDIO,
     .codec_id           = CODEC_ID_QCELP,
     .static_payload_id  = 12,
-    .open               = qcelp_new_context,
-    .close              = qcelp_free_context,
+    .alloc              = qcelp_new_context,
+    .free               = qcelp_free_context,
     .parse_packet       = qcelp_parse_packet
 };
diff --git a/libavformat/rtpdec_qdm2.c b/libavformat/rtpdec_qdm2.c
index 0d744be..7f5f077 100644
--- a/libavformat/rtpdec_qdm2.c
+++ b/libavformat/rtpdec_qdm2.c
@@ -309,7 +309,7 @@ RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = {
     .enc_name         = "X-QDM",
     .codec_type       = AVMEDIA_TYPE_AUDIO,
     .codec_id         = CODEC_ID_NONE,
-    .open             = qdm2_extradata_new,
-    .close            = qdm2_extradata_free,
+    .alloc            = qdm2_extradata_new,
+    .free             = qdm2_extradata_free,
     .parse_packet     = qdm2_parse_packet,
 };
diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c
index a295ba7..8dd2968 100644
--- a/libavformat/rtpdec_qt.c
+++ b/libavformat/rtpdec_qt.c
@@ -244,8 +244,8 @@ RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
     .enc_name         = s, \
     .codec_type       = t, \
     .codec_id         = CODEC_ID_NONE, \
-    .open             = qt_rtp_new,    \
-    .close            = qt_rtp_free,   \
+    .alloc            = qt_rtp_new,    \
+    .free             = qt_rtp_free,   \
     .parse_packet     = qt_rtp_parse_packet, \
 }
 
diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c
index 8c09262..3314342 100644
--- a/libavformat/rtpdec_svq3.c
+++ b/libavformat/rtpdec_svq3.c
@@ -128,7 +128,7 @@ RTPDynamicProtocolHandler ff_svq3_dynamic_handler = {
     .enc_name         = "X-SV3V-ES",
     .codec_type       = AVMEDIA_TYPE_VIDEO,
     .codec_id         = CODEC_ID_NONE,      // see if (config_packet) above
-    .open             = svq3_extradata_new,
-    .close            = svq3_extradata_free,
+    .alloc            = svq3_extradata_new,
+    .free             = svq3_extradata_free,
     .parse_packet     = svq3_parse_packet,
 };
diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c
index 9e50cc4..026728e 100644
--- a/libavformat/rtpdec_vp8.c
+++ b/libavformat/rtpdec_vp8.c
@@ -148,7 +148,7 @@ RTPDynamicProtocolHandler ff_vp8_dynamic_handler = {
     .enc_name       = "VP8",
     .codec_type     = AVMEDIA_TYPE_VIDEO,
     .codec_id       = CODEC_ID_VP8,
-    .open           = vp8_new_context,
-    .close          = vp8_free_context,
+    .alloc          = vp8_new_context,
+    .free           = vp8_free_context,
     .parse_packet   = vp8_handle_packet,
 };
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index 4d8e834..a7f36ef 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -389,8 +389,8 @@ RTPDynamicProtocolHandler ff_theora_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_VIDEO,
     .codec_id         = CODEC_ID_THEORA,
     .parse_sdp_a_line = xiph_parse_sdp_line,
-    .open             = xiph_new_context,
-    .close            = xiph_free_context,
+    .alloc            = xiph_new_context,
+    .free             = xiph_free_context,
     .parse_packet     = xiph_handle_packet
 };
 
@@ -399,7 +399,7 @@ RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
     .codec_type       = AVMEDIA_TYPE_AUDIO,
     .codec_id         = CODEC_ID_VORBIS,
     .parse_sdp_a_line = xiph_parse_sdp_line,
-    .open             = xiph_new_context,
-    .close            = xiph_free_context,
+    .alloc            = xiph_new_context,
+    .free             = xiph_free_context,
     .parse_packet     = xiph_handle_packet
 };
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 58f7ddc..14111e6 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -132,8 +132,8 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
         return;
     codec->codec_id          = handler->codec_id;
     rtsp_st->dynamic_handler = handler;
-    if (handler->open)
-        rtsp_st->dynamic_protocol_context = handler->open();
+    if (handler->alloc)
+        rtsp_st->dynamic_protocol_context = handler->alloc();
 }
 
 /* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
@@ -526,7 +526,7 @@ void ff_rtsp_close_streams(AVFormatContext *s)
         rtsp_st = rt->rtsp_streams[i];
         if (rtsp_st) {
             if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
-                rtsp_st->dynamic_handler->close(
+                rtsp_st->dynamic_handler->free(
                     rtsp_st->dynamic_protocol_context);
             av_free(rtsp_st);
         }



More information about the ffmpeg-cvslog mailing list