Commit fb9bddd8 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

meson: build examples

parent 01ae3c3a
option('audioresample_format', type : 'combo', choices : ['int', 'float', 'auto'], value : 'auto')
option('disable_examples', type : 'boolean', value : false)
option('use_orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
app_examples = [
'appsrc_ex',
'appsrc-stream',
'appsrc-stream2',
'appsrc-ra',
'appsrc-seekable',
'appsink-src',
'appsink-src2',
]
foreach app : app_examples
executable(app, '@0@.c'.format(app),
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, app_dep],
install: false)
endforeach
# autotools build also passes -D_GNU_SOURCE but not sure why it's needed
if gtk_dep.found()
executable('audiomix', 'audiomix.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, audio_dep, gtk_dep],
install: false)
executable('volume', 'volume.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, libm, audio_dep, gtk_dep],
install: false)
endif
foreach example : ['decodebin3', 'playbin-test']
executable(example, '@0@.c'.format(example),
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep],
install: false)
endforeach
dynamic_examples = ['addstream', 'codec-select', 'sprinkle', 'sprinkle2', 'sprinkle3']
foreach example : dynamic_examples
executable(example, '@0@.c'.format(example),
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep],
install: false)
endforeach
executable('encoding', 'encoding.c', 'gstcapslist.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, pbutils_dep, tag_dep, video_dep, audio_dep],
install: false)
executable('fftrange', 'fftrange.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, fft_dep],
install: false)
if gtk_dep.found()
executable('giosrc-mounting', 'giosrc-mounting.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gio_dep, gst_dep, gtk_dep],
install: false)
endif
# some of the examples want GTK+
gtk_dep = dependency('gtk+-3.0', version : '>= 3.10', required : false)
gtk_x11_dep = dependency('gtk+-x11-3.0', version : '>= 3.10', required : false)
gtk_quartz_dep = dependency('gtk+-quartz-3.0', version : '>= 3.10', required : false)
subdir('app')
subdir('audio')
subdir('dynamic')
subdir('decodebin_next')
subdir('encoding')
subdir('fft')
subdir('gio')
subdir('overlay')
subdir('playback')
subdir('playrec')
subdir('seek')
subdir('snapshot')
if x11_dep.found() # FIXME: originally if USE_X
if gtk_x11_dep.found()
executable('gtk-videooverlay', 'gtk-videooverlay.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, x11_dep, gtk_x11_dep],
install: false)
endif
if add_languages('cpp') # check for C++ support
qt5_mod = import('qt5')
qt5widgets_dep = dependency('qt5', modules : ['Gui', 'Widgets'])
if qt5widgets_dep.found()
executable('qt-videooverlay', 'qt-videooverlay.cpp',
cpp_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, x11_dep, qt5widgets_dep],
install: false)
# FIXME: this doesn't work properly yet, no moc_qtgv-videooverlay.cpp generated
moc_files = qt5_mod.preprocess(moc_headers : 'qtgv-videooverlay.h')#moc_sources : 'qtgv-videooverlay.cpp')
executable('qtgv-videooverlay', 'qtgv-videooverlay.cpp', moc_files,
cpp_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, x11_dep, qt5widgets_dep],
install: false)
endif
endif
endif
if gtk_dep.found()
if gtk_quartz_dep.found()
quartz_cflags = ['-xobjective-c']
else
quartz_cflags = []
endif
executable('playback-test', 'playback-test.c',
c_args : gst_plugins_base_args + quartz_cflags,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, gtk_dep],
install: false)
endif
executable('playrec', 'playrec.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep],
install: false)
if gtk_x11_dep.found()
if cc.compiles('''
#include <linux/input.h>
#include <linux/joystick.h>
struct js_event js;
js.type = JS_EVENT_AXIS''', name : 'Linux joystick headers needed by jseek example')
executable('jsseek', 'jsseek.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, gtk_dep],
install: false)
endif
executable('scrubby', 'scrubby.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [glib_deps, gst_dep, video_dep, libm, gtk_dep],
install: false)
endif
executable('stepping', 'stepping.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [libm, glib_deps, gst_dep, video_dep],
install: false)
executable('stepping2', 'stepping2.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [libm, glib_deps, gst_dep, video_dep],
install: false)
if gtk_dep.found()
executable('snapshot', 'snapshot.c',
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
dependencies : [libm, glib_deps, gst_dep, video_dep, gtk_dep],
install: false)
endif
......@@ -2,6 +2,8 @@
if host_machine.system() != 'windows'
subdir('check')
endif
#subdir('examples')
if not get_option('disable_examples')
subdir('examples')
endif
#subdir('files')
#subdir('icles')
# FIXME: subdir('icles')
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