Browse code

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@martin.st>

Martin Storsjö authored on 2011/04/20 21:36:37
Showing 14 changed files
... ...
@@ -551,8 +551,8 @@ static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
551 551
     .codec_type       = t, \
552 552
     .codec_id         = CODEC_ID_NONE, \
553 553
     .parse_sdp_a_line = rdt_parse_sdp_line, \
554
-    .open             = rdt_new_context, \
555
-    .close            = rdt_free_context, \
554
+    .alloc            = rdt_new_context, \
555
+    .free             = rdt_free_context, \
556 556
     .parse_packet     = rdt_parse_packet \
557 557
 }
558 558
 
... ...
@@ -126,8 +126,8 @@ struct RTPDynamicProtocolHandler_s {
126 126
                              int st_index,
127 127
                              PayloadContext *priv_data,
128 128
                              const char *line); ///< Parse the a= line from the sdp field
129
-    PayloadContext *(*open) (void); ///< allocate any data needed by the rtp parsing for this dynamic data.
130
-    void (*close)(PayloadContext *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
129
+    PayloadContext *(*alloc) (void); ///< allocate any data needed by the rtp parsing for this dynamic data.
130
+    void (*free)(PayloadContext *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
131 131
     DynamicPayloadPacketHandlerProc parse_packet; ///< parse handler for this dynamic packet.
132 132
 
133 133
     struct RTPDynamicProtocolHandler_s *next;
... ...
@@ -191,8 +191,8 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = {
191 191
     .codec_type       = AVMEDIA_TYPE_AUDIO,
192 192
     .codec_id         = CODEC_ID_AMR_NB,
193 193
     .parse_sdp_a_line = amr_parse_sdp_line,
194
-    .open             = amr_new_context,
195
-    .close            = amr_free_context,
194
+    .alloc            = amr_new_context,
195
+    .free             = amr_free_context,
196 196
     .parse_packet     = amr_handle_packet,
197 197
 };
198 198
 
... ...
@@ -201,8 +201,8 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
201 201
     .codec_type       = AVMEDIA_TYPE_AUDIO,
202 202
     .codec_id         = CODEC_ID_AMR_WB,
203 203
     .parse_sdp_a_line = amr_parse_sdp_line,
204
-    .open             = amr_new_context,
205
-    .close            = amr_free_context,
204
+    .alloc            = amr_new_context,
205
+    .free             = amr_free_context,
206 206
     .parse_packet     = amr_handle_packet,
207 207
 };
208 208
 
... ...
@@ -286,8 +286,8 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
286 286
     .codec_type       = t, \
287 287
     .codec_id         = CODEC_ID_NONE, \
288 288
     .parse_sdp_a_line = asfrtp_parse_sdp_line, \
289
-    .open             = asfrtp_new_context, \
290
-    .close            = asfrtp_free_context, \
289
+    .alloc            = asfrtp_new_context, \
290
+    .free             = asfrtp_free_context, \
291 291
     .parse_packet     = asfrtp_parse_packet,   \
292 292
 }
293 293
 
... ...
@@ -398,7 +398,7 @@ RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
398 398
     .codec_type       = AVMEDIA_TYPE_VIDEO,
399 399
     .codec_id         = CODEC_ID_H264,
400 400
     .parse_sdp_a_line = parse_h264_sdp_line,
401
-    .open             = h264_new_context,
402
-    .close            = h264_free_context,
401
+    .alloc            = h264_new_context,
402
+    .free             = h264_free_context,
403 403
     .parse_packet     = h264_handle_packet
404 404
 };
... ...
@@ -181,7 +181,7 @@ RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = {
181 181
     .codec_type         = AVMEDIA_TYPE_AUDIO,
182 182
     .codec_id           = CODEC_ID_AAC,
183 183
     .parse_sdp_a_line   = latm_parse_sdp_line,
184
-    .open               = latm_new_context,
185
-    .close              = latm_free_context,
184
+    .alloc              = latm_new_context,
185
+    .free               = latm_free_context,
186 186
     .parse_packet       = latm_parse_packet
187 187
 };
... ...
@@ -235,8 +235,8 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = {
235 235
     .codec_type         = AVMEDIA_TYPE_VIDEO,
236 236
     .codec_id           = CODEC_ID_MPEG4,
237 237
     .parse_sdp_a_line   = parse_sdp_line,
238
-    .open               = NULL,
239
-    .close              = NULL,
238
+    .alloc              = NULL,
239
+    .free               = NULL,
240 240
     .parse_packet       = NULL
241 241
 };
242 242
 
... ...
@@ -245,7 +245,7 @@ RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = {
245 245
     .codec_type         = AVMEDIA_TYPE_AUDIO,
246 246
     .codec_id           = CODEC_ID_AAC,
247 247
     .parse_sdp_a_line   = parse_sdp_line,
248
-    .open               = new_context,
249
-    .close              = free_context,
248
+    .alloc              = new_context,
249
+    .free               = free_context,
250 250
     .parse_packet       = aac_parse_packet
251 251
 };
... ...
@@ -223,7 +223,7 @@ RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = {
223 223
     .codec_type         = AVMEDIA_TYPE_AUDIO,
224 224
     .codec_id           = CODEC_ID_QCELP,
225 225
     .static_payload_id  = 12,
226
-    .open               = qcelp_new_context,
227
-    .close              = qcelp_free_context,
226
+    .alloc              = qcelp_new_context,
227
+    .free               = qcelp_free_context,
228 228
     .parse_packet       = qcelp_parse_packet
229 229
 };
... ...
@@ -309,7 +309,7 @@ RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = {
309 309
     .enc_name         = "X-QDM",
310 310
     .codec_type       = AVMEDIA_TYPE_AUDIO,
311 311
     .codec_id         = CODEC_ID_NONE,
312
-    .open             = qdm2_extradata_new,
313
-    .close            = qdm2_extradata_free,
312
+    .alloc            = qdm2_extradata_new,
313
+    .free             = qdm2_extradata_free,
314 314
     .parse_packet     = qdm2_parse_packet,
315 315
 };
... ...
@@ -244,8 +244,8 @@ RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
244 244
     .enc_name         = s, \
245 245
     .codec_type       = t, \
246 246
     .codec_id         = CODEC_ID_NONE, \
247
-    .open             = qt_rtp_new,    \
248
-    .close            = qt_rtp_free,   \
247
+    .alloc            = qt_rtp_new,    \
248
+    .free             = qt_rtp_free,   \
249 249
     .parse_packet     = qt_rtp_parse_packet, \
250 250
 }
251 251
 
... ...
@@ -128,7 +128,7 @@ RTPDynamicProtocolHandler ff_svq3_dynamic_handler = {
128 128
     .enc_name         = "X-SV3V-ES",
129 129
     .codec_type       = AVMEDIA_TYPE_VIDEO,
130 130
     .codec_id         = CODEC_ID_NONE,      // see if (config_packet) above
131
-    .open             = svq3_extradata_new,
132
-    .close            = svq3_extradata_free,
131
+    .alloc            = svq3_extradata_new,
132
+    .free             = svq3_extradata_free,
133 133
     .parse_packet     = svq3_parse_packet,
134 134
 };
... ...
@@ -148,7 +148,7 @@ RTPDynamicProtocolHandler ff_vp8_dynamic_handler = {
148 148
     .enc_name       = "VP8",
149 149
     .codec_type     = AVMEDIA_TYPE_VIDEO,
150 150
     .codec_id       = CODEC_ID_VP8,
151
-    .open           = vp8_new_context,
152
-    .close          = vp8_free_context,
151
+    .alloc          = vp8_new_context,
152
+    .free           = vp8_free_context,
153 153
     .parse_packet   = vp8_handle_packet,
154 154
 };
... ...
@@ -389,8 +389,8 @@ RTPDynamicProtocolHandler ff_theora_dynamic_handler = {
389 389
     .codec_type       = AVMEDIA_TYPE_VIDEO,
390 390
     .codec_id         = CODEC_ID_THEORA,
391 391
     .parse_sdp_a_line = xiph_parse_sdp_line,
392
-    .open             = xiph_new_context,
393
-    .close            = xiph_free_context,
392
+    .alloc            = xiph_new_context,
393
+    .free             = xiph_free_context,
394 394
     .parse_packet     = xiph_handle_packet
395 395
 };
396 396
 
... ...
@@ -399,7 +399,7 @@ RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
399 399
     .codec_type       = AVMEDIA_TYPE_AUDIO,
400 400
     .codec_id         = CODEC_ID_VORBIS,
401 401
     .parse_sdp_a_line = xiph_parse_sdp_line,
402
-    .open             = xiph_new_context,
403
-    .close            = xiph_free_context,
402
+    .alloc            = xiph_new_context,
403
+    .free             = xiph_free_context,
404 404
     .parse_packet     = xiph_handle_packet
405 405
 };
... ...
@@ -132,8 +132,8 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
132 132
         return;
133 133
     codec->codec_id          = handler->codec_id;
134 134
     rtsp_st->dynamic_handler = handler;
135
-    if (handler->open)
136
-        rtsp_st->dynamic_protocol_context = handler->open();
135
+    if (handler->alloc)
136
+        rtsp_st->dynamic_protocol_context = handler->alloc();
137 137
 }
138 138
 
139 139
 /* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
... ...
@@ -526,7 +526,7 @@ void ff_rtsp_close_streams(AVFormatContext *s)
526 526
         rtsp_st = rt->rtsp_streams[i];
527 527
         if (rtsp_st) {
528 528
             if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
529
-                rtsp_st->dynamic_handler->close(
529
+                rtsp_st->dynamic_handler->free(
530 530
                     rtsp_st->dynamic_protocol_context);
531 531
             av_free(rtsp_st);
532 532
         }