[vlc-commits] videotoolbox: use constants instead of magic values
Marvin Scholz
git at videolan.org
Fri Jul 3 13:51:47 CEST 2020
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Jul 3 03:23:24 2020 +0200| [62454ef9d0ad9c37a1a4dbe9c635e5095aaadf1a] | committer: Marvin Scholz
videotoolbox: use constants instead of magic values
These constants are available starting with the macOS 10.13 SDK
so we can use them unconditionally as we require a recent SDK
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62454ef9d0ad9c37a1a4dbe9c635e5095aaadf1a
---
modules/codec/videotoolbox.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index be41cf32fe..0ca7adf3f2 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -184,7 +184,7 @@ static void HXXXGetBestChroma(decoder_t *p_dec)
/* Not for iOS since there is no 10bits textures with the old iOS
* openGLES version, and therefore no P010 shaders */
else if (i_depth_luma == 10 && i_depth_chroma == 10 && deviceSupportsHEVC())
- p_sys->i_cvpx_format = 'x420'; /* kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange */
+ p_sys->i_cvpx_format = kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange;
#endif
}
}
@@ -1714,10 +1714,7 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
VTERRCASE(kVTFrameSiloInvalidTimeRangeErr)
VTERRCASE(kVTCouldNotFindTemporalFilterErr)
VTERRCASE(kVTPixelTransferNotPermittedErr)
- case -12219:
- msg_Warn(p_dec, "vt session error: "
- "'kVTColorCorrectionImageRotationFailedErr'");
- break;
+ VTERRCASE(kVTColorCorrectionImageRotationFailedErr)
default:
msg_Warn(p_dec, "unknown vt session error (%i)", (int)status);
}
@@ -2031,8 +2028,8 @@ static int UpdateVideoFormat(decoder_t *p_dec, CVPixelBufferRef imageBuffer)
p_dec->fmt_out.i_codec = VLC_CODEC_CVPX_NV12;
assert(CVPixelBufferIsPlanar(imageBuffer) == true);
break;
- case 'xf20': /* kCVPixelFormatType_420YpCbCr10BiPlanarFullRange */
- case 'x420': /* kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange */
+ case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange:
+ case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
p_dec->fmt_out.i_codec = VLC_CODEC_CVPX_P010;
assert(CVPixelBufferIsPlanar(imageBuffer) == true);
break;
More information about the vlc-commits
mailing list