meson: Add an option for the applemedia plugin

This commit is contained in:
Nirbheek Chauhan 2018-08-14 19:48:28 +05:30
parent bba33533ab
commit a93bb626c9
2 changed files with 17 additions and 12 deletions

View file

@ -74,6 +74,7 @@ option('x11', type : 'feature', value : 'auto', description : 'X11 support in Vu
# Feature options for plugins that need external deps # Feature options for plugins that need external deps
option('aom', type : 'feature', value : 'auto', description : 'AOM AV1 video codec plugin') option('aom', type : 'feature', value : 'auto', description : 'AOM AV1 video codec plugin')
option('applemedia', type : 'feature', value : 'auto', description : 'Video capture and codec access plugins for macOS and iOS')
option('assrender', type : 'feature', value : 'auto', description : 'ASS/SSA subtitle renderer plugin') option('assrender', type : 'feature', value : 'auto', description : 'ASS/SSA subtitle renderer plugin')
option('bluez', type : 'feature', value : 'auto', description : 'Bluetooth audio A2DP/AVDTP sink, AVDTP source plugin') option('bluez', type : 'feature', value : 'auto', description : 'Bluetooth audio A2DP/AVDTP sink, AVDTP source plugin')
option('bs2b', type : 'feature', value : 'auto', description : 'Bauer stereophonic-to-binaural audio plugin') option('bs2b', type : 'feature', value : 'auto', description : 'Bauer stereophonic-to-binaural audio plugin')

View file

@ -18,16 +18,20 @@ applemedia_args = [
] ]
applemedia_objc_args = [] applemedia_objc_args = []
applemedia_option = get_option('applemedia')
if host_system != 'darwin' or applemedia_option.disabled()
subdir_done()
endif
applemedia_deps_found = false applemedia_deps_found = false
applemedia_frameworks = [] applemedia_frameworks = []
corefoundation_dep = dependency('CoreFoundation', required : false) corefoundation_dep = dependency('CoreFoundation', required : applemedia_option)
coremedia_dep = dependency('CoreMedia', required : false) coremedia_dep = dependency('CoreMedia', required : applemedia_option)
corevideo_dep = dependency('CoreVideo', required : false) corevideo_dep = dependency('CoreVideo', required : applemedia_option)
audiotoolbox_dep = dependency('AudioToolbox', required : false) audiotoolbox_dep = dependency('AudioToolbox', required : applemedia_option)
applemedia_frameworks += [corefoundation_dep, coremedia_dep, corevideo_dep, audiotoolbox_dep] applemedia_frameworks += [corefoundation_dep, coremedia_dep, corevideo_dep, audiotoolbox_dep]
avfoundation_dep = dependency('AVFoundation', required : false) avfoundation_dep = dependency('AVFoundation', required : applemedia_option)
if avfoundation_dep.found() if avfoundation_dep.found()
applemedia_sources += [ applemedia_sources += [
'avfvideosrc.m', 'avfvideosrc.m',
@ -37,7 +41,7 @@ if avfoundation_dep.found()
applemedia_frameworks += [avfoundation_dep] applemedia_frameworks += [avfoundation_dep]
endif endif
videotoolbox_dep = dependency('VideoToolbox', required : false) videotoolbox_dep = dependency('VideoToolbox', required : applemedia_option)
if videotoolbox_dep.found() if videotoolbox_dep.found()
applemedia_sources += [ applemedia_sources += [
'vtenc.c', 'vtenc.c',
@ -53,17 +57,17 @@ if cdata.has('HAVE_IOS')
] ]
applemedia_objc_args += ['-fobjc-abi-version=2', '-fobjc-legacy-dispatch'] applemedia_objc_args += ['-fobjc-abi-version=2', '-fobjc-legacy-dispatch']
foundation_dep = dependency('Foundation', required : false) foundation_dep = dependency('Foundation', required : applemedia_option)
coremedia_dep = dependency('AssetsLibrary', required : false) coremedia_dep = dependency('AssetsLibrary', required : applemedia_option)
applemedia_frameworks += [foundation_dep, coremedia_dep] applemedia_frameworks += [foundation_dep, coremedia_dep]
else else
applemedia_sources += [ applemedia_sources += [
'iosurfacememory.c' 'iosurfacememory.c'
] ]
applemedia_objc_args += ['-mmacosx-version-min=10.8'] applemedia_objc_args += ['-mmacosx-version-min=10.8']
cocoa_dep = dependency('Cocoa', required : false) cocoa_dep = dependency('Cocoa', required : applemedia_option)
iosurface_dep = dependency('IOSurface', required : false) iosurface_dep = dependency('IOSurface', required : applemedia_option)
applemedia_opengl_dep = dependency('OpenGL', required : false) applemedia_opengl_dep = dependency('OpenGL', required : applemedia_option)
applemedia_frameworks += [cocoa_dep, applemedia_opengl_dep, iosurface_dep] applemedia_frameworks += [cocoa_dep, applemedia_opengl_dep, iosurface_dep]
endif endif