1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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>
This commit is contained in:
Martin Storsjö 2011-04-20 15:36:37 +03:00
parent 89b503b55f
commit 9261e6cf3f
14 changed files with 35 additions and 35 deletions

View File

@ -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 \
}

View File

@ -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;

View File

@ -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,
};

View File

@ -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, \
}

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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,
};

View File

@ -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, \
}

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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
};

View File

@ -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);
}