diff mbox series

[FFmpeg-devel] avcodec/vvcdec: decode extradata to support container formats

Message ID TYSPR06MB6433C2F40320F41A06FFEBC0AA652@TYSPR06MB6433.apcprd06.prod.outlook.com
State Accepted
Commit 26769024d1cb63078b7dd5c470daedb8dbe4e5bd
Headers show
Series [FFmpeg-devel] avcodec/vvcdec: decode extradata to support container formats | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Nuo Mi Jan. 6, 2024, 1:24 a.m. UTC
For example:
wget https://www.elecard.com/storage/video/NovosobornayaSquare_1920x1080.mp4
./ffplay NovosobornayaSquare_1920x1080.mp4
---
 libavcodec/vvc/vvcdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

James Almer Jan. 6, 2024, 1:31 a.m. UTC | #1
On 1/5/2024 10:27 PM, Nuo Mi wrote:
> On Sat, Jan 6, 2024 at 9:25 AM Nuo Mi <nuomi2021@gmail.com> wrote:
> 
>> For example:
>> wget
>> https://www.elecard.com/storage/video/NovosobornayaSquare_1920x1080.mp4
>> ./ffplay NovosobornayaSquare_1920x1080.mp4
>> ---
>>   libavcodec/vvc/vvcdec.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
>> index 608d497cb7..54ada28124 100644
>> --- a/libavcodec/vvc/vvcdec.c
>> +++ b/libavcodec/vvc/vvcdec.c
>> @@ -977,6 +977,12 @@ static av_cold int vvc_decode_init(AVCodecContext
>> *avctx)
>>       if (ret)
>>           return ret;
>>
>> +    if (avctx->extradata_size > 0 && avctx->extradata) {
>> +        ret = ff_cbs_read_extradata_from_codec(s->cbc, &s->current_frame,
>> avctx);
>> +        if (ret < 0)
>> +            return ret;
>> +    }
>> +
>>       s->nb_fcs = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 : delayed;
>>       s->fcs = av_calloc(s->nb_fcs, sizeof(*s->fcs));
>>       if (!s->fcs)
>> --
>> 2.25.1

LGTM

>>
>> Depends on
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231103095720.32426-3-thomas.ff@spin-digital.com/

I don't see why this depends on that patch. Decoder and muxer are two 
separate things.
Nuo Mi Jan. 6, 2024, 2:10 a.m. UTC | #2
On Sat, Jan 6, 2024 at 9:32 AM James Almer <jamrial@gmail.com> wrote:

> On 1/5/2024 10:27 PM, Nuo Mi wrote:
> > On Sat, Jan 6, 2024 at 9:25 AM Nuo Mi <nuomi2021@gmail.com> wrote:
> >
> >> For example:
> >> wget
> >> https://www.elecard.com/storage/video/NovosobornayaSquare_1920x1080.mp4
> >> ./ffplay NovosobornayaSquare_1920x1080.mp4
> >> ---
> >>   libavcodec/vvc/vvcdec.c | 6 ++++++
> >>   1 file changed, 6 insertions(+)
> >>
> >> diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
> >> index 608d497cb7..54ada28124 100644
> >> --- a/libavcodec/vvc/vvcdec.c
> >> +++ b/libavcodec/vvc/vvcdec.c
> >> @@ -977,6 +977,12 @@ static av_cold int vvc_decode_init(AVCodecContext
> >> *avctx)
> >>       if (ret)
> >>           return ret;
> >>
> >> +    if (avctx->extradata_size > 0 && avctx->extradata) {
> >> +        ret = ff_cbs_read_extradata_from_codec(s->cbc,
> &s->current_frame,
> >> avctx);
> >> +        if (ret < 0)
> >> +            return ret;
> >> +    }
> >> +
> >>       s->nb_fcs = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 :
> delayed;
> >>       s->fcs = av_calloc(s->nb_fcs, sizeof(*s->fcs));
> >>       if (!s->fcs)
> >> --
> >> 2.25.1
>
> LGTM
>

> >>
> >> Depends on
> >
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231103095720.32426-3-thomas.ff@spin-digital.com/
>
> I don't see why this depends on that patch. Decoder and muxer are two
> separate things.

Thank you. I'll push it tomorrow if there are no objections.
Yes, we can push it separately, but the user needs the demux patch to
decode MP4 files. Just want to call out it :)

>
Nuo Mi Jan. 7, 2024, 1:12 a.m. UTC | #3
On Sat, Jan 6, 2024 at 10:10 AM Nuo Mi <nuomi2021@gmail.com> wrote:

>
>
> On Sat, Jan 6, 2024 at 9:32 AM James Almer <jamrial@gmail.com> wrote:
>
>> On 1/5/2024 10:27 PM, Nuo Mi wrote:
>> > On Sat, Jan 6, 2024 at 9:25 AM Nuo Mi <nuomi2021@gmail.com> wrote:
>> >
>> >> For example:
>> >> wget
>> >>
>> https://www.elecard.com/storage/video/NovosobornayaSquare_1920x1080.mp4
>> >> ./ffplay NovosobornayaSquare_1920x1080.mp4
>> >> ---
>> >>   libavcodec/vvc/vvcdec.c | 6 ++++++
>> >>   1 file changed, 6 insertions(+)
>> >>
>> >> diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
>> >> index 608d497cb7..54ada28124 100644
>> >> --- a/libavcodec/vvc/vvcdec.c
>> >> +++ b/libavcodec/vvc/vvcdec.c
>> >> @@ -977,6 +977,12 @@ static av_cold int vvc_decode_init(AVCodecContext
>> >> *avctx)
>> >>       if (ret)
>> >>           return ret;
>> >>
>> >> +    if (avctx->extradata_size > 0 && avctx->extradata) {
>> >> +        ret = ff_cbs_read_extradata_from_codec(s->cbc,
>> &s->current_frame,
>> >> avctx);
>> >> +        if (ret < 0)
>> >> +            return ret;
>> >> +    }
>> >> +
>> >>       s->nb_fcs = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 :
>> delayed;
>> >>       s->fcs = av_calloc(s->nb_fcs, sizeof(*s->fcs));
>> >>       if (!s->fcs)
>> >> --
>> >> 2.25.1
>>
>> LGTM
>>
>
>> >>
>> >> Depends on
>> >
>> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231103095720.32426-3-thomas.ff@spin-digital.com/
>>
>> I don't see why this depends on that patch. Decoder and muxer are two
>> separate things.
>
> Thank you. I'll push it tomorrow if there are no objections.
>
Pushed.

> Yes, we can push it separately, but the user needs the demux patch to
> decode MP4 files. Just want to call out it :)
>
>>
>
> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>
>
diff mbox series

Patch

diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c
index 608d497cb7..54ada28124 100644
--- a/libavcodec/vvc/vvcdec.c
+++ b/libavcodec/vvc/vvcdec.c
@@ -977,6 +977,12 @@  static av_cold int vvc_decode_init(AVCodecContext *avctx)
     if (ret)
         return ret;
 
+    if (avctx->extradata_size > 0 && avctx->extradata) {
+        ret = ff_cbs_read_extradata_from_codec(s->cbc, &s->current_frame, avctx);
+        if (ret < 0)
+            return ret;
+    }
+
     s->nb_fcs = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 : delayed;
     s->fcs = av_calloc(s->nb_fcs, sizeof(*s->fcs));
     if (!s->fcs)