]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_qdm2.c
Replace any remaining avpicture function with imgutils
[ffmpeg] / libavformat / rtpdec_qdm2.c
index 76b4c5317ddb028b75efbf83a196d8410c95a405..16dd48920e6a8c3fc6df14713d36b2bb02467604 100644 (file)
@@ -104,7 +104,7 @@ static int qdm2_parse_config(PayloadContext *qdm, AVStream *st,
                     return AVERROR_INVALIDDATA;
                 av_freep(&st->codec->extradata);
                 st->codec->extradata_size = 26 + item_len;
-                if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE))) {
+                if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) {
                     st->codec->extradata_size = 0;
                     return AVERROR(ENOMEM);
                 }
@@ -237,7 +237,8 @@ static int qdm2_restore_block(PayloadContext *qdm, AVStream *st, AVPacket *pkt)
 static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
                              AVStream *st, AVPacket *pkt,
                              uint32_t *timestamp,
-                             const uint8_t *buf, int len, int flags)
+                             const uint8_t *buf, int len, uint16_t seq,
+                             int flags)
 {
     int res = AVERROR_INVALIDDATA, n;
     const uint8_t *end = buf + len, *p = buf;
@@ -259,14 +260,14 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
                 return res;
             p += res;
 
-            /* We set codec_id to CODEC_ID_NONE initially to
+            /* We set codec_id to AV_CODEC_ID_NONE initially to
              * delay decoder initialization since extradata is
              * carried within the RTP stream, not SDP. Here,
-             * by setting codec_id to CODEC_ID_QDM2, we are signalling
+             * by setting codec_id to AV_CODEC_ID_QDM2, we are signalling
              * to the decoder that it is OK to initialize. */
-            st->codec->codec_id = CODEC_ID_QDM2;
+            st->codec->codec_id = AV_CODEC_ID_QDM2;
         }
-        if (st->codec->codec_id == CODEC_ID_NONE)
+        if (st->codec->codec_id == AV_CODEC_ID_NONE)
             return AVERROR(EAGAIN);
 
         /* subpackets */
@@ -297,21 +298,10 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
     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 = {
     .enc_name         = "X-QDM",
     .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = CODEC_ID_NONE,
-    .alloc            = qdm2_extradata_new,
-    .free             = qdm2_extradata_free,
+    .codec_id         = AV_CODEC_ID_NONE,
+    .priv_data_size   = sizeof(PayloadContext),
     .parse_packet     = qdm2_parse_packet,
 };