Live555 library structure and its core concepts

Live555 library structure and its core concepts

Core idea:

  1. Session: Session is one of the core concepts in LIVE555 and represents the abstraction of a media stream. A session can contain one or more media subsessions, each subsession representing a portion of a media stream, such as audio or video. A session can be published and managed by a media server (such as an RTSP server).

  2. Media Subsession: A media subsession is part of a session and represents a specific media stream, such as an audio or video stream. Each media subsession contains information related to a specific media stream, such as transmission protocol, port number, encoding format, etc.

  3. Session Manager: A session manager is an object used to create, manage, and control sessions. It allows you to add, delete and configure sessions, as well as assign unique session identifiers to sessions.

  4. Task Scheduler: The task scheduler is one of the core components of the LIVE555 library and is used to manage the execution of different tasks. It is responsible for scheduling, queuing and executing tasks, including the sending and receiving of media data, and the processing of scheduled tasks.

  5. RTP (Real-time Transport Protocol): RTP is a protocol for transmitting audio and video data in real time. LIVE555 provides an implementation of the RTP protocol, allowing you to easily send and receive RTP packets.

  6. RTCP (RTP Control Protocol): RTCP is the control protocol of RTP and is used to monitor and manage RTP streams. The LIVE555 library includes an implementation of the RTCP protocol to support quality control and synchronization of streaming media.

  7. RTSP (Real-Time Streaming Protocol): RTSP is a protocol used for streaming media control and session management. The LIVE555 library provides an RTSP server and client implementation, allowing you to create and manage live streaming sessions.

Library structure:

The structure of the LIVE555 library includes the following key components:

UsageEnvironmen

Used to dispatch deferred events, assign handlers for asynchronous read events, and output error/warning messages. Additionally, the "HashTable" class defines an interface to a generic hash table for use by the rest of the code. These are abstract base classes; they must be subclassed to be used in an implementation. These subclasses can take advantage of specific properties of the program's running environment - for example, its GUI and/or scripting environment.

UsageEnvironmen

  • COPYING and COPYING.LESSER : Symbolic links to the license file, pointing to the license file in the root directory.
  • HashTable.cpp : Contains the implementation of the hash table.
  • include : Contains header files that define the interface of environment components using the Live555 library.
  • Makefile, Makefile.head and Makefile.tail : Makefiles used to build environment components.
  • strDup.cpp : Contains code related to string copying.
  • UsageEnvironment.cpp : Contains the implementation of the environment component using the Live555 library.

Groupsock

The classes in this library encapsulate network interfaces and sockets. In particular, the " Groupsock " class encapsulates a socket for sending (and/or receiving) multicast datagrams.

  • GroupEId.cpp : Implements the management of multicast addresses.
  • Groupsock.cpp : Contains the implementation of multicast group sockets.
  • GroupsockHelper.cpp : Contains the implementation of multicast group socket helper functions.
  • include : Contains header files used to declare the interfaces of multicast group-related components.
  • inet.c : Contains C language code related to network addresses.
  • IOHandlers.cpp : Implements input/output handlers.
  • Makefile, Makefile.head and Makefile.tail : Makefile used to build groupsock components.

liveMedia

This library defines a class hierarchy - rooted in the "Medium" class - for various streaming types and codecs.

  • AudioInputDevice.cpp : Handles functions related to audio input devices.
  • RTPSink.cpp and RTPSource.cpp : implement the sending and receiving of RTP data packets.
  • RTSPServer.cpp and other files: Implement RTSP server related functions.
  • H264VideoFileSink.cpp and other files: Handle H.264 video related functions.
  • MPEG1or2AudioRTPSink.cpp and other files: Handle RTP sending of MPEG1/2 audio data.
  • MP3FileSource.cpp and other files: Handle functions related to MP3 audio files.
  • VP8VideoRTPSink.cpp and other files: Handle VP8 video related RTP sending.
  • include : Contains a large number of header files that declare interfaces for various media types, protocols and functions.
  • Makefile, Makefile.head and Makefile.tail : Makefile used to build the liveMedia component.

BasicUsageEnvironment

This library defines a concrete implementation (i.e. subclass) of the "UsageEnvironment" class for use in simple console applications. Read events and delayed operations are handled using select() loops.

BasicUsageEnvironment : This is a folder that contains files related to the basic usage environment components of the Live555 library.

  • BasicHashTable.cpp : implements a basic hash table data structure.
  • BasicTaskScheduler0.cpp and BasicTaskScheduler.cpp : implement task scheduler related functions.
  • BasicUsageEnvironment0.cpp and BasicUsageEnvironment.cpp : Contains implementation code for basic usage environment.
  • COPYING and COPYING.LESSER : These two files are symbolic links to the license file, pointing to the license file in the upper directory.
  • DelayQueue.cpp : Contains the implementation of delay queue.
  • include : This is a folder that contains header files (.hh files) used to declare the interfaces of various BasicUsageEnvironment components.
  • Makefile, Makefile.head and Makefile.tail : These are the Makefile files used to build the BasicUsageEnvironment component.

testProgs

This directory implements some simple programs that use "BasicUsageEnvironment" to demonstrate how to develop applications using these libraries

RTSP client

testRTSPClient is a command-line program that shows you how to open and receive a media stream specified by an RTSP URL - that is, a URL that begins with RTSP://l. In this demo application, no processing is done to the received audio/video data. However, you can use and adapt this code in your own applications, such as decoding and playing back the received data.

openRTSP is similar to "testRTSPClient", but has more features. It is a command line program, and unlike "testRTSPClient" it is intended to be used as a complete, fully functional application (as opposed to using its code in other applications). For more information about "openRTSP" - including its many command line options please see the online documentation.

RTSP server

testOnDemandRTSPServer creates an RTSP server that can stream on-demand from various types of media files via RTP unicast. (Supported media types include: MPEG-1 or 2 audio or video (elementary stream), including MP3 audio; MPEG-4 video (elementary stream); H.264 video (elementary stream); H.265 video (elementary stream) ; MPEG programs or transport streams, including VOB files; DV video; AMR audio; WAV (PCM) audio. The server can also stream from Matroska or WebM files (by demultiplexing and streaming the files within the track). MPEG transport streams are also Can be streamed over raw UDP if desired - for example, via a set-top box. o This server application also demonstrates how to deliver an MPEG transport stream over RTSP as a UDP (raw-UDP or RTP/UDP) multicast or unicast stream arrives at the server. In particular, by default it is set up to accept input from the "testMPEG2TransportStreamer" demo application.

RTSP server

playSIP is a command line program (similar to "openRTSP") that invokes a SIP session (using a SIP: URL) and then (optionally) records the incoming media stream to a file.

MP3 audio test programs

Repeatedly reads an MP3 audio file (named "test.mp3") and streams it using RTP to multicast group 239.255.42.42, port 6666 (RTCP uses port 6667). This program also has an (optional) built-in RTSP server. testMP3Receiver does the opposite: it reads the MP3/RTP stream (from the same multicast group/port) and outputs the reassembled MP3 stream to "stdout". It also sends RTCP reception reports.

WindowsAudiolnputDevice

This is an implementation of the "AudiolnputDevice" abstract class of the "liveMedia" library. This can be used by Windows applications to read PCM audio samples from the input device. (This project builds two libraries: "libWindowsAudiolnputDevice_mixer.libWindowsAudiolnputDevice_noMixer.lib", which uses Windows' built-in mixer, and "libWindowsAudiolnputDevice_noMixer.lib".

mediaServer

Media servers

  • COPYING and COPYING.LESSER : Symbolic links to the license file, pointing to the license file in the root directory.
  • DynamicRTSPServer.cpp and DynamicRTSPServer.hh : May contain the implementation of the dynamic RTSP (Real-Time Streaming Protocol) server.
  • live555MediaServer.cpp : Contains the implementation of Live555 media server.
  • Makefile, Makefile.head and Makefile.tail : Makefile used to build the media server.
  • test.mp4 : An MP4 format media file for testing.
  • version.hh : Header file containing version information.

proxyServer/:

proxy server

  • COPYING and COPYING.LESSER : Symbolic links to the license file, pointing to the license file in the root directory.
  • live555ProxyServer.cpp : Contains the implementation of Live555 proxy server.
  • Makefile, Makefile.head and Makefile.tail : Makefile used to build the proxy server.
  • test.mp4 : An MP4 format media file for testing.

hlsProxy/

This directory contains an HLS proxy server implementation.

  • live555HLSProxy.cpp : Contains the implementation of HLS proxy server.
  • Makefile, Makefile.head and Makefile.tail : Makefile used to build the HLS proxy server.

おすすめ

転載: blog.csdn.net/qq_45865950/article/details/132765543