Make srtp2 only a dependency for MistOutWebRTC

Change-Id: I52316bbceef463844e8f8cb1ef85277c4b886814
This commit is contained in:
Thulinma 2023-01-02 14:44:52 +01:00
parent 00833223e1
commit aa614aebab
7 changed files with 18 additions and 11 deletions

View file

@ -212,7 +212,6 @@ set(libHeaders
lib/sdp_media.h lib/sdp_media.h
lib/shared_memory.h lib/shared_memory.h
lib/socket.h lib/socket.h
lib/srtp.h
lib/stream.h lib/stream.h
lib/stun.h lib/stun.h
lib/theora.h lib/theora.h
@ -279,7 +278,6 @@ add_library (mist
lib/sdp_media.cpp lib/sdp_media.cpp
lib/shared_memory.cpp lib/shared_memory.cpp
lib/socket.cpp lib/socket.cpp
lib/srtp.cpp
lib/stream.cpp lib/stream.cpp
lib/stun.cpp lib/stun.cpp
lib/theora.cpp lib/theora.cpp
@ -306,7 +304,7 @@ target_link_libraries(mist
${LIBRT} ${LIBRT}
) )
if (NOT NOSSL) if (NOT NOSSL)
target_link_libraries(mist mbedtls mbedx509 mbedcrypto srtp2) target_link_libraries(mist mbedtls mbedx509 mbedcrypto)
endif() endif()
install( install(
FILES ${libHeaders} FILES ${libHeaders}
@ -514,6 +512,9 @@ macro(makeOutput outputName format)
if (";${ARGN};" MATCHES ";jpg;") if (";${ARGN};" MATCHES ";jpg;")
SET(tsOutput generated/noffmpeg.h generated/noh264.h) SET(tsOutput generated/noffmpeg.h generated/noh264.h)
endif() endif()
if (";${ARGN};" MATCHES ";srtp;")
SET(tsOutput src/output/output_webrtc_srtp.h src/output/output_webrtc_srtp.cpp)
endif()
add_executable(MistOut${outputName} add_executable(MistOut${outputName}
${outBaseFile} ${outBaseFile}
src/output/output.cpp src/output/output.cpp
@ -533,6 +534,9 @@ macro(makeOutput outputName format)
if (";${ARGN};" MATCHES ";with_rist;") if (";${ARGN};" MATCHES ";with_rist;")
target_link_libraries(MistOut${outputName} rist cjson) target_link_libraries(MistOut${outputName} rist cjson)
endif() endif()
if (";${ARGN};" MATCHES ";srtp;")
target_link_libraries(MistOut${outputName} srtp2)
endif()
target_link_libraries(MistOut${outputName} mist ) target_link_libraries(MistOut${outputName} mist )
install( install(
TARGETS MistOut${outputName} TARGETS MistOut${outputName}
@ -619,7 +623,7 @@ target_link_libraries(MistProcLivepeer mist)
if (NOT NOSSL) if (NOT NOSSL)
makeOutput(HTTPS https)#LTS makeOutput(HTTPS https)#LTS
makeOutput(WebRTC webrtc http)#LTS makeOutput(WebRTC webrtc http srtp)#LTS
endif() endif()
option(WITH_SANITY "Enable MistOutSanityCheck output for testing purposes") option(WITH_SANITY "Enable MistOutSanityCheck output for testing purposes")

View file

@ -40,7 +40,6 @@ headers = [
'sdp_media.h', 'sdp_media.h',
'shared_memory.h', 'shared_memory.h',
'socket.h', 'socket.h',
'srtp.h',
'stream.h', 'stream.h',
'stun.h', 'stun.h',
'theora.h', 'theora.h',
@ -69,7 +68,7 @@ install_headers(headers, subdir: 'mist')
extra_code = [] extra_code = []
if usessl if usessl
extra_code += ['dtls_srtp_handshake.cpp', 'stun.cpp', 'certificate.cpp', 'encryption.cpp', 'srtp.cpp',] extra_code += ['dtls_srtp_handshake.cpp', 'stun.cpp', 'certificate.cpp', 'encryption.cpp',]
endif endif
libmist = library('mist', libmist = library('mist',

View file

@ -120,7 +120,7 @@ if usessl
endif endif
srtp2 = dependency('libsrtp2', fallback : ['libsrtp2', 'libsrtp2_dep']) srtp2 = dependency('libsrtp2', fallback : ['libsrtp2', 'libsrtp2_dep'])
ssl_deps = [mbedtls, mbedx509, mbedcrypto, srtp2] ssl_deps = [mbedtls, mbedx509, mbedcrypto]
endif endif
libsrt = false libsrt = false

View file

@ -24,7 +24,7 @@ outputs = [
if usessl if usessl
outputs += [ outputs += [
{'name' : 'HTTPS', 'format' : 'https'}, {'name' : 'HTTPS', 'format' : 'https'},
{'name' : 'WebRTC', 'format' : 'webrtc', 'extra': ['http','jpg']} {'name' : 'WebRTC', 'format' : 'webrtc', 'extra': ['http','jpg','srtp']}
] ]
endif endif
@ -89,6 +89,10 @@ foreach output : outputs
link_libs += libmist_srt link_libs += libmist_srt
deps += libsrt deps += libsrt
endif endif
if extra.contains('srtp')
deps += srtp2
sources += files('output_webrtc_srtp.cpp', 'output_webrtc_srtp.h')
endif
else else
sources += base sources += base
endif endif

View file

@ -63,11 +63,11 @@
#include <mist/rtp_fec.h> #include <mist/rtp_fec.h>
#include <mist/sdp_media.h> #include <mist/sdp_media.h>
#include <mist/socket.h> #include <mist/socket.h>
#include <mist/srtp.h>
#include <mist/stun.h> #include <mist/stun.h>
#include <mist/tinythread.h> #include <mist/tinythread.h>
#include <mist/websocket.h> #include <mist/websocket.h>
#include <fstream> #include <fstream>
#include "output_webrtc_srtp.h"
#define NACK_BUFFER_SIZE 1024 #define NACK_BUFFER_SIZE 1024

View file

@ -1,5 +1,5 @@
#include "defines.h" #include <mist/defines.h>
#include "srtp.h" #include "output_webrtc_srtp.h"
#include <algorithm> #include <algorithm>
#include <string.h> #include <string.h>