[vlc-devel] [PATCH] vaapi: use ffmpeg context to read the codec profile

Mathieu Velten matmaul at gmail.com
Thu Dec 28 17:01:51 CET 2017


Le 28 déc. 2017 05:16, "Steve Lhomme" <robux4 at gmail.com> a écrit :

In any case does the ctx value get copied to the fmt later? Because we
probably want to display that info in the stream Metadata.


Instead of the current patch I can copy the profile value from the ctx to
fmt earlier in the generic avcodec code, only if the current fmt profile
value is < 0 so we do not override a value coming from the parser. I'll try
to test that tomorrow.


On Thu 28 Dec 2017 at 00:36, Jean-Baptiste Kempf <jb at videolan.org> wrote:

> Hello Mathieu,
>
> On Wed, 27 Dec 2017, at 12:49, Mathieu Velten wrote:
>
> Hi Jean-Baptiste,
>
> Le mer. 27 déc. 2017 à 12:04, Jean-Baptiste Kempf <jb at videolan.org> a
> écrit :
>
> Hello Mathieu,
>
> On Tue, 26 Dec 2017, at 15:21, Mathieu Velten wrote:
> > Sometimes the profile is not available in the container metadatas (WebM).
>
> Shouldn't the packetizer find those info?
>
>
> avparser is used to packetize VP9.
> I just tried to fetch the profile after the call to av_parser_parse2 but
> it doesn't seem to update the avcodec context with the profile.
>
>
> OK. Also, that might fix #/19196, no?
>

Seems unrelated, software decoding is working fine on my side.


> I am a bit reluctant to write the whole logic to parse the profile
> manually there since we have the correct info directly in the decoder
> context at this stage.
>
>
> Sure.
>
> However I will revert the change for HEVC since we have a full packetizer
> in this case, updated patch incoming.
>
>
> Yes, that would be preferable, especially if we want to backport to 3.0 (I
> do).
>
> I'll let François and Thomas debate on that later, because I believe the
> discussion is not over :)
>
> Best,
>
>
>
>
> > ---
> >  modules/codec/avcodec/vaapi.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/
> > vaapi.c
> > index ee7fdf8..ffe537e 100644
> > --- a/modules/codec/avcodec/vaapi.c
> > +++ b/modules/codec/avcodec/vaapi.c
> > @@ -87,9 +87,9 @@ static int GetVaProfile(AVCodecContext *ctx, const
> > es_format_t *fmt,
> >          count = 18;
> >          break;
> >      case AV_CODEC_ID_HEVC:
> > -        if (fmt->i_profile == FF_PROFILE_HEVC_MAIN)
> > +        if (ctx->profile == FF_PROFILE_HEVC_MAIN)
> >              i_profile = VAProfileHEVCMain;
> > -        else if (fmt->i_profile == FF_PROFILE_HEVC_MAIN_10)
> > +        else if (ctx->profile == FF_PROFILE_HEVC_MAIN_10)
> >          {
> >              i_profile = VAProfileHEVCMain10;
> >              i_vlc_chroma = VLC_CODEC_VAAPI_420_10BPP;
> > @@ -103,11 +103,14 @@ static int GetVaProfile(AVCodecContext *ctx, const
> > es_format_t *fmt,
> >          count = 5;
> >          break;
> >      case AV_CODEC_ID_VP9:
> > -        if (fmt->i_profile == FF_PROFILE_VP9_0)
> > +        if (ctx->profile == FF_PROFILE_VP9_0)
> >              i_profile = VAProfileVP9Profile0;
> >  #if VA_CHECK_VERSION( 0, 39, 0 )
> > -        else if (fmt->i_profile == FF_PROFILE_VP9_2)
> > +        else if (ctx->profile == FF_PROFILE_VP9_2)
> > +        {
> >              i_profile = VAProfileVP9Profile2;
> > +            i_vlc_chroma = VLC_CODEC_VAAPI_420_10BPP;
> > +        }
> >  #endif
> >          else
> >              return VLC_EGENERIC;
> > --
> > 2.14.3
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
>
>
> --
> Jean-Baptiste Kempf -  President
> +33 672 704 734
>
>
> --
> Jean-Baptiste Kempf -  President
> +33 672 704 734
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20171228/c06cc397/attachment.html>


More information about the vlc-devel mailing list