diff mbox series

[FFmpeg-devel] lavc/videotoolboxenc.c: Fix the trc support for iec61966-2-1 (sRGB)

Message ID 20210715042446.29967-1-hguandl@gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/videotoolboxenc.c: Fix the trc support for iec61966-2-1 (sRGB)
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Hao Guan July 15, 2021, 4:24 a.m. UTC
---
 libavcodec/videotoolboxenc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rick Kern July 20, 2021, 3:14 a.m. UTC | #1
On Thu, Jul 15, 2021 at 12:47 AM Hao Guan <hguandl@gmail.com> wrote:

> ---
>  libavcodec/videotoolboxenc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 4eaabed5d8..61eb6e1921 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -990,6 +990,10 @@ static int get_cv_transfer_function(AVCodecContext
> *avctx,
>              *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type,
> &gamma);
>              break;
>
> +        case AVCOL_TRC_IEC61966_2_1:
> +            *transfer_fnc = kCVImageBufferTransferFunction_sRGB;
> +            break;
> +
>
kCVImageBufferTransferFunction_sRGB is only available starting in iOS 11
and MacOS 10.13, so this will cause a build error for old OS's. This should
be added to compat_keys and accessed from there.

         case AVCOL_TRC_BT2020_10:
>          case AVCOL_TRC_BT2020_12:
>              *transfer_fnc =
> compat_keys.kCVImageBufferTransferFunction_ITU_R_2020;
> --
> 2.30.1 (Apple Git-130)
>
> _______________________________________________
> 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/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 4eaabed5d8..61eb6e1921 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -990,6 +990,10 @@  static int get_cv_transfer_function(AVCodecContext *avctx,
             *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma);
             break;
 
+        case AVCOL_TRC_IEC61966_2_1:
+            *transfer_fnc = kCVImageBufferTransferFunction_sRGB;
+            break;
+
         case AVCOL_TRC_BT2020_10:
         case AVCOL_TRC_BT2020_12:
             *transfer_fnc = compat_keys.kCVImageBufferTransferFunction_ITU_R_2020;