-
Notifications
You must be signed in to change notification settings - Fork 53
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
jakub-kovac
wants to merge
31
commits into
CESNET:master
Choose a base branch
from
jakub-kovac:rtsp_server
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rewrite RTSP server #372
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- so that code can be established upon existing example in Live555. - Result will look simmilar to this, but will be rebuild as series of logical steps
- that will be base of rtsp server - file originaly located in Live555 library source code at testProgs/testOnDemandRTSPServer.cpp
copyright notice was added from original file BasicRTSPOnlyServer.cpp
these features are not used needed by UltraGrid
MPEG-4 video is not deleted because it can serve as example of handling subsessions
- basic structure for UltragridRTSPServer class - make copying not possible because server can't be copied - add typedef reference to name used in previous implementation
move inicialization logic from main() to constructor of new class
- copied announceURL function from Live555 library at testProgs/announceURL.cpp - copied becase is functional and searchable for future modifications - function handles displaying url, that server listens on, to comandline
move announceURL function to class so funcitonality is more clear
they will serve as container for various media transmitted by UG
- add basic structure for UltragridRTSPSubsessionCommon class - add typedef reference to name used in previous implementation
- add definitions for all needed functions - ServerMediaSubsession is chosen because it is common ancestor in Live555's subsessions
function redirectStream changes destination adress and port in UG module sender
- starts stream by changing destination adress and port to the ones got in function getStreamParameters - deletes stream by changing destination address and port to localhost
- inherits from UltragridRTSPSubsessionCommon because implementation of needed functions (by ServerMediaSubsession) is the same - exept for SDP Lines which are added later - Factory method (createNew) is used because Live555 library needs pointer to structure and all subsessions in Live555 library are created this way
- Tell UG what modules shoud be notified when changing direction of media stream - MODULE_CLASS_SENDER - controls video stream - MODULE_CLASS_AUDIO - controls audio stream - MODULE_CLASS_NONE - only used as stop (like \0 in string)
Generate description of provided media according to SDP protocol defined in RFC 8866 with modifications for RTSP protocol defined in RFC 2326
- if user don't specify port number default 8554 will be used - Live555 does not have mechanism to tell if port is already in use so user must specify available port
in previous version of rtsp_utils.h file the struct was named differently so all references have to be renamed
replace MPEG-4 example with new subsessions made for UG
- serverStopFlag if set to 0 server is running when set to 1 it stops - serverRunner built so it can be launched from pthread_create - destructor cleans memory
they will be used by UG to interface with rtsp server
- basic structure of ultragrid_rtsp class - it provides control of rtsp server
- new thread is created for rtsp server because control flow needs to be given to Live555 - server stops by setting server_stop_flag to 1 - char is used because it is needed by Live555 library - because rtsp server does not need to know about threads two 'runner' functions are used to separate server and threads
new implementation is built on version 2023.11.30 of Live555
- OPUS does not support mono - RFC 7587 specifies that in SDP number of channels must be 2
- in previous implementation parameter audio_bps was used in initialization of rtsp server but was not used internally - it is kept in the process of creating new implementaion (git commits) for reference with previous implementaion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous implementation of the RTSP server was unclear and difficult to fix, resulting in the last supported version of Live555 being from 2015.
This patchset rewrites the implementation to allow the use of the current version of Live555.
The interface with Ultragrid has been changed to a C++ class, with each instance serving as its own server. This is a change from the previous implementation where the rtsp_server struct was passed among methods.