On Wed, 7 Jun 2017 09:10:17 +0200
Steve Lhomme <[email protected]> wrote:

> On Tue, Jun 6, 2017 at 6:51 PM, wm4 <[email protected]> wrote:

> > +    // (avctx->pix_fmt is not updated yet at this point)
> > +    sctx->pix_fmt = avctx->hwaccel->pix_fmt;
> > +
> > +    if (avctx->codec_id == AV_CODEC_ID_H264 &&
> > +        (avctx->profile & ~FF_PROFILE_H264_CONSTRAINED) > 
> > FF_PROFILE_H264_HIGH) {
> > +        av_log(avctx, AV_LOG_VERBOSE, "Unsupported H.264 profile for DXVA 
> > HWAccel: %d\n",avctx->profile);
> > +        return AVERROR(ENOTSUP);
> > +    }
> > +
> > +    if (avctx->codec_id == AV_CODEC_ID_HEVC &&
> > +        avctx->profile != FF_PROFILE_HEVC_MAIN && avctx->profile != 
> > FF_PROFILE_HEVC_MAIN_10) {
> > +        av_log(avctx, AV_LOG_VERBOSE, "Unsupported HEVC profile for DXVA 
> > HWAccel: %d\n", avctx->profile);
> > +        return AVERROR(ENOTSUP);
> > +    }  
> 
> MPEG2 should also be limited to FF_PROFILE_MPEG2_SIMPLE and
> FF_PROFILE_MPEG2_MAIN profiles. And only one of the decoders can
> support both.

OK. I can add that. But I'll add it as a new patch later, as I'd really
like to get this patch set merged. It won't change the API anyway.

What do you mean by the latter sentence? It looks like both
DXVA2_ModeMPEG2_VLD and DXVA2_ModeMPEG2and1_VLD should support
the simple and main profiles.

> >  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
> >  {
> > -    #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
> > CONFIG_HEVC_D3D11VA_HWACCEL + \
> > +    #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + 
> > CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \
> >                           CONFIG_HEVC_VAAPI_HWACCEL + 
> > CONFIG_HEVC_VDPAU_HWACCEL)
> >      enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
> >
> > @@ -391,6 +391,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, 
> > const HEVCSPS *sps)
> >          sps->pix_fmt == AV_PIX_FMT_YUV420P10) {
> >  #if CONFIG_HEVC_D3D11VA_HWACCEL
> >          *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
> > +        *fmt++ = AV_PIX_FMT_D3D11;  
> 
> Can this be configured when building ? Since I will not support the
> new format anytime soon I'd rather not try this for every file we
> decode for nothing.

I think that would be pretty easy to avoid in the API-using code. Just
skip unknown formats, like you already have to do.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to