[vlc-commits] [Git][videolan/vlc][master] 4 commits: vt_utils: add missing available platform

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Nov 18 14:48:31 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
14cefc3c by Alexandre Janniaux at 2023-11-18T14:33:57+00:00
vt_utils: add missing available platform

kCVImageBufferTransferFunction_Linear is also not available before the
tvOS 12 version, which is greater than the minimum we support.

- - - - -
4c9dbaf0 by Alexandre Janniaux at 2023-11-18T14:33:57+00:00
vt_utils: use SDK checks before availability checks

The SDK checks are ensuring the identifiers are existing at compile time
whereas the existing availability checks at runtime. If the SDK is too
old, the compilation will fail.

- - - - -
550ce6e1 by Alexandre Janniaux at 2023-11-18T14:33:57+00:00
VLCSampleBufferDisplay: remove kCGImageByteOrderDefault

kCGImageByteOrderDefault is the default value anyway (= 0 <<< 12) [^1]
and it's not available in older SDK we support.

[^1]: https://developer.apple.com/documentation/coregraphics/cgimagebyteorderinfo/kcgimagebyteorderdefault

- - - - -
933c2d05 by Alexandre Janniaux at 2023-11-18T14:33:57+00:00
VLCSampleBufferDisplay: remove double const qualifier

- - - - -


2 changed files:

- modules/codec/vt_utils.c
- modules/video_output/apple/VLCSampleBufferDisplay.m


Changes:

=====================================
modules/codec/vt_utils.c
=====================================
@@ -385,8 +385,13 @@ cvpx_map_TransferFunction_from_vtf(video_transfer_func_t transfer_func)
             return kCVImageBufferTransferFunction_ITU_R_2100_HLG;
         break;
     case TRANSFER_FUNC_LINEAR:
-        if (__builtin_available(macOS 10.14, iOS 12, *))
+#if (TARGET_OS_OSX    && defined(__MAC_10_14)   && MAC_OS_X_VERSION_MAX_ALLOWED    >= __MAC_10_14) ||\
+    (TARGET_OS_IPHONE && defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0) || \
+    (TARGET_OS_TV     && defined(__TVOS_12_0)   && __TV_OS_VERSION_MAX_ALLOWED     >= __TVOS_12_0) || \
+    (TARGET_OS_WATCH  && defined(__WATCHOS_5_0) && __WATCH_OS_VERSION_MAX_ALLOWED  >= __WATCHOS_5_0)
+        if (__builtin_available(macOS 10.14, iOS 12, tvOS 12, watchOS 5, *))
             return kCVImageBufferTransferFunction_Linear;
+#endif
         break;
     case TRANSFER_FUNC_SRGB:
         return kCVImageBufferTransferFunction_UseGamma;
@@ -403,9 +408,15 @@ cvpx_map_TransferFunction_from_vtf(video_transfer_func_t transfer_func)
 }
 
 bool cvpx_has_attachment(CVPixelBufferRef pixelBuffer, CFStringRef key) {
-    if (__builtin_available(macOS 10.12, iOS 15, tvOS 15.0, *)) {
+#if (TARGET_OS_OSX    && defined(__MAC_10_14)   && MA_COS_X_VERSION_MAX_ALLOWED    >= __MAC_10_12) ||\
+    (TARGET_OS_IOS    && defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0) || \
+    (TARGET_OS_TV     && defined(__TVOS_15_0)   && __TV_OS_VERSION_MAX_ALLOWED     >= __TVOS_15_0) || \
+    (TARGET_OS_WATCH  && defined(__WATCHOS_8_0) && __WATCH_OS_VERSION_MAX_ALLOWED  >= __WATCHOS_8_0)
+    if (__builtin_available(macOS 10.12, iOS 15, tvOS 15, watchOS 8, *)) {
         return CVBufferHasAttachment(pixelBuffer, key);
     }
+#endif
+
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
     return CVBufferGetAttachment(pixelBuffer, key, NULL) != NULL;


=====================================
modules/video_output/apple/VLCSampleBufferDisplay.m
=====================================
@@ -404,7 +404,7 @@ static void RenderPicture(vout_display_t *vd, picture_t *pic, vlc_tick_t date) {
 }
 
 static CGRect RegionBackingFrame(VLCSampleBufferDisplay* sys,
-                                 const const vlc_render_subpicture *subpicture,
+                                 const vlc_render_subpicture *subpicture,
                                  const subpicture_region_t *r)
 {
     const float scale_w = (float)(sys->place.width)  / subpicture->i_original_picture_width;
@@ -447,7 +447,7 @@ static void UpdateSubpictureRegions(vout_display_t *vd,
         CGImageRef image = CGImageCreate(
             r->fmt.i_visible_width, r->fmt.i_visible_height,
             8, 32, r->p_picture->p->i_pitch,
-            space, kCGImageByteOrderDefault | kCGImageAlphaFirst,
+            space, kCGImageAlphaFirst,
             provider, NULL, true, kCGRenderingIntentDefault
             );
         VLCSampleBufferSubpictureRegion *region;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bf87e8465546bec8c3678aca139df1da039f348c...933c2d055c5592ebb576e10a90cde198e05aaa45

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bf87e8465546bec8c3678aca139df1da039f348c...933c2d055c5592ebb576e10a90cde198e05aaa45
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list