From ddcd7735b673a111bc73a3e58853a662d1e6c72e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 23 Mar 2017 02:48:10 +0530 Subject: [PATCH] meson: Build mpeg2enc and mplex when available --- ext/meson.build | 4 ++-- ext/mpeg2enc/meson.build | 19 +++++++++++++++++++ ext/mplex/meson.build | 18 ++++++++++++++++++ meson.build | 12 ++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 ext/mpeg2enc/meson.build create mode 100644 ext/mplex/meson.build diff --git a/ext/meson.build b/ext/meson.build index 0eba7b4..eba12d7 100644 --- a/ext/meson.build +++ b/ext/meson.build @@ -26,8 +26,8 @@ subdir('libde265') subdir('libmms') #subdir('lv2') #subdir('modplug') -#subdir('mpeg2enc') -#subdir('mplex') +subdir('mpeg2enc') +subdir('mplex') #subdir('musepack') #subdir('neon') #subdir('ofa') diff --git a/ext/mpeg2enc/meson.build b/ext/mpeg2enc/meson.build new file mode 100644 index 0000000..670015b --- /dev/null +++ b/ext/mpeg2enc/meson.build @@ -0,0 +1,19 @@ +if mjpegtools_dep.found() + mpeg2enc_dep = cxx.find_library('mpeg2encpp', required : false) + + if mpeg2enc_dep.found() + gstmpeg2enc = library('gstmpeg2enc', + 'gstmpeg2enc.cc', + 'gstmpeg2encoptions.cc', + 'gstmpeg2encoder.cc', + 'gstmpeg2encstreamwriter.cc', + 'gstmpeg2encpicturereader.cc', + cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api], + link_args : noseh_link_args, + include_directories : [configinc], + dependencies : [gstvideo_dep, mjpegtools_dep, mpeg2enc_dep], + install : true, + install_dir : plugins_install_dir, + ) + endif +endif diff --git a/ext/mplex/meson.build b/ext/mplex/meson.build new file mode 100644 index 0000000..ee949e4 --- /dev/null +++ b/ext/mplex/meson.build @@ -0,0 +1,18 @@ +if mjpegtools_dep.found() + mplex2_dep = cxx.find_library('mplex2', required : false) + + if mplex2_dep.found() + gstmplex2 = library('gstmplex2', + 'gstmplex.cc', + 'gstmplexibitstream.cc', + 'gstmplexjob.cc', + 'gstmplexoutputstream.cc', + cpp_args : gst_plugins_bad_args + ['-DGST_MJPEGTOOLS_API=' + mjpegtools_api], + link_args : noseh_link_args, + include_directories : [configinc], + dependencies : [gstaudio_dep, mjpegtools_dep, mplex2_dep], + install : true, + install_dir : plugins_install_dir, + ) + endif +endif diff --git a/meson.build b/meson.build index be96e8d..a3161a1 100644 --- a/meson.build +++ b/meson.build @@ -302,9 +302,21 @@ glib_dep = dependency('glib-2.0', version : glib_req) gio_dep = dependency('gio-2.0', version : glib_req) gmodule_dep = dependency('gmodule-2.0', version : glib_req) x11_dep = dependency('x11', required : false) + # Used by dtls and hls openssl_dep = dependency('openssl', version : '>= 1.0.1', required : false) +# Used by mpeg2enc and mplex +# mjpegtools upstream breaks API constantly and doesn't export the version in +# a header anywhere. The configure file has a lot of logic to support old +# versions, but it all seems untested and broken. Require 2.0.0. Can be changed +# if someone complains. +mjpegtools_dep = dependency('mjpegtools', version : '>=2.0.0', required : false) +mjpegtools_api = '0' +if mjpegtools_dep.found() + mjpegtools_api = '20000' +endif + if x11_dep.found() cdata.set('HAVE_X11', 1) endif -- 2.7.4