Commit 5d8cae45 authored by Martin Storsjö's avatar Martin Storsjö

rtpdec: Get rid of all trivial .alloc/.free functions

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent e72605f8
...@@ -31,11 +31,6 @@ struct PayloadContext { ...@@ -31,11 +31,6 @@ struct PayloadContext {
AVIOContext *fragment; AVIOContext *fragment;
}; };
static PayloadContext *ac3_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void free_fragment(PayloadContext *data) static void free_fragment(PayloadContext *data)
{ {
if (data->fragment) { if (data->fragment) {
...@@ -142,7 +137,7 @@ RTPDynamicProtocolHandler ff_ac3_dynamic_handler = { ...@@ -142,7 +137,7 @@ RTPDynamicProtocolHandler ff_ac3_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_AC3, .codec_id = AV_CODEC_ID_AC3,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.alloc = ac3_new_context, .priv_data_size = sizeof(PayloadContext),
.free = ac3_free_context, .free = ac3_free_context,
.parse_packet = ac3_handle_packet, .parse_packet = ac3_handle_packet,
}; };
...@@ -47,11 +47,6 @@ static PayloadContext *amr_new_context(void) ...@@ -47,11 +47,6 @@ static PayloadContext *amr_new_context(void)
return data; return data;
} }
static void amr_free_context(PayloadContext *data)
{
av_free(data);
}
static int amr_handle_packet(AVFormatContext *ctx, PayloadContext *data, static int amr_handle_packet(AVFormatContext *ctx, PayloadContext *data,
AVStream *st, AVPacket *pkt, uint32_t *timestamp, AVStream *st, AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len, uint16_t seq, const uint8_t *buf, int len, uint16_t seq,
...@@ -196,7 +191,6 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { ...@@ -196,7 +191,6 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = {
.codec_id = AV_CODEC_ID_AMR_NB, .codec_id = AV_CODEC_ID_AMR_NB,
.parse_sdp_a_line = amr_parse_sdp_line, .parse_sdp_a_line = amr_parse_sdp_line,
.alloc = amr_new_context, .alloc = amr_new_context,
.free = amr_free_context,
.parse_packet = amr_handle_packet, .parse_packet = amr_handle_packet,
}; };
...@@ -206,6 +200,5 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = { ...@@ -206,6 +200,5 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
.codec_id = AV_CODEC_ID_AMR_WB, .codec_id = AV_CODEC_ID_AMR_WB,
.parse_sdp_a_line = amr_parse_sdp_line, .parse_sdp_a_line = amr_parse_sdp_line,
.alloc = amr_new_context, .alloc = amr_new_context,
.free = amr_free_context,
.parse_packet = amr_handle_packet, .parse_packet = amr_handle_packet,
}; };
...@@ -277,11 +277,6 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, ...@@ -277,11 +277,6 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
return res == 1 ? -1 : res; return res == 1 ? -1 : res;
} }
static PayloadContext *asfrtp_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void asfrtp_free_context(PayloadContext *asf) static void asfrtp_free_context(PayloadContext *asf)
{ {
if (asf->pktbuf) { if (asf->pktbuf) {
...@@ -299,8 +294,8 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ ...@@ -299,8 +294,8 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
.enc_name = s, \ .enc_name = s, \
.codec_type = t, \ .codec_type = t, \
.codec_id = AV_CODEC_ID_NONE, \ .codec_id = AV_CODEC_ID_NONE, \
.priv_data_size = sizeof(PayloadContext), \
.parse_sdp_a_line = asfrtp_parse_sdp_line, \ .parse_sdp_a_line = asfrtp_parse_sdp_line, \
.alloc = asfrtp_new_context, \
.free = asfrtp_free_context, \ .free = asfrtp_free_context, \
.parse_packet = asfrtp_parse_packet, \ .parse_packet = asfrtp_parse_packet, \
} }
......
...@@ -31,11 +31,6 @@ struct PayloadContext { ...@@ -31,11 +31,6 @@ struct PayloadContext {
int bundled_audio; int bundled_audio;
}; };
static av_cold PayloadContext *dv_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void dv_free_dyn_buffer(AVIOContext **dyn_buf) static void dv_free_dyn_buffer(AVIOContext **dyn_buf)
{ {
uint8_t *ptr_dyn_buffer; uint8_t *ptr_dyn_buffer;
...@@ -150,7 +145,7 @@ RTPDynamicProtocolHandler ff_dv_dynamic_handler = { ...@@ -150,7 +145,7 @@ RTPDynamicProtocolHandler ff_dv_dynamic_handler = {
.codec_id = AV_CODEC_ID_DVVIDEO, .codec_id = AV_CODEC_ID_DVVIDEO,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.parse_sdp_a_line = dv_parse_sdp_line, .parse_sdp_a_line = dv_parse_sdp_line,
.alloc = dv_new_context, .priv_data_size = sizeof(PayloadContext),
.free = dv_free_context, .free = dv_free_context,
.parse_packet = dv_handle_packet, .parse_packet = dv_handle_packet,
}; };
...@@ -32,11 +32,6 @@ struct PayloadContext { ...@@ -32,11 +32,6 @@ struct PayloadContext {
uint32_t timestamp; uint32_t timestamp;
}; };
static av_cold PayloadContext *h261_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void h261_free_dyn_buffer(AVIOContext **dyn_buf) static void h261_free_dyn_buffer(AVIOContext **dyn_buf)
{ {
uint8_t *ptr_dyn_buffer; uint8_t *ptr_dyn_buffer;
...@@ -184,7 +179,7 @@ RTPDynamicProtocolHandler ff_h261_dynamic_handler = { ...@@ -184,7 +179,7 @@ RTPDynamicProtocolHandler ff_h261_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_H261, .codec_id = AV_CODEC_ID_H261,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.alloc = h261_new_context, .priv_data_size = sizeof(PayloadContext),
.free = h261_free_context, .free = h261_free_context,
.parse_packet = h261_handle_packet, .parse_packet = h261_handle_packet,
.static_payload_id = 31, .static_payload_id = 31,
......
...@@ -39,11 +39,6 @@ struct PayloadContext { ...@@ -39,11 +39,6 @@ struct PayloadContext {
int newformat; int newformat;
}; };
static PayloadContext *h263_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void h263_free_context(PayloadContext *data) static void h263_free_context(PayloadContext *data)
{ {
if (!data) if (!data)
...@@ -202,7 +197,7 @@ RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler = { ...@@ -202,7 +197,7 @@ RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler = {
.codec_id = AV_CODEC_ID_H263, .codec_id = AV_CODEC_ID_H263,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.parse_packet = h263_handle_packet, .parse_packet = h263_handle_packet,
.alloc = h263_new_context, .priv_data_size = sizeof(PayloadContext),
.free = h263_free_context, .free = h263_free_context,
.static_payload_id = 34, .static_payload_id = 34,
}; };
...@@ -342,11 +342,6 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data, ...@@ -342,11 +342,6 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
return result; return result;
} }
static PayloadContext *h264_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void h264_free_context(PayloadContext *data) static void h264_free_context(PayloadContext *data)
{ {
#ifdef DEBUG #ifdef DEBUG
...@@ -408,8 +403,8 @@ RTPDynamicProtocolHandler ff_h264_dynamic_handler = { ...@@ -408,8 +403,8 @@ RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_H264, .codec_id = AV_CODEC_ID_H264,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_h264_sdp_line, .parse_sdp_a_line = parse_h264_sdp_line,
.alloc = h264_new_context,
.free = h264_free_context, .free = h264_free_context,
.parse_packet = h264_handle_packet, .parse_packet = h264_handle_packet,
}; };
...@@ -43,16 +43,6 @@ struct PayloadContext { ...@@ -43,16 +43,6 @@ struct PayloadContext {
static const uint8_t start_sequence[] = { 0x00, 0x00, 0x00, 0x01 }; static const uint8_t start_sequence[] = { 0x00, 0x00, 0x00, 0x01 };
static av_cold PayloadContext *hevc_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static av_cold void hevc_free_context(PayloadContext *data)
{
av_free(data);
}
static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
AVStream *stream, AVStream *stream,
PayloadContext *hevc_data, PayloadContext *hevc_data,
...@@ -405,8 +395,7 @@ RTPDynamicProtocolHandler ff_hevc_dynamic_handler = { ...@@ -405,8 +395,7 @@ RTPDynamicProtocolHandler ff_hevc_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_HEVC, .codec_id = AV_CODEC_ID_HEVC,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = hevc_parse_sdp_line, .parse_sdp_a_line = hevc_parse_sdp_line,
.alloc = hevc_new_context,
.free = hevc_free_context,
.parse_packet = hevc_handle_packet, .parse_packet = hevc_handle_packet,
}; };
...@@ -59,11 +59,6 @@ static const uint8_t default_quantizers[128] = { ...@@ -59,11 +59,6 @@ static const uint8_t default_quantizers[128] = {
99, 99, 99, 99, 99, 99, 99, 99 99, 99, 99, 99, 99, 99, 99, 99
}; };
static PayloadContext *jpeg_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static inline void free_frame(PayloadContext *jpeg) static inline void free_frame(PayloadContext *jpeg)
{ {
if (jpeg->frame) { if (jpeg->frame) {
...@@ -385,7 +380,7 @@ RTPDynamicProtocolHandler ff_jpeg_dynamic_handler = { ...@@ -385,7 +380,7 @@ RTPDynamicProtocolHandler ff_jpeg_dynamic_handler = {
.enc_name = "JPEG", .enc_name = "JPEG",
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_MJPEG, .codec_id = AV_CODEC_ID_MJPEG,
.alloc = jpeg_new_context, .priv_data_size = sizeof(PayloadContext),
.free = jpeg_free_context, .free = jpeg_free_context,
.parse_packet = jpeg_parse_packet, .parse_packet = jpeg_parse_packet,
.static_payload_id = 26, .static_payload_id = 26,
......
...@@ -31,11 +31,6 @@ struct PayloadContext { ...@@ -31,11 +31,6 @@ struct PayloadContext {
uint32_t timestamp; uint32_t timestamp;
}; };
static PayloadContext *latm_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void latm_free_context(PayloadContext *data) static void latm_free_context(PayloadContext *data)
{ {
if (!data) if (!data)
...@@ -183,8 +178,8 @@ RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = { ...@@ -183,8 +178,8 @@ RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = {
.enc_name = "MP4A-LATM", .enc_name = "MP4A-LATM",
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_AAC, .codec_id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = latm_parse_sdp_line, .parse_sdp_a_line = latm_parse_sdp_line,
.alloc = latm_new_context,
.free = latm_free_context, .free = latm_free_context,
.parse_packet = latm_parse_packet, .parse_packet = latm_parse_packet,
}; };
...@@ -33,11 +33,6 @@ struct PayloadContext { ...@@ -33,11 +33,6 @@ struct PayloadContext {
AVIOContext *fragment; AVIOContext *fragment;
}; };
static PayloadContext *mpa_robust_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static inline void free_fragment(PayloadContext *data) static inline void free_fragment(PayloadContext *data)
{ {
if (data->fragment) { if (data->fragment) {
...@@ -209,7 +204,7 @@ RTPDynamicProtocolHandler ff_mpeg_audio_robust_dynamic_handler = { ...@@ -209,7 +204,7 @@ RTPDynamicProtocolHandler ff_mpeg_audio_robust_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_MP3ADU, .codec_id = AV_CODEC_ID_MP3ADU,
.need_parsing = AVSTREAM_PARSE_HEADERS, .need_parsing = AVSTREAM_PARSE_HEADERS,
.alloc = mpa_robust_new_context, .priv_data_size = sizeof(PayloadContext),
.free = mpa_robust_free_context, .free = mpa_robust_free_context,
.parse_packet = mpa_robust_parse_packet, .parse_packet = mpa_robust_parse_packet,
}; };
...@@ -91,11 +91,6 @@ static const AttrNameMap attr_names[] = { ...@@ -91,11 +91,6 @@ static const AttrNameMap attr_names[] = {
{ NULL, -1, -1 }, { NULL, -1, -1 },
}; };
static PayloadContext *new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void free_context(PayloadContext *data) static void free_context(PayloadContext *data)
{ {
av_free(data->au_headers); av_free(data->au_headers);
...@@ -326,6 +321,7 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = { ...@@ -326,6 +321,7 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_MPEG4, .codec_id = AV_CODEC_ID_MPEG4,
.need_parsing = AVSTREAM_PARSE_FULL, .need_parsing = AVSTREAM_PARSE_FULL,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_sdp_line, .parse_sdp_a_line = parse_sdp_line,
}; };
...@@ -333,8 +329,8 @@ RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = { ...@@ -333,8 +329,8 @@ RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = {
.enc_name = "mpeg4-generic", .enc_name = "mpeg4-generic",
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_AAC, .codec_id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = parse_sdp_line, .parse_sdp_a_line = parse_sdp_line,
.alloc = new_context,
.free = free_context, .free = free_context,
.parse_packet = aac_parse_packet, .parse_packet = aac_parse_packet,
}; };
...@@ -30,11 +30,6 @@ struct PayloadContext { ...@@ -30,11 +30,6 @@ struct PayloadContext {
uint8_t buf[RTP_MAX_PACKET_LENGTH]; uint8_t buf[RTP_MAX_PACKET_LENGTH];
}; };
static PayloadContext *mpegts_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void mpegts_free_context(PayloadContext *data) static void mpegts_free_context(PayloadContext *data)
{ {
if (!data) if (!data)
...@@ -100,8 +95,8 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data, ...@@ -100,8 +95,8 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data,
RTPDynamicProtocolHandler ff_mpegts_dynamic_handler = { RTPDynamicProtocolHandler ff_mpegts_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_DATA, .codec_type = AVMEDIA_TYPE_DATA,
.priv_data_size = sizeof(PayloadContext),
.parse_packet = mpegts_handle_packet, .parse_packet = mpegts_handle_packet,
.alloc = mpegts_new_context,
.init = mpegts_init, .init = mpegts_init,
.free = mpegts_free_context, .free = mpegts_free_context,
.static_payload_id = 33, .static_payload_id = 33,
......
...@@ -47,16 +47,6 @@ struct PayloadContext { ...@@ -47,16 +47,6 @@ struct PayloadContext {
uint32_t next_timestamp; uint32_t next_timestamp;
}; };
static PayloadContext *qcelp_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void qcelp_free_context(PayloadContext *data)
{
av_free(data);
}
static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data, static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data,
AVStream *st, AVPacket *pkt, uint32_t *timestamp, AVStream *st, AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len); const uint8_t *buf, int len);
...@@ -223,8 +213,7 @@ RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = { ...@@ -223,8 +213,7 @@ RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = {
.enc_name = "x-Purevoice", .enc_name = "x-Purevoice",
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_QCELP, .codec_id = AV_CODEC_ID_QCELP,
.priv_data_size = sizeof(PayloadContext),
.static_payload_id = 12, .static_payload_id = 12,
.alloc = qcelp_new_context,
.free = qcelp_free_context,
.parse_packet = qcelp_parse_packet, .parse_packet = qcelp_parse_packet,
}; };
...@@ -298,21 +298,10 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm, ...@@ -298,21 +298,10 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
return (qdm->cache > 0) ? 1 : 0; return (qdm->cache > 0) ? 1 : 0;
} }
static PayloadContext *qdm2_extradata_new(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void qdm2_extradata_free(PayloadContext *qdm)
{
av_free(qdm);
}
RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = { RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = {
.enc_name = "X-QDM", .enc_name = "X-QDM",
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_NONE, .codec_id = AV_CODEC_ID_NONE,
.alloc = qdm2_extradata_new, .priv_data_size = sizeof(PayloadContext),
.free = qdm2_extradata_free,
.parse_packet = qdm2_parse_packet, .parse_packet = qdm2_parse_packet,
}; };
...@@ -235,11 +235,6 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -235,11 +235,6 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
} }
} }
static PayloadContext *qt_rtp_new(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void qt_rtp_free(PayloadContext *qt) static void qt_rtp_free(PayloadContext *qt)
{ {
av_freep(&qt->pkt.data); av_freep(&qt->pkt.data);
...@@ -251,7 +246,7 @@ RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \ ...@@ -251,7 +246,7 @@ RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
.enc_name = s, \ .enc_name = s, \
.codec_type = t, \ .codec_type = t, \
.codec_id = AV_CODEC_ID_NONE, \ .codec_id = AV_CODEC_ID_NONE, \
.alloc = qt_rtp_new, \ .priv_data_size = sizeof(PayloadContext), \
.free = qt_rtp_free, \ .free = qt_rtp_free, \
.parse_packet = qt_rtp_parse_packet, \ .parse_packet = qt_rtp_parse_packet, \
} }
......
...@@ -109,11 +109,6 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, ...@@ -109,11 +109,6 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
} }
static PayloadContext *svq3_extradata_new(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static void svq3_extradata_free(PayloadContext *sv) static void svq3_extradata_free(PayloadContext *sv)
{ {
if (sv->pktbuf) { if (sv->pktbuf) {
...@@ -128,7 +123,7 @@ RTPDynamicProtocolHandler ff_svq3_dynamic_handler = { ...@@ -128,7 +123,7 @@ RTPDynamicProtocolHandler ff_svq3_dynamic_handler = {
.enc_name = "X-SV3V-ES", .enc_name = "X-SV3V-ES",
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_NONE, // see if (config_packet) above .codec_id = AV_CODEC_ID_NONE, // see if (config_packet) above
.alloc = svq3_extradata_new, .priv_data_size = sizeof(PayloadContext),
.free = svq3_extradata_free, .free = svq3_extradata_free,
.parse_packet = svq3_parse_packet, .parse_packet = svq3_parse_packet,
}; };
...@@ -49,11 +49,6 @@ struct PayloadContext { ...@@ -49,11 +49,6 @@ struct PayloadContext {
int split_pkts; int split_pkts;
}; };
static PayloadContext *xiph_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
static inline void free_fragment(PayloadContext * data) static inline void free_fragment(PayloadContext * data)
{ {
if (data->fragment) { if (data->fragment) {
...@@ -385,8 +380,8 @@ RTPDynamicProtocolHandler ff_theora_dynamic_handler = { ...@@ -385,8 +380,8 @@ RTPDynamicProtocolHandler ff_theora_dynamic_handler = {
.enc_name = "theora", .enc_name = "theora",
.codec_type = AVMEDIA_TYPE_VIDEO, .codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_THEORA, .codec_id = AV_CODEC_ID_THEORA,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = xiph_parse_sdp_line, .parse_sdp_a_line = xiph_parse_sdp_line,
.alloc = xiph_new_context,
.free = xiph_free_context, .free = xiph_free_context,
.parse_packet = xiph_handle_packet, .parse_packet = xiph_handle_packet,
}; };
...@@ -396,8 +391,8 @@ RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = { ...@@ -396,8 +391,8 @@ RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
.codec_type = AVMEDIA_TYPE_AUDIO, .codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_VORBIS, .codec_id = AV_CODEC_ID_VORBIS,
.need_parsing = AVSTREAM_PARSE_HEADERS, .need_parsing = AVSTREAM_PARSE_HEADERS,
.priv_data_size = sizeof(PayloadContext),
.parse_sdp_a_line = xiph_parse_sdp_line, .parse_sdp_a_line = xiph_parse_sdp_line,
.alloc = xiph_new_context,
.free = xiph_free_context, .free = xiph_free_context,
.parse_packet = xiph_handle_packet, .parse_packet = xiph_handle_packet,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment