svtav1: Integrate into the build system properly

This commit is contained in:
Sebastian Dröge 2023-01-31 16:34:33 +02:00
parent b15efacf84
commit 7890a1f8c7
4 changed files with 19 additions and 65 deletions

View file

@ -59,6 +59,7 @@ subdir('soundtouch')
subdir('spandsp')
subdir('srt')
subdir('srtp')
subdir('svtav1')
subdir('svthevcenc')
subdir('teletextdec')
subdir('ttml')

View file

@ -19,6 +19,8 @@
* </refsect2>
*/
#include "config.h"
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoencoder.h>
@ -963,19 +965,6 @@ static gboolean plugin_init(GstPlugin *plugin) {
return gst_element_register(plugin, "svtav1enc", GST_RANK_SECONDARY, GST_TYPE_SVTAV1ENC);
}
#ifndef VERSION
#define VERSION "1.0"
#endif
#ifndef PACKAGE
#define PACKAGE "gstreamer-svt-av1"
#endif
#ifndef PACKAGE_NAME
#define PACKAGE_NAME "SVT-AV1 Encoder plugin for GStreamer"
#endif
#ifndef GST_PACKAGE_ORIGIN
#define GST_PACKAGE_ORIGIN "https://gitlab.com/AOMediaCodec"
#endif
GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, svtav1enc,
"Scalable Video Technology for AV1 Encoder (SVT-AV1 Encoder)", plugin_init,
GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, svtav1,
"Scalable Video Technology for AV1 (SVT-AV1)", plugin_init,
VERSION, "LGPL", PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View file

@ -1,54 +1,17 @@
# standalone plugin meson configuration
project('gst-svt-av1', 'c',
version : '0.1',
meson_version : '>= 0.29',
default_options : [ 'buildtype=debugoptimized' ])
# GStreamer dependencies
gst_req = '>= 1.16'
gst_dep = dependency('gstreamer-1.0', version : gst_req,
fallback : ['gstreamer', 'gst_dep'])
gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
fallback : ['gstreamer', 'gstbase_dep'])
gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
fallback : ['gstreamer', 'gstvideo_dep'])
plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
# common meson configuration
svtav1enc_dep = dependency('SvtAv1Enc')
cc = meson.get_compiler('c')
cc_flags = [
'-O2',
'-D_FORTIFY_SOURCE=2',
'-Wformat',
'-Wformat-security',
'-fPIE',
'-fPIC',
'-fstack-protector-strong',
svtav1_sources = [
'gstsvtav1enc.c',
]
foreach flag: cc_flags
if cc.has_argument(flag)
add_global_arguments(flag, language: 'c')
endif
endforeach
svtav1_dep = dependency('SvtAv1Enc', version : '>= 1.1', required: get_option('svtav1'))
ldflags = [
'-Wl,-z,now',
'-Wl,-z,relro',
'-Wl,-z,noexecstack',
]
foreach lflag : ldflags
add_global_link_arguments(lflag, language : 'c')
endforeach
if svtav1enc_dep.found()
gstsvtav1enc = library('gstsvtav1enc',
'gstsvtav1enc.c',
dependencies: [gstbase_dep, gstvideo_dep, svtav1enc_dep],
install: true,
install_dir: plugins_install_dir,
)
if svtav1_dep.found()
gstsvtav1 = library('gstsvtav1',
svtav1_sources,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, svtav1_dep],
install : true,
install_dir : plugins_install_dir,
)
plugins += [gstsvtav1]
endif

View file

@ -158,6 +158,7 @@ option('soundtouch', type : 'feature', value : 'auto', description : 'Audio pitc
option('spandsp', type : 'feature', value : 'auto', description : 'Packet loss concealment audio plugin')
option('srt', type : 'feature', value : 'auto', description : 'Secure, Reliable, Transport client/server network source/sink plugin')
option('srtp', type : 'feature', value : 'auto', description : 'Secure RTP codec plugin')
option('svtav1', type : 'feature', value : 'auto', description : 'Scalable Video Technology for AV1 plugin')
option('svthevcenc', type : 'feature', value : 'auto', description : 'Scalable Video Technology for HEVC encoder plugin')
option('teletext', type : 'feature', value : 'auto', description : 'Teletext plugin')
option('tinyalsa', type : 'feature', value : 'auto', description : 'TinyALSA plugin')