live555 Source & Sink

Source & Sink
Source and Sink are two very important concepts in live555. The
source sending end, the starting point of the stream, can be intuitively understood as the producer, responsible for reading the information of the file or network stream. The
sink receiving end, the end of the stream, It can be understood as a consumer, literally translated as a sink. The
entire process of video and audio data from the source to the final save to a file or display is like a stream of water, flowing from the source, passing through the paths, and finally flowing into the sink.
Source & Sink

Source: RTP may read data from a file or camera device.
Sink: The data stream can eventually be saved in a file, or displayed on the screen.
MediaSession: Used to represent an RTP session, a MediaSession may contain multiple sub Session (MediaSubSession), the sub-session can be an audio sub-session, a video sub-session, etc.

Source and Sink are connected through RTP subsession (MediaSubSession).

MediaSource-The source of the stream
MediaSouce is the base class of all Sources .

Insert picture description here

MediaSource

Combined with the above figure, take H264 as an example:

Insert picture description here

H264VideoStreamFramer

H264VideoStreamFramer is the real Source, it is used to read data from H264 files and assemble them into frames.

MediaSink-the end of the stream
MediaSink is the base class of all sinks.

Insert picture description here

MediaSink

Combined with the above figure, take H264 as an example:

Insert picture description here

H264VideoFileSink class inheritance relationship

H264VideoFileSink is the real Sink, which saves the data to the file.

Insert picture description here

H264VideoRTPSink class inheritance relationship

H264VideoRTPSink is the real Sink, which completes the sending of data.

For H264 code stream, the flow direction of the data stream is:

服务器端:
H264VideoStreamFramer ->H264Or5Fragmenter (Filter)r->H264VideoRTPSink
客户端:
H264RTPSouce -> Sink

Author: FlyingPenguin
link: https://www.jianshu.com/p/0bdf07f7a5d5
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin blog.csdn.net/hyl999/article/details/109090221