2017-07-21 07:53:11 +00:00
|
|
|
applemedia_sources = [
|
|
|
|
'plugin.m',
|
|
|
|
'vtutil.c',
|
|
|
|
'corevideomemory.c',
|
|
|
|
'corevideobuffer.c',
|
|
|
|
'coremediabuffer.c',
|
|
|
|
'videotexturecache.m',
|
2019-08-28 08:59:35 +00:00
|
|
|
'videotexturecache-gl.m',
|
2017-07-21 07:53:11 +00:00
|
|
|
'atdec.c',
|
|
|
|
'glcontexthelper.c'
|
|
|
|
]
|
|
|
|
|
|
|
|
applemedia_args = [
|
|
|
|
'-Dgst_core_media_buffer_new=gst_core_media_buffer_priv_new',
|
|
|
|
'-Dgst_core_media_buffer_get_type=gst_core_media_buffer_priv_get_type',
|
|
|
|
'-Dgst_core_media_buffer_get_pixel_buffer=gst_core_media_buffer_priv_get_pixel_buffer',
|
|
|
|
'-Dgst_core_video_buffer_new=gst_core_video_buffer_priv_new',
|
|
|
|
'-Dgst_core_video_buffer_get_type=gst_core_video_buffer_priv_get_type'
|
|
|
|
]
|
|
|
|
|
|
|
|
applemedia_objc_args = []
|
2018-08-14 14:18:28 +00:00
|
|
|
applemedia_option = get_option('applemedia')
|
2018-08-16 21:29:26 +00:00
|
|
|
if not ['darwin', 'ios'].contains(host_system) or applemedia_option.disabled()
|
2018-08-14 14:18:28 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
2017-07-21 07:53:11 +00:00
|
|
|
|
2019-06-17 04:58:50 +00:00
|
|
|
if ['darwin', 'ios'].contains(host_system)
|
|
|
|
objc = meson.get_compiler('objc')
|
|
|
|
if not objc.has_argument('-fobjc-arc')
|
|
|
|
error('ARC is required for building')
|
|
|
|
endif
|
|
|
|
|
|
|
|
applemedia_objc_args += ['-fobjc-arc']
|
2021-07-27 04:52:38 +00:00
|
|
|
|
|
|
|
objcpp = meson.get_compiler('objcpp')
|
2019-06-17 04:58:50 +00:00
|
|
|
endif
|
|
|
|
|
2017-07-21 07:53:11 +00:00
|
|
|
applemedia_frameworks = []
|
2018-08-14 14:18:28 +00:00
|
|
|
corefoundation_dep = dependency('CoreFoundation', required : applemedia_option)
|
|
|
|
coremedia_dep = dependency('CoreMedia', required : applemedia_option)
|
|
|
|
corevideo_dep = dependency('CoreVideo', required : applemedia_option)
|
|
|
|
audiotoolbox_dep = dependency('AudioToolbox', required : applemedia_option)
|
2017-07-21 07:53:11 +00:00
|
|
|
applemedia_frameworks += [corefoundation_dep, coremedia_dep, corevideo_dep, audiotoolbox_dep]
|
|
|
|
|
2018-08-14 14:18:28 +00:00
|
|
|
avfoundation_dep = dependency('AVFoundation', required : applemedia_option)
|
2017-07-21 07:53:11 +00:00
|
|
|
if avfoundation_dep.found()
|
|
|
|
applemedia_sources += [
|
|
|
|
'avfvideosrc.m',
|
|
|
|
'avfassetsrc.m',
|
2019-01-27 03:09:59 +00:00
|
|
|
'avsamplevideosink.m',
|
|
|
|
'avfdeviceprovider.m',
|
2017-07-21 07:53:11 +00:00
|
|
|
]
|
|
|
|
applemedia_frameworks += [avfoundation_dep]
|
|
|
|
endif
|
|
|
|
|
2018-08-14 14:18:28 +00:00
|
|
|
videotoolbox_dep = dependency('VideoToolbox', required : applemedia_option)
|
2017-07-21 07:53:11 +00:00
|
|
|
if videotoolbox_dep.found()
|
|
|
|
applemedia_sources += [
|
|
|
|
'vtenc.c',
|
|
|
|
'vtdec.c'
|
|
|
|
]
|
|
|
|
applemedia_frameworks += [videotoolbox_dep]
|
|
|
|
endif
|
|
|
|
|
2018-08-16 21:29:26 +00:00
|
|
|
if host_system == 'ios'
|
2017-07-21 07:53:11 +00:00
|
|
|
applemedia_sources += [
|
|
|
|
'iosassetsrc.m',
|
|
|
|
'iosglmemory.c'
|
|
|
|
]
|
|
|
|
applemedia_objc_args += ['-fobjc-abi-version=2', '-fobjc-legacy-dispatch']
|
|
|
|
|
2018-09-01 16:18:31 +00:00
|
|
|
ios_media_dep = dependency('appleframeworks', modules : ['Foundation', 'AssetsLibrary'], required : applemedia_option)
|
2019-09-03 03:56:22 +00:00
|
|
|
iosurface_dep = dependency('IOSurface', required : applemedia_option)
|
|
|
|
applemedia_frameworks += [ios_media_dep, iosurface_dep]
|
2017-07-21 07:53:11 +00:00
|
|
|
else
|
|
|
|
applemedia_sources += [
|
2019-09-02 05:00:27 +00:00
|
|
|
'iosurfaceglmemory.c'
|
2017-07-21 07:53:11 +00:00
|
|
|
]
|
2018-08-14 14:18:28 +00:00
|
|
|
cocoa_dep = dependency('Cocoa', required : applemedia_option)
|
|
|
|
iosurface_dep = dependency('IOSurface', required : applemedia_option)
|
2018-12-14 03:22:51 +00:00
|
|
|
applemedia_opengl_dep = dependency('appleframeworks', modules : ['OpenGL'], required : applemedia_option)
|
2017-07-21 07:53:11 +00:00
|
|
|
applemedia_frameworks += [cocoa_dep, applemedia_opengl_dep, iosurface_dep]
|
|
|
|
endif
|
|
|
|
|
|
|
|
applemedia_found_deps = true
|
|
|
|
foreach framework : applemedia_frameworks
|
|
|
|
if not framework.found()
|
|
|
|
applemedia_found_deps = false
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2021-07-27 04:52:38 +00:00
|
|
|
applemedia_objcpp_args = []
|
2019-09-03 03:56:22 +00:00
|
|
|
if gstvulkan_dep.found() and have_objcpp
|
|
|
|
moltenvk_dep = cc.find_library('MoltenVK', required : false)
|
|
|
|
metal_dep = dependency('appleframeworks', modules : ['Metal'], required : false)
|
|
|
|
if metal_dep.found() and moltenvk_dep.found() and cc.has_header ('MoltenVK/vk_mvk_moltenvk.h')
|
|
|
|
applemedia_frameworks += [moltenvk_dep, gstvulkan_dep, metal_dep]
|
|
|
|
applemedia_sources += [
|
|
|
|
'videotexturecache-vulkan.mm',
|
|
|
|
'iosurfacevulkanmemory.c',
|
|
|
|
]
|
|
|
|
applemedia_args += ['-DAPPLEMEDIA_MOLTENVK']
|
2021-07-27 04:52:38 +00:00
|
|
|
# override_options : ['cpp_std=c++11'] doesn't seem to work for objcpp
|
|
|
|
applemedia_objcpp_args += objcpp.get_supported_arguments([
|
|
|
|
'-std=c++11',
|
|
|
|
])
|
2019-09-03 03:56:22 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-07-21 07:53:11 +00:00
|
|
|
if applemedia_found_deps
|
|
|
|
gstapplemedia = library('gstapplemedia',
|
|
|
|
applemedia_sources,
|
|
|
|
c_args : gst_plugins_bad_args + applemedia_args,
|
|
|
|
objc_args : gst_plugins_bad_args + applemedia_args + applemedia_objc_args,
|
2021-07-27 04:52:38 +00:00
|
|
|
objcpp_args : gst_plugins_bad_args + applemedia_args + applemedia_objc_args + applemedia_objcpp_args,
|
2017-07-21 07:53:11 +00:00
|
|
|
link_args : noseh_link_args,
|
|
|
|
include_directories : [configinc, libsinc],
|
2020-07-24 07:31:36 +00:00
|
|
|
dependencies : [gstvideo_dep, gstaudio_dep, gstpbutils_dep, gst_dep, gstbase_dep, gstgl_dep, gstglproto_dep] + applemedia_frameworks,
|
2021-07-27 04:52:38 +00:00
|
|
|
override_options : ['cpp_std=c++11'],
|
2017-07-21 07:53:11 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
2019-05-29 10:28:00 +00:00
|
|
|
plugins += [gstapplemedia]
|
2018-08-14 14:18:28 +00:00
|
|
|
endif
|