| @@ -90,6 +90,9 @@ static int amf_init_decoder(AVCodecContext *avctx) · 89 unmodified lines |
| 90 | AMFBuffer *buffer; | 90 | AMFBuffer *buffer; |
| 91 | amf_int64 color_profile; | 91 | amf_int64 color_profile; |
| 92 | int pool_size = 36; | 92 | int pool_size = 36; |
| | 93 | // way-around for older drivers that don't support dynamic bitness detection - |
| | 94 | // define HEVC and VP9 10-bit based on container info |
| | 95 | int no_bitness_detect = amf_legacy_driver_no_bitness_detect(amf_device_ctx); |
| 93 | | 96 | |
| 94 | ctx->drain = 0; | 97 | ctx->drain = 0; |
| 95 | ctx->resolution_changed = 0; | 98 | ctx->resolution_changed = 0; |
| @@ -100,13 +103,17 @@ static int amf_init_decoder(AVCodecContext *avctx) · 4 unmodified lines |
| 100 | break; | 103 | break; |
| 101 | case AV_CODEC_ID_HEVC: { | 104 | case AV_CODEC_ID_HEVC: { |
| 102 | codec_id = AMFVideoDecoderHW_H265_HEVC; | 105 | codec_id = AMFVideoDecoderHW_H265_HEVC; |
| 103 | // way-around for older drivers that don't support dynamic butness detection - | 106 | if(no_bitness_detect){ |
| 104 | // define HEVC 10-bit based on container info | | |
| 105 | if(amf_legacy_driver_no_bitness_detect(amf_device_ctx)){ | | |
| 106 | if(avctx->pix_fmt == AV_PIX_FMT_YUV420P10) | 107 | if(avctx->pix_fmt == AV_PIX_FMT_YUV420P10) |
| 107 | codec_id = AMFVideoDecoderHW_H265_MAIN10; | 108 | codec_id = AMFVideoDecoderHW_H265_MAIN10; |
| 108 | } | 109 | } |
| 109 | | 110 | } break; |
| | 111 | case AV_CODEC_ID_VP9: { |
| | 112 | codec_id = AMFVideoDecoderHW_VP9; |
| | 113 | if(no_bitness_detect){ |
| | 114 | if(avctx->pix_fmt == AV_PIX_FMT_YUV420P10) |
| | 115 | codec_id = AMFVideoDecoderHW_VP9_10BIT; |
| | 116 | } |
| 110 | } break; | 117 | } break; |
| 111 | case AV_CODEC_ID_AV1: | 118 | case AV_CODEC_ID_AV1: |
| 112 | codec_id = AMFVideoDecoderHW_AV1; | 119 | codec_id = AMFVideoDecoderHW_AV1; |
| @@ -717,4 +724,5 @@ const FFCodec ff_##x##_amf_decoder = { \ · 604 unmodified lines |
| 717 | | 724 | |
| 718 | DEFINE_AMF_DECODER(h264, H264, "h264_mp4toannexb") | 725 | DEFINE_AMF_DECODER(h264, H264, "h264_mp4toannexb") |
| 719 | DEFINE_AMF_DECODER(hevc, HEVC, NULL) | 726 | DEFINE_AMF_DECODER(hevc, HEVC, NULL) |
| | 727 | DEFINE_AMF_DECODER(vp9, VP9, NULL) |
| 720 | DEFINE_AMF_DECODER(av1, AV1, NULL) | 728 | DEFINE_AMF_DECODER(av1, AV1, NULL) |