Skip to content

Commit

Permalink
rtp: Rename the open/close functions to alloc/free
Browse files Browse the repository at this point in the history
This avoids clashes if we internally want to override the global
open function.

Signed-off-by: Martin Storsjö <[email protected]>
  • Loading branch information
mstorsjo committed Apr 23, 2011
1 parent 89b503b commit 9261e6c
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions libavformat/rdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
}

Expand Down
4 changes: 2 additions & 2 deletions libavformat/rtpdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions libavformat/rtpdec_amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

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

4 changes: 2 additions & 2 deletions libavformat/rtpdec_asf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
}

Expand Down
4 changes: 2 additions & 2 deletions libavformat/rtpdec_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
4 changes: 2 additions & 2 deletions libavformat/rtpdec_latm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
8 changes: 4 additions & 4 deletions libavformat/rtpdec_mpeg4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand All @@ -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
};
4 changes: 2 additions & 2 deletions libavformat/rtpdec_qcelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
4 changes: 2 additions & 2 deletions libavformat/rtpdec_qdm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
4 changes: 2 additions & 2 deletions libavformat/rtpdec_qt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
}

Expand Down
4 changes: 2 additions & 2 deletions libavformat/rtpdec_svq3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
4 changes: 2 additions & 2 deletions libavformat/rtpdec_vp8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
8 changes: 4 additions & 4 deletions libavformat/rtpdec_xiph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand All @@ -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
};
6 changes: 3 additions & 3 deletions libavformat/rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>] */
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9261e6c

Please sign in to comment.