Commit 86528b71 authored by Thomas Guillem's avatar Thomas Guillem

Revert "ci_filters: change color_space handling"

This reverts commit 9367f189.
parent b91b28c1
......@@ -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
......
......@@ -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)
......
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