Commit b1785a37 authored by Thomas Guillem's avatar Thomas Guillem

ci_filters: add iOS support

parent dbb2e083
......@@ -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 = \
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment