[vlc-commits] ci_filters: add iOS support

Thomas Guillem git at videolan.org
Tue Sep 12 16:48:59 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep 12 14:54:48 2017 +0200| [b1785a3718b20df676af88368f373fbfbcfbed21] | committer: Thomas Guillem

ci_filters: add iOS support

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

 modules/video_filter/Makefile.am  | 12 +++++++-----
 modules/video_filter/ci_filters.m | 14 ++++++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am
index 5c27a8a26d..a47c235363 100644
--- a/modules/video_filter/Makefile.am
+++ b/modules/video_filter/Makefile.am
@@ -107,15 +107,17 @@ video_filter_LTLIBRARIES = \
 	libpuzzle_plugin.la \
 	librotate_plugin.la
 
-if HAVE_OSX
-# MacOSX hardware video filters
+# macOS / iOS hardware video filters
 libci_filters_plugin_la_SOURCES = video_filter/ci_filters.m codec/vt_utils.c codec/vt_utils.h
-libci_filters_plugin_la_CFLAGS = $(AM_CFLAGS)
+if HAVE_OSX
 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
+endif
 
-video_filter_LTLIBRARIES += \
-	libci_filters_plugin.la
+if HAVE_IOS
+libci_filters_plugin_la_OBJCFLAGS = $(AM_CFLAGS) -miphoneos-version-min=9.0
+video_filter_LTLIBRARIES += libci_filters_plugin.la
 endif
 
 libdeinterlace_plugin_la_SOURCES = \
diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index cd9c49b4da..6727308146 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -339,7 +339,11 @@ Filter(filter_t *filter, picture_t *src)
     }
 
     [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];
     }
@@ -550,6 +554,7 @@ Open(vlc_object_t *obj, char const *psz_filter)
                 goto error;
         }
 
+#if !TARGET_OS_IPHONE
         CGLContextObj glctx = var_InheritAddress(filter, "macosx-glcontext");
         if (!glctx)
         {
@@ -560,6 +565,15 @@ Open(vlc_object_t *obj, char const *psz_filter)
                                            pixelFormat: nil
                                             colorSpace: nil
                                                options: nil];
+#else
+        CVEAGLContext eaglctx = var_InheritAddress(filter, "ios-eaglcontext");
+        if (!eaglctx)
+        {
+            msg_Err(filter, "can't find 'ios-eaglcontext' var");
+            goto error;
+        }
+        ctx->ci_ctx = [CIContext contextWithEAGLContext: eaglctx];
+#endif
         if (!ctx->ci_ctx)
             goto error;
 



More information about the vlc-commits mailing list