Live555 code explanation 2: DESCRIBE request message processing process

Source: Internet
Author: User

After the RTSP server receives the DESCRIBE request from the client
URL (RTSP: // 192.168.1.109/1.mpg), find the corresponding streaming media resource, and return the Response Message. In live555
The servermediasession class is used to process the description in a session. It contains multiple (audio or video) sub-session descriptions (servermediasubsession ).


In the previous section, we talked about how the RTSP server received client connection requests and established the rtspclientsession class to process separate client sessions. When creating
During the rtspclientsession process, the newly established socket handle (clientsocket) and RTSP request processing function handle
Rtspclientsession: incomingrequesthandler is passed to the task scheduler, which is one-to-one association between the two. When the client sends
After the RTSP request is sent, the Select call in the master loop of the server returns the result. Locate the corresponding incomingrequesthandler Based on the socket handle and start message processing.
Parse the message first. If the request is describe, it enters the handleapps_describe function. According to the suffix of the client request URL (for example, 1.mpg ),
Call the member function dynamicrtspserver: lookupservermediasession to find the corresponding streaming media information.
Servermediasession. If servermediasession does not exist but the local 1. MPG file exists, create a new
Servermediasession. In the process of creating servermediasession, according to the file suffix. mpg, create a media MPEG-1or2 demultiplexing
(Mpeg1or2fileserverdemux ). Create a sub-session description by mpeg1or2fileserverdemux
Mpeg1or2demuxedservermediasubsession. Finally, servermediasession assembles the SDP message in the Response Message.
(For the SDP assembly process, see the description below), and then send the Response Message to the client to complete a message interaction.
SDP message assembly process:

Servermediasession is responsible for generating common session description information.
Mpeg1or2demuxedservermediasubsession
Raw. Mpeg1or2demuxedservermediasubsession
Ondemandservermediasubsession: generate the Session Description in sdplines. In the sdplines () implementation, create a virtual
(Dummy) framedsource (the specific implementation class is mpeg1or2audiostreamframer and
Mpeg1or2videostreamframer) and rtpsink (the specific implementation classes are mpeg1or2audiortpsink and
Mpeg1or2videortpsink), and finally call the setsdplinesfromrtpsink (...) member function to generate the sub-session description.

The classes and inheritance relationships involved above:

Medium <-servermediasession
Medium <-servermediasubsession <-ondemandservermediasubsession <-mpeg1or2demuxedservermediasubsession
Medium <-mediasource <-framedsouse <-framedfilesource <-bytestreamfilesource
Medium <-mediasource <-framedsouse <-mpeg1or2demuxedelementarystream
Medium <-mpeg1or2fileserverdemux
Medium <-mpeg1or2demux
Medium <-mediasource <-framedsouse <-mpeg1or2demuxedelementarystream
Medium <-mediasource <-framedsouse <-framedfilter <-mpegvideostreamframer <-mpeg1or2videostreamframer
Medium <-mediasink <-rtpsink <-multiframedrtpsink <-videortpsink <-mpeg1or2videortpsink

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.