diff --git a/meson_options.txt b/meson_options.txt index d44b3f3018..033ee6f4e4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ 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') diff --git a/tests/examples/app/meson.build b/tests/examples/app/meson.build new file mode 100644 index 0000000000..f6e9a81c34 --- /dev/null +++ b/tests/examples/app/meson.build @@ -0,0 +1,17 @@ +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 diff --git a/tests/examples/audio/meson.build b/tests/examples/audio/meson.build new file mode 100644 index 0000000000..f5aa1ffabb --- /dev/null +++ b/tests/examples/audio/meson.build @@ -0,0 +1,13 @@ +# 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 diff --git a/tests/examples/decodebin_next/meson.build b/tests/examples/decodebin_next/meson.build new file mode 100644 index 0000000000..7e3beb7778 --- /dev/null +++ b/tests/examples/decodebin_next/meson.build @@ -0,0 +1,7 @@ +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 diff --git a/tests/examples/dynamic/meson.build b/tests/examples/dynamic/meson.build new file mode 100644 index 0000000000..6bccdb0e08 --- /dev/null +++ b/tests/examples/dynamic/meson.build @@ -0,0 +1,9 @@ +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 diff --git a/tests/examples/encoding/meson.build b/tests/examples/encoding/meson.build new file mode 100644 index 0000000000..39e2ad6c36 --- /dev/null +++ b/tests/examples/encoding/meson.build @@ -0,0 +1,5 @@ +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) diff --git a/tests/examples/fft/meson.build b/tests/examples/fft/meson.build new file mode 100644 index 0000000000..84e9b78ce7 --- /dev/null +++ b/tests/examples/fft/meson.build @@ -0,0 +1,5 @@ +executable('fftrange', 'fftrange.c', + c_args : gst_plugins_base_args, + include_directories: [configinc, libsinc], + dependencies : [glib_deps, gst_dep, fft_dep], + install: false) diff --git a/tests/examples/gio/meson.build b/tests/examples/gio/meson.build new file mode 100644 index 0000000000..5d329cbecf --- /dev/null +++ b/tests/examples/gio/meson.build @@ -0,0 +1,7 @@ +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 diff --git a/tests/examples/meson.build b/tests/examples/meson.build new file mode 100644 index 0000000000..04e07d904b --- /dev/null +++ b/tests/examples/meson.build @@ -0,0 +1,17 @@ +# 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') diff --git a/tests/examples/overlay/meson.build b/tests/examples/overlay/meson.build new file mode 100644 index 0000000000..b246aa6680 --- /dev/null +++ b/tests/examples/overlay/meson.build @@ -0,0 +1,29 @@ +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 diff --git a/tests/examples/playback/meson.build b/tests/examples/playback/meson.build new file mode 100644 index 0000000000..93a401f6a8 --- /dev/null +++ b/tests/examples/playback/meson.build @@ -0,0 +1,13 @@ +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 diff --git a/tests/examples/playrec/meson.build b/tests/examples/playrec/meson.build new file mode 100644 index 0000000000..5db2bb6e05 --- /dev/null +++ b/tests/examples/playrec/meson.build @@ -0,0 +1,5 @@ +executable('playrec', 'playrec.c', + c_args : gst_plugins_base_args, + include_directories: [configinc, libsinc], + dependencies : [glib_deps, gst_dep], + install: false) diff --git a/tests/examples/seek/meson.build b/tests/examples/seek/meson.build new file mode 100644 index 0000000000..2aaab9c8df --- /dev/null +++ b/tests/examples/seek/meson.build @@ -0,0 +1,30 @@ +if gtk_x11_dep.found() + if cc.compiles(''' + #include + #include + 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) diff --git a/tests/examples/snapshot/meson.build b/tests/examples/snapshot/meson.build new file mode 100644 index 0000000000..296ca8f536 --- /dev/null +++ b/tests/examples/snapshot/meson.build @@ -0,0 +1,7 @@ +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 diff --git a/tests/meson.build b/tests/meson.build index 51e3cf1928..c44bfc8e2c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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')