[vlc-commits] Revert "ci_filters: change color_space handling"

Thomas Guillem git at videolan.org
Wed Sep 27 16:29:28 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 27 16:12:18 2017 +0200| [86528b719f284f168581751c2ec05e77436f217f] | committer: Thomas Guillem

Revert "ci_filters: change color_space handling"

This reverts commit 9367f189bcb804c7996cfb22881d787a16cb19b4.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=86528b719f284f168581751c2ec05e77436f217f
---

 modules/video_filter/Makefile.am  |  1 -
 modules/video_filter/ci_filters.m | 30 +++++++++++++++++++++++++++---
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am
index e80a92acf6..a47c235363 100644
--- a/modules/video_filter/Makefile.am
+++ b/modules/video_filter/Makefile.am
@@ -110,7 +110,6 @@ video_filter_LTLIBRARIES = \
 # macOS / iOS hardware video filters
 libci_filters_plugin_la_SOURCES = video_filter/ci_filters.m codec/vt_utils.c codec/vt_utils.h
 if HAVE_OSX
-libci_filters_plugin_la_OBJCFLAGS = $(AM_CFLAGS) -mmacosx-version-min=10.11
 libci_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' \
 	-Wl,-framework,Foundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreImage -Wl,-framework,CoreVideo
 video_filter_LTLIBRARIES += libci_filters_plugin.la
diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index 2e8dbac083..4ab6b200f6 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -338,7 +338,14 @@ Filter(filter_t *filter, picture_t *src)
             ci_img = [fchain->ci_filter valueForKey: kCIOutputImageKey];
         }
 
-        [ctx->ci_ctx render: ci_img toCVPixelBuffer: cvpx];
+        [ctx->ci_ctx render: ci_img
+#if !TARGET_OS_IPHONE
+                toIOSurface: CVPixelBufferGetIOSurface(cvpx)
+#else
+            toCVPixelBuffer: cvpx
+#endif
+                     bounds: [ci_img extent]
+                 colorSpace: ctx->color_space];
     } /* autoreleasepool */
 
     CopyInfoAndRelease(dst, src);
@@ -516,6 +523,12 @@ error:
     return VLC_EGENERIC;
 }
 
+#if MAC_OS_X_VERSION_MIN_ALLOWED <= MAC_OS_X_VERSION_10_11
+const CFStringRef kCGColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709");
+#endif
+
+#define OSX_EL_CAPITAN_AND_HIGHER (NSFoundationVersionNumber >= 1252)
+
 static int
 Open(vlc_object_t *obj, char const *psz_filter)
 {
@@ -547,10 +560,21 @@ Open(vlc_object_t *obj, char const *psz_filter)
             goto error;
 
         if (filter->fmt_in.video.i_chroma != VLC_CODEC_CVPX_NV12
-         && filter->fmt_in.video.i_chroma != VLC_CODEC_CVPX_BGRA
-         && Open_AddConverters(filter, ctx))
+         && filter->fmt_in.video.i_chroma != VLC_CODEC_CVPX_BGRA)
+        {
+            if (!OSX_EL_CAPITAN_AND_HIGHER)
                 goto error;
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
+            ctx->color_space =
+                CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
+#pragma clang diagnostic pop
+
+            if (Open_AddConverters(filter, ctx))
+                goto error;
+        }
+
 #if !TARGET_OS_IPHONE
         CGLContextObj glctx = var_InheritAddress(filter, "macosx-glcontext");
         if (!glctx)



More information about the vlc-commits mailing list