gstreamer/ext/srtp/meson.build
Jan Alexander Steffens (heftig) e9aa117200 srtp: Support libsrtp2
For libsrtp 1, add defines that translate the new namespaced identifiers
to the old unnamespaced ones. Also move the code for setting and getting
a stream's ROC into two compat functions that match libsrtp2's API.

It seems that libsrtp2 properly supports changing the ROC without having
to touch the sequence numbers afterwards, given that srtp_set_stream_roc
sets a pending_roc field, so the entire roc_changed dance should not be
needed anymore. The compat functions for libsrtp 1 just contain our
preexisting hacks, however, so it's still needed there.

libsrtp2 has no means of discovering the streams in the session, so to
create the stats structure we need to iterate over our own set of SSRCs.
For this we also need to re-add the previously removed ssrcs_set to the
encoder.

https://bugzilla.gnome.org/show_bug.cgi?id=776901
2018-01-29 09:58:11 +02:00

41 lines
1.2 KiB
Meson

srtp_sources = [
'gstsrtp.c',
'gstsrtpdec.c',
'gstsrtpenc.c',
]
srtp_cargs = []
srtp_dep = dependency('libsrtp2', version : '>= 2.1.0', required : false)
if srtp_dep.found()
srtp_cargs += ['-DHAVE_SRTP2']
else
srtp_dep = dependency('libsrtp', required : false)
if not srtp_dep.found() and cc.has_header_symbol('srtp/srtp.h', 'srtp_init')
srtp_dep = cc.find_library('srtp', required : false)
endif
endif
if srtp_dep.found()
mkenums = find_program('srtp_mkenum.py')
gstsrtp_h = custom_target('gstsrtpenum_h',
output : 'gstsrtp-enumtypes.h',
input : 'gstsrtpenums.h',
command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
gstsrtp_c = custom_target('gstsrtpenum_c',
output : 'gstsrtp-enumtypes.c',
input : 'gstsrtpenums.h',
depends : [gstsrtp_h],
command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
gstsrtp = library('gstsrtp',
srtp_sources, gstsrtp_c, gstsrtp_h,
c_args : gst_plugins_bad_args + srtp_cargs,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstrtp_dep, gstvideo_dep, srtp_dep],
install : true,
install_dir : plugins_install_dir,
)
endif