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

Commits on Feb 13, 2024

  1. step 0: make room for the rebuilt implementation

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    fb51852 View commit details
    Browse the repository at this point in the history
  2. step 1: import example from Live555 library

    - that will be base of rtsp server
    - file originaly located in Live555 library source code at
    testProgs/testOnDemandRTSPServer.cpp
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    cac2c9a View commit details
    Browse the repository at this point in the history
  3. step 1: rename file and add UG copyright

    copyright notice was added from original
    file BasicRTSPOnlyServer.cpp
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    d36678f View commit details
    Browse the repository at this point in the history
  4. step 1: remove http(s) tunneling and TLS

    these features are not used needed by UltraGrid
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    3820168 View commit details
    Browse the repository at this point in the history
  5. step 1: drop unused media formats, keep MPEG-4

    MPEG-4 video is not deleted because it can serve as example of handling
    subsessions
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    ba1e3f4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e061430 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    93bb022 View commit details
    Browse the repository at this point in the history
  8. step 2: add rtsp server class, typedef to og name

    - basic structure for UltragridRTSPServer class
    - make copying not possible because server can't be copied
    - add typedef reference to name used in previous implementation
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    55a9f71 View commit details
    Browse the repository at this point in the history
  9. step 2: move initialization logic to constructor

    move inicialization logic from main() to constructor of new class
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    56af87b View commit details
    Browse the repository at this point in the history
  10. step 2: import announceURL function from Live555

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    91113c4 View commit details
    Browse the repository at this point in the history
  11. step 2: add announceURL to class

    move announceURL function to class so funcitonality is more clear
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    b3435b4 View commit details
    Browse the repository at this point in the history
  12. step 3: create base for media subsessions

    they will serve as container for various media transmitted by UG
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    cdc7d9f View commit details
    Browse the repository at this point in the history
  13. step 3: repsesent UG rtp payload as subsession

    - add basic structure for UltragridRTSPSubsessionCommon class
    - add typedef reference to name used in previous implementation
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    016f995 View commit details
    Browse the repository at this point in the history
  14. step 3: inherit Live555 subsession functionality

    - add definitions for all needed functions
    - ServerMediaSubsession is chosen because it is common ancestor in
    Live555's subsessions
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    558058d View commit details
    Browse the repository at this point in the history
  15. step 3: provide a mechanism to direct media stream

    function redirectStream changes destination adress and port
    in UG module sender
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    a4c52d7 View commit details
    Browse the repository at this point in the history
  16. step 3: implement RTSP playback control

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    11b3012 View commit details
    Browse the repository at this point in the history
  17. step 4: instantiate subsession for audio and video

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    22db40c View commit details
    Browse the repository at this point in the history
  18. step 4: specify modules for directing media stream

    - 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)
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    fd129c8 View commit details
    Browse the repository at this point in the history
  19. step 4: generate SDP description of media stream

    Generate description of provided media according to SDP protocol defined
    in RFC 8866 with modifications for RTSP protocol defined in RFC 2326
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    a0e319b View commit details
    Browse the repository at this point in the history
  20. step 5: add way to specify port for rtsp server

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    d044850 View commit details
    Browse the repository at this point in the history
  21. step 5: add supported media types, rename refs

    in previous version of rtsp_utils.h file the struct was named
    differently so all references have to be renamed
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    1daa3c4 View commit details
    Browse the repository at this point in the history
  22. step 5: instantiate subsessions for rtsp server

    replace MPEG-4 example with new subsessions made for UG
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    ec1b85a View commit details
    Browse the repository at this point in the history
  23. step 5: extract starting server from constructor

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    8489d12 View commit details
    Browse the repository at this point in the history
  24. step 6: add files to host rtsp server management

    they will be used by UG to interface with rtsp server
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    5f5662d View commit details
    Browse the repository at this point in the history
  25. step 6: class to manage rtsp server

    - basic structure of ultragrid_rtsp class
    - it provides control of rtsp server
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    0d146ff View commit details
    Browse the repository at this point in the history
  26. step 6: start and stop server thread

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    244370c View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    23665b1 View commit details
    Browse the repository at this point in the history
  28. step 7: remove Live555 library version check

    new implementation is built on version 2023.11.30 of Live555
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    b0743d3 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    e7e1c5d View commit details
    Browse the repository at this point in the history
  30. step 7: override number of channels for OPUS

    - OPUS does not support mono
    - RFC 7587 specifies that in SDP number of channels must be 2
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    c536024 View commit details
    Browse the repository at this point in the history
  31. step 7: remove unused parameter

    - 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
    jakub-kovac committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    f7c559d View commit details
    Browse the repository at this point in the history