2018-03-01 20:46:16 +00:00
|
|
|
media_subdir = 'gtk-4.0/@0@/media'.format(gtk_binary_version)
|
|
|
|
media_install_dir = join_paths(get_option('libdir'), media_subdir)
|
2020-10-17 13:50:40 +00:00
|
|
|
media_backends = []
|
2018-03-01 20:46:16 +00:00
|
|
|
|
2022-11-01 00:18:12 +00:00
|
|
|
extra_c_args = ['-DGTK_COMPILATION']
|
2020-05-22 08:45:44 +00:00
|
|
|
extra_c_args += common_cflags
|
2018-06-22 17:53:32 +00:00
|
|
|
|
2020-10-17 13:50:40 +00:00
|
|
|
ffmpeg_opt = get_option('media-ffmpeg')
|
|
|
|
ffmpeg_versions = {
|
|
|
|
'libavfilter': '>= 6.47.100',
|
|
|
|
'libavformat': '>= 57.41.100',
|
|
|
|
'libavcodec': '>= 57.48.101',
|
2022-08-04 10:49:44 +00:00
|
|
|
'libavdevice': '>= 57.48.101',
|
2020-10-17 13:50:40 +00:00
|
|
|
'libavutil': '>= 55.28.100',
|
2022-08-04 10:49:44 +00:00
|
|
|
'libswresample': '>= 3.9.100',
|
2020-10-17 13:50:40 +00:00
|
|
|
'libswscale': '>= 4.6.100',
|
|
|
|
}
|
|
|
|
ffmpeg_deps = []
|
|
|
|
ffmpeg_found = true
|
|
|
|
foreach name, version : ffmpeg_versions
|
|
|
|
dep = dependency(name, version: version, required: ffmpeg_opt)
|
|
|
|
ffmpeg_deps += dep
|
|
|
|
if not dep.found()
|
|
|
|
ffmpeg_found = false
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if ffmpeg_found
|
|
|
|
media_backends += 'ffmpeg'
|
2018-02-27 22:19:17 +00:00
|
|
|
cdata.set('HAVE_FFMPEG', 1)
|
|
|
|
shared_module('media-ffmpeg',
|
2020-12-15 12:31:38 +00:00
|
|
|
sources: 'gtkffmediafile.c',
|
|
|
|
c_args: extra_c_args,
|
|
|
|
dependencies: [ libgtk_dep, ffmpeg_deps ],
|
2021-02-05 21:56:14 +00:00
|
|
|
name_suffix: module_suffix,
|
2020-12-15 12:31:38 +00:00
|
|
|
install_dir: media_install_dir,
|
|
|
|
install: true,
|
|
|
|
)
|
2018-02-27 22:19:17 +00:00
|
|
|
endif
|
|
|
|
|
2020-10-17 13:50:40 +00:00
|
|
|
gstplayer_dep = dependency('gstreamer-player-1.0', version: '>= 1.12.3',
|
|
|
|
required: get_option('media-gstreamer'))
|
2020-12-29 19:11:51 +00:00
|
|
|
gstgl_dep = dependency('gstreamer-gl-1.0', version: '>= 1.12.3',
|
|
|
|
required: get_option('media-gstreamer'))
|
|
|
|
|
2021-05-15 06:52:36 +00:00
|
|
|
if gstplayer_dep.found() and gstgl_dep.found()
|
2021-05-17 08:04:53 +00:00
|
|
|
extra_win_cflags = []
|
|
|
|
|
2021-09-01 12:08:43 +00:00
|
|
|
if host_machine.system() == 'windows' and gstgl_dep.version().version_compare('>=1.19.1')
|
|
|
|
message('libgstgl has gst_gl_display_new_with_type()')
|
|
|
|
extra_win_cflags += '-DHAVE_GST_GL_DISPLAY_NEW_WITH_TYPE'
|
2021-05-17 08:04:53 +00:00
|
|
|
endif
|
|
|
|
|
2020-10-17 13:50:40 +00:00
|
|
|
media_backends += 'gstreamer'
|
2018-03-02 00:56:31 +00:00
|
|
|
cdata.set('HAVE_GSTREAMER', 1)
|
|
|
|
shared_module('media-gstreamer',
|
2020-12-15 12:31:38 +00:00
|
|
|
sources: [
|
|
|
|
'gtkgstmediafile.c',
|
|
|
|
'gtkgstpaintable.c',
|
|
|
|
'gtkgstsink.c',
|
|
|
|
],
|
2021-05-17 08:04:53 +00:00
|
|
|
c_args: extra_c_args + extra_win_cflags,
|
2021-05-15 06:52:36 +00:00
|
|
|
dependencies: [ libm, libgtk_dep, gstplayer_dep, gstgl_dep ],
|
2021-02-05 21:56:14 +00:00
|
|
|
name_suffix: module_suffix,
|
2020-12-15 12:31:38 +00:00
|
|
|
install_dir: media_install_dir,
|
|
|
|
install: true,
|
|
|
|
)
|
2018-03-02 00:56:31 +00:00
|
|
|
endif
|
2022-01-14 17:53:36 +00:00
|
|
|
|
|
|
|
if media_backends.length() > 0
|
|
|
|
gio_module_dirs += media_install_dir
|
|
|
|
endif
|