diff mbox series

[FFmpeg-devel,1/2] avformat/mov: remove special handling of av1c extradata

Message ID 20210508122943.15579-1-jeebjp@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avformat/mov: remove special handling of av1c extradata
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Jan Ekström May 8, 2021, 12:29 p.m. UTC
Libavcodec can now handle the AV1CodecConfigurationRecord structure
as-is when passed as extradata, so the standard behavior of
read-box-into-extradata should suffice, just like with AVC and HEVC.
---
 libavformat/mov.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

Comments

James Almer May 8, 2021, 12:46 p.m. UTC | #1
On 5/8/2021 9:29 AM, Jan Ekström wrote:
> Libavcodec can now handle the AV1CodecConfigurationRecord structure
> as-is when passed as extradata, so the standard behavior of
> read-box-into-extradata should suffice, just like with AVC and HEVC.
> ---
>   libavformat/mov.c | 30 +-----------------------------
>   1 file changed, 1 insertion(+), 29 deletions(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 295a8e2b99..f67bb2441f 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -5295,34 +5295,6 @@ static int mov_read_tmcd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>       return 0;
>   }
>   
> -static int mov_read_av1c(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> -{
> -    AVStream *st;
> -    int ret;
> -
> -    if (c->fc->nb_streams < 1)
> -        return 0;
> -    st = c->fc->streams[c->fc->nb_streams - 1];
> -
> -    if (atom.size < 4) {
> -        av_log(c->fc, AV_LOG_ERROR, "Empty AV1 Codec Configuration Box\n");
> -        return AVERROR_INVALIDDATA;
> -    }
> -
> -    /* For now, propagate only the OBUs, if any. Once libavcodec is
> -       updated to handle isobmff style extradata this can be removed. */
> -    avio_skip(pb, 4);
> -
> -    if (atom.size == 4)
> -        return 0;
> -
> -    ret = ff_get_extradata(c->fc, st->codecpar, pb, atom.size - 4);
> -    if (ret < 0)
> -        return ret;
> -
> -    return 0;
> -}
> -
>   static int mov_read_vpcc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>   {
>       AVStream *st;
> @@ -6850,7 +6822,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
>   { MKTAG('A','A','L','P'), mov_read_avid },
>   { MKTAG('A','R','E','S'), mov_read_ares },
>   { MKTAG('a','v','s','s'), mov_read_avss },
> -{ MKTAG('a','v','1','C'), mov_read_av1c },
> +{ MKTAG('a','v','1','C'), mov_read_glbl },
>   { MKTAG('c','h','p','l'), mov_read_chpl },
>   { MKTAG('c','o','6','4'), mov_read_stco },
>   { MKTAG('c','o','l','r'), mov_read_colr },

LGTM
Jan Ekström May 8, 2021, 5:12 p.m. UTC | #2
On Sat, May 8, 2021 at 3:46 PM James Almer <jamrial@gmail.com> wrote:
>
> On 5/8/2021 9:29 AM, Jan Ekström wrote:
> > Libavcodec can now handle the AV1CodecConfigurationRecord structure
> > as-is when passed as extradata, so the standard behavior of
> > read-box-into-extradata should suffice, just like with AVC and HEVC.
> > ---
> >   libavformat/mov.c | 30 +-----------------------------
> >   1 file changed, 1 insertion(+), 29 deletions(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index 295a8e2b99..f67bb2441f 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -5295,34 +5295,6 @@ static int mov_read_tmcd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> >       return 0;
> >   }
> >
> > -static int mov_read_av1c(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> > -{
> > -    AVStream *st;
> > -    int ret;
> > -
> > -    if (c->fc->nb_streams < 1)
> > -        return 0;
> > -    st = c->fc->streams[c->fc->nb_streams - 1];
> > -
> > -    if (atom.size < 4) {
> > -        av_log(c->fc, AV_LOG_ERROR, "Empty AV1 Codec Configuration Box\n");
> > -        return AVERROR_INVALIDDATA;
> > -    }
> > -
> > -    /* For now, propagate only the OBUs, if any. Once libavcodec is
> > -       updated to handle isobmff style extradata this can be removed. */
> > -    avio_skip(pb, 4);
> > -
> > -    if (atom.size == 4)
> > -        return 0;
> > -
> > -    ret = ff_get_extradata(c->fc, st->codecpar, pb, atom.size - 4);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    return 0;
> > -}
> > -
> >   static int mov_read_vpcc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> >   {
> >       AVStream *st;
> > @@ -6850,7 +6822,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
> >   { MKTAG('A','A','L','P'), mov_read_avid },
> >   { MKTAG('A','R','E','S'), mov_read_ares },
> >   { MKTAG('a','v','s','s'), mov_read_avss },
> > -{ MKTAG('a','v','1','C'), mov_read_av1c },
> > +{ MKTAG('a','v','1','C'), mov_read_glbl },
> >   { MKTAG('c','h','p','l'), mov_read_chpl },
> >   { MKTAG('c','o','6','4'), mov_read_stco },
> >   { MKTAG('c','o','l','r'), mov_read_colr },
>
> LGTM

Thanks, applied as 45e3b6a68b61114bbb24083dcb71a5991efa4fb0 .

Jan
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 295a8e2b99..f67bb2441f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5295,34 +5295,6 @@  static int mov_read_tmcd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-static int mov_read_av1c(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    int ret;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams - 1];
-
-    if (atom.size < 4) {
-        av_log(c->fc, AV_LOG_ERROR, "Empty AV1 Codec Configuration Box\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* For now, propagate only the OBUs, if any. Once libavcodec is
-       updated to handle isobmff style extradata this can be removed. */
-    avio_skip(pb, 4);
-
-    if (atom.size == 4)
-        return 0;
-
-    ret = ff_get_extradata(c->fc, st->codecpar, pb, atom.size - 4);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
 static int mov_read_vpcc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
@@ -6850,7 +6822,7 @@  static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('A','A','L','P'), mov_read_avid },
 { MKTAG('A','R','E','S'), mov_read_ares },
 { MKTAG('a','v','s','s'), mov_read_avss },
-{ MKTAG('a','v','1','C'), mov_read_av1c },
+{ MKTAG('a','v','1','C'), mov_read_glbl },
 { MKTAG('c','h','p','l'), mov_read_chpl },
 { MKTAG('c','o','6','4'), mov_read_stco },
 { MKTAG('c','o','l','r'), mov_read_colr },