1project('gst-plugins-bad', 'c', 2 version : '1.14.4', 3 license : 'LGPL', 4 meson_version : '>= 0.47', 5 default_options : [ 'warning_level=2', 6 'buildtype=debugoptimized' ]) 7 8gst_version = meson.project_version() 9version_arr = gst_version.split('.') 10gst_version_major = version_arr[0].to_int() 11gst_version_minor = version_arr[1].to_int() 12gst_version_micro = version_arr[2].to_int() 13 14glib_req = '>= 2.32' 15gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) 16 17api_version = '1.0' 18soversion = 0 19# maintaining compatibility with the previous libtool versioning 20# current = minor * 100 + micro 21libversion = '@0@.@1@.0'.format(soversion, gst_version_minor * 100 + gst_version_micro) 22 23plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir')) 24 25cc = meson.get_compiler('c') 26 27# Symbol visibility 28if cc.has_argument('-fvisibility=hidden') 29 add_project_arguments('-fvisibility=hidden', language: 'c') 30endif 31 32# Disable strict aliasing 33if cc.has_argument('-fno-strict-aliasing') 34 add_project_arguments('-fno-strict-aliasing', language: 'c') 35endif 36 37cast_checks = get_option('gobject-cast-checks') 38if cast_checks.disabled() or (cast_checks.auto()) 39 message('Disabling GLib cast checks') 40 add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c') 41endif 42 43glib_asserts = get_option('glib-asserts') 44if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev) 45 message('Disabling GLib asserts') 46 add_project_arguments('-DG_DISABLE_ASSERT', language: 'c') 47endif 48 49message('Disabling deprecated GLib API') 50add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c') 51 52add_project_arguments('-DUNUSED=__attribute__((unused))', language: 'c') 53 54cdata = configuration_data() 55 56cdata.set_quoted('VERSION', gst_version) 57cdata.set_quoted('PACKAGE', 'gst-rockchip') 58cdata.set_quoted('PACKAGE_VERSION', gst_version) 59cdata.set_quoted('PACKAGE_NAME', 'GStreamer Rockchip Plug-ins') 60cdata.set_quoted('GST_API_VERSION', api_version) 61cdata.set_quoted('GST_LICENSE', 'LGPL') 62cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) 63 64# GStreamer package name and origin url 65gst_package_name = get_option('package-name') 66if gst_package_name == '' 67 gst_package_name = 'GStreamer Rockchip Plug-ins' 68endif 69cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name) 70cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin')) 71 72# Mandatory GST deps 73gst_dep = dependency('gstreamer-1.0', version : gst_req, 74 fallback : ['gstreamer', 'gst_dep']) 75gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req, 76 fallback : ['gstreamer', 'gst_base_dep']) 77gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req, 78 fallback : ['gst-plugins-base', 'allocators_dep']) 79gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req, 80 fallback : ['gst-plugins-base', 'video_dep']) 81gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req, 82 fallback : ['gst-plugins-base', 'pbutils_dep']) 83 84glib_dep = dependency('glib-2.0', version : glib_req, 85 fallback : ['glib', 'libglib_dep']) 86x11_dep = dependency('x11', required : get_option('rkximage')) 87drm_dep = dependency('libdrm', required : get_option('rkximage')) 88mpp_dep = dependency('rockchip_mpp', required : get_option('rockchipmpp')) 89rga_dep = dependency('librga', required : get_option('rga')) 90 91if rga_dep.found() and not get_option('rga').disabled() 92 cdata.set10('HAVE_RGA', 1) 93endif 94 95if not get_option('vpxalphadec').auto() 96 vpxalphadec = get_option('vpxalphadec').enabled() 97else 98 # Both codecalphademux and alphacombine elements were added in 1.19 99 vpxalphadec = gst_dep.version().version_compare('>=1.19') 100endif 101 102if vpxalphadec 103 cdata.set10('USE_VPXALPHADEC', 1) 104endif 105 106if cc.has_header_symbol('gst/video/video-format.h', 'GST_VIDEO_FORMAT_NV12_10LE40', dependencies : gstvideo_dep) 107 cdata.set10('HAVE_NV12_10LE40', 1) 108endif 109 110if cc.has_header_symbol('gst/video/video-format.h', 'GST_VIDEO_FORMAT_NV16_10LE40', dependencies : gstvideo_dep) 111 cdata.set10('HAVE_NV16_10LE40', 1) 112endif 113 114gst_rockchip_args = ['-DHAVE_CONFIG_H'] 115configinc = include_directories('.') 116 117subdir('gst') 118 119configure_file(output : 'config.h', configuration : cdata) 120 121python = import('python').find_installation() 122run_command(python, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') 123