diff mbox series

[FFmpeg-devel,09/16] lavc/hevcdec: support all color formats in videotoolbox hwaccel

Message ID 20211122215821.9849-9-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/16] ffmpeg: remove ffmpeg_videotoolbox | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Ridley Combs Nov. 22, 2021, 9:58 p.m. UTC
---
 libavcodec/hevcdec.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

James Almer Nov. 22, 2021, 10:04 p.m. UTC | #1
On 11/22/2021 6:58 PM, rcombs wrote:
> ---
>   libavcodec/hevcdec.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 3e19f4ebed..f99cd7094e 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -420,7 +420,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>   #if CONFIG_HEVC_NVDEC_HWACCEL
>           *fmt++ = AV_PIX_FMT_CUDA;
>   #endif
> -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
> +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL

h264? Same below.

And no need to resend the set just to fix this if nothing else comes up. 
Just amend locally before pushing.

>           *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
>   #endif
>           break;
> @@ -435,7 +435,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>   #if CONFIG_HEVC_VAAPI_HWACCEL
>           *fmt++ = AV_PIX_FMT_VAAPI;
>   #endif
> -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
> +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
>           *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
>   #endif
>   #if CONFIG_HEVC_VDPAU_HWACCEL
> @@ -451,16 +451,25 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>   #endif
>   #if CONFIG_HEVC_NVDEC_HWACCEL
>           *fmt++ = AV_PIX_FMT_CUDA;
> +#endif
> +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
> +        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
>   #endif
>           break;
>       case AV_PIX_FMT_YUV422P:
>       case AV_PIX_FMT_YUV422P10LE:
>   #if CONFIG_HEVC_VAAPI_HWACCEL
>          *fmt++ = AV_PIX_FMT_VAAPI;
> +#endif
> +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
> +        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
>   #endif
>           break;
> -    case AV_PIX_FMT_YUV420P12:
>       case AV_PIX_FMT_YUV444P10:
> +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
> +        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
> +#endif
> +    case AV_PIX_FMT_YUV420P12:
>       case AV_PIX_FMT_YUV444P12:
>   #if CONFIG_HEVC_VDPAU_HWACCEL
>           *fmt++ = AV_PIX_FMT_VDPAU;
>
diff mbox series

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 3e19f4ebed..f99cd7094e 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -420,7 +420,7 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #if CONFIG_HEVC_NVDEC_HWACCEL
         *fmt++ = AV_PIX_FMT_CUDA;
 #endif
-#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
         *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
 #endif
         break;
@@ -435,7 +435,7 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #if CONFIG_HEVC_VAAPI_HWACCEL
         *fmt++ = AV_PIX_FMT_VAAPI;
 #endif
-#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
         *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
 #endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
@@ -451,16 +451,25 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #endif
 #if CONFIG_HEVC_NVDEC_HWACCEL
         *fmt++ = AV_PIX_FMT_CUDA;
+#endif
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
+        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
 #endif
         break;
     case AV_PIX_FMT_YUV422P:
     case AV_PIX_FMT_YUV422P10LE:
 #if CONFIG_HEVC_VAAPI_HWACCEL
        *fmt++ = AV_PIX_FMT_VAAPI;
+#endif
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
+        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
 #endif
         break;
-    case AV_PIX_FMT_YUV420P12:
     case AV_PIX_FMT_YUV444P10:
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
+        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
+#endif
+    case AV_PIX_FMT_YUV420P12:
     case AV_PIX_FMT_YUV444P12:
 #if CONFIG_HEVC_VDPAU_HWACCEL
         *fmt++ = AV_PIX_FMT_VDPAU;