Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite RTSP server #372

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fb51852
step 0: make room for the rebuilt implementation
jakub-kovac Oct 8, 2023
cac2c9a
step 1: import example from Live555 library
jakub-kovac Oct 8, 2023
d36678f
step 1: rename file and add UG copyright
jakub-kovac Oct 8, 2023
3820168
step 1: remove http(s) tunneling and TLS
jakub-kovac Oct 8, 2023
ba1e3f4
step 1: drop unused media formats, keep MPEG-4
jakub-kovac Oct 8, 2023
e061430
step 1: reformat to reflect UG indentation
jakub-kovac Oct 8, 2023
93bb022
step 2: add file to host rtsp server class
jakub-kovac Oct 8, 2023
55a9f71
step 2: add rtsp server class, typedef to og name
jakub-kovac Oct 8, 2023
56af87b
step 2: move initialization logic to constructor
jakub-kovac Oct 8, 2023
91113c4
step 2: import announceURL function from Live555
jakub-kovac Oct 8, 2023
b3435b4
step 2: add announceURL to class
jakub-kovac Oct 8, 2023
cdc7d9f
step 3: create base for media subsessions
jakub-kovac Oct 8, 2023
016f995
step 3: repsesent UG rtp payload as subsession
jakub-kovac Oct 8, 2023
558058d
step 3: inherit Live555 subsession functionality
jakub-kovac Oct 8, 2023
a4c52d7
step 3: provide a mechanism to direct media stream
jakub-kovac Oct 8, 2023
11b3012
step 3: implement RTSP playback control
jakub-kovac Oct 8, 2023
22db40c
step 4: instantiate subsession for audio and video
jakub-kovac Oct 14, 2023
fd129c8
step 4: specify modules for directing media stream
jakub-kovac Oct 14, 2023
a0e319b
step 4: generate SDP description of media stream
jakub-kovac Oct 14, 2023
d044850
step 5: add way to specify port for rtsp server
jakub-kovac Oct 14, 2023
1daa3c4
step 5: add supported media types, rename refs
jakub-kovac Oct 15, 2023
ec1b85a
step 5: instantiate subsessions for rtsp server
jakub-kovac Oct 15, 2023
8489d12
step 5: extract starting server from constructor
jakub-kovac Oct 15, 2023
5f5662d
step 6: add files to host rtsp server management
jakub-kovac Oct 15, 2023
0d146ff
step 6: class to manage rtsp server
jakub-kovac Oct 15, 2023
244370c
step 6: start and stop server thread
jakub-kovac Oct 15, 2023
23665b1
step 7: redirect configure to new implementation
jakub-kovac Oct 15, 2023
b0743d3
step 7: remove Live555 library version check
jakub-kovac Dec 16, 2023
e7e1c5d
step 7: modify h264 rxtx to reflect changes in rtsp server
jakub-kovac Oct 15, 2023
c536024
step 7: override number of channels for OPUS
jakub-kovac Dec 16, 2023
f7c559d
step 7: remove unused parameter
jakub-kovac Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,7 @@ livemedia=no
livemedia_prefix=/usr

AC_ARG_ENABLE(rtsp_server,
[ --enable-rtsp-server enables RTSP server support (default is auto)]
[ Requires: live555 (<= 2015)],
[ --enable-rtsp-server enables RTSP server support (default is auto)],
[rtsp_server_req=$enableval],
[rtsp_server_req=$build_default]
)
Expand All @@ -1411,13 +1410,8 @@ if test $rtsp_server_req != no; then
CPPFLAGS="$CPPFLAGS $RTSP_SERVER_FLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <liveMedia.hh>
#include <liveMedia_version.hh>
]], [[
#if LIVEMEDIA_LIBRARY_VERSION_INT > 1438905600
#error "Unsuppored live555 version (too new)"
#endif
]]
)], FOUND_LIVE_H=yes, [echo "liveMedia (live555 library) headers not found or wrong version (< 2015 needed)"; FOUND_LIVE_H=no])
]]
)], FOUND_LIVE_H=yes, [echo "liveMedia (live555 library) headers not found"; FOUND_LIVE_H=no])
CPPFLAGS=$SAVED_CPPFLAGS
AC_LANG_POP(C++)
if test $FOUND_LIVE_H = yes
Expand All @@ -1426,7 +1420,7 @@ if test $rtsp_server_req != no; then
CFLAGS="$CFLAGS $RTSP_SERVER_FLAGS"
CXXFLAGS="$CXXFLAGS $RTSP_SERVER_FLAGS"
RTSP_SERVER_LIBS="-lliveMedia -lBasicUsageEnvironment -lUsageEnvironment -lgroupsock"
RTSP_SERVER_OBJ="src/rtsp/c_basicRTSPOnlyServer.o src/rtsp/BasicRTSPOnlyServer.o src/rtsp/BasicRTSPOnlySubsession.o src/video_rxtx/h264_rtp.o"
RTSP_SERVER_OBJ="src/rtsp/ultragrid_rtsp.o src/rtsp/UltragridRTSPServer.o src/rtsp/UltragridRTSPSubsession.o src/video_rxtx/h264_rtp.o"
add_module video_rxtx_h264 "$RTSP_SERVER_OBJ" "$RTSP_SERVER_LIBS"
rtsp_server=yes
livemedia=yes
Expand Down
20 changes: 13 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,22 +1474,28 @@ int main(int argc, char *argv[])
params["audio_codec"].l = ac_params.codec;
params["audio_sample_rate"].i =
IF_NOT_NULL_ELSE(ac_params.sample_rate, kHz48);
params["audio_channels"].i = audio_capture_channels;
params["audio_bps"].i = 2;
params["a_rx_port"].i = opt.audio.recv_port;
params["a_tx_port"].i = opt.audio.send_port;

// override number of channels for OPUS as OPUS does not support mono
if (ac_params.codec == AC_OPUS) {
params["audio_channels"].i = 2;
} else {
params["audio_channels"].i = audio_capture_channels;
}

if (strcmp(opt.video_protocol, "rtsp") == 0) {
rtps_types_t avType;
if(strcmp("none", vidcap_params_get_driver(opt.vidcap_params_head)) != 0 && (strcmp("none",opt.audio.send_cfg) != 0)) avType = av; //AVStream
else if((strcmp("none",opt.audio.send_cfg) != 0)) avType = audio; //AStream
else if(strcmp("none", vidcap_params_get_driver(opt.vidcap_params_head))) avType = video; //VStream
rtsp_media_type_t media_type;
if(strcmp("none", vidcap_params_get_driver(opt.vidcap_params_head)) != 0 && (strcmp("none",opt.audio.send_cfg) != 0)) media_type = av; //AVStream
else if((strcmp("none",opt.audio.send_cfg) != 0)) media_type = audio; //AStream
else if(strcmp("none", vidcap_params_get_driver(opt.vidcap_params_head))) media_type = video; //VStream
else {
printf("[RTSP SERVER CHECK] no stream type... check capture devices input...\n");
avType = none;
media_type = none;
}

params["avType"].l = (long) avType;
params["media_type"].l = (long) media_type;
}

sdp_set_properties(opt.requested_receiver, opt.video_rxtx_mode & MODE_SENDER && strcasecmp(opt.video_protocol, "sdp") == 0, opt.audio.send_port != 0 && strcasecmp(opt.audio.proto, "sdp") == 0);
Expand Down
162 changes: 0 additions & 162 deletions src/rtsp/BasicRTSPOnlyServer.cpp

This file was deleted.

Loading