Recently, due to project development needs, began to learn the open source project live555, in particular, some of the individual learning experience to do a record, if the understanding is not correct, welcome friends point out.
The first is the source of the download, which can be downloaded from the http://www.live555.com, while the above also provides the relevant documents, although the document is more coarse, but it is better than to find any document description strong. Of course, I am in the process of learning, but also from the Internet to find a period of time, the harvest or a little, among them, such as: RTSP server instance live555 source code analysis, live555 source code Introduction, live555 code Interpretation series, Based on LIVE555 's rtp-rtcp research and other articles.
My study is in the VS2008 environment, to be able to run smoothly in the VS environment, but also to do related work. Live open source is written in C + +, code style is very good, but it is done with the makefile file, and I have not touched the makefile file is a problem. Fortunately, on the Internet accidentally found an article about compiling live in the VC6 environment, and then according to the above said, bumps, compiled successfully four libraries and transferred to the VS2008 environment. More fortunate is also accidentally found on the Internet an introduction with VS2008 compiled live articles and provide a compiled project download, download, and then began a relatively long learning process.
From the structure of the program, the live project consists of four basic libraries, a Program entry class (in MediaServer), and some test code (in Testprogs). Four basic libraries are usageenvironment, basicusageenvironment, Groupsock, and Livemedia.
Usageenvironment includes abstract class Usageenvironment and abstract class TaskScheduler, which are used for event scheduling, including asynchronous reading of events, setting of event handles, and output of error messages. The library also has a Hashtable, which is a generic hashtable that can be used throughout the project, and of course the Hashtable is an abstract class.
The classes in Basicusageenvironment are primarily implementations of the corresponding classes in the usageenvironment.
Groupsock, as the name implies, is used for packet reception and delivery, which supports both multicasting and unicast. The Groupsock library includes classes such as Groupeid, Groupsock, Groupsockhelper, Netaddress, NetInterface, where the Groupsock class has two constructors and one is "for a Source-independent multicast Group ", the other is" for a source-specific multicast group ", while the Groupsockhelper class is primarily used to read and write sockets.
Livemedia is an important library that contains not only classes that implement RTSP server, but also classes that encode different types of streaming media, such as TS streams, PS streams, and so on. In this library, the base class is medium, and the hierarchical relationship is very clear. In this library, there are several very important classes, such as Rtspserver, Servermediasession, Rtpsink, Rtpinterface, Framedsource, and so on.
The issue of penetrating the firewall is mentioned in the related documentation on http://www.live555.com, by opening an HTTP tunnel, and then we can find a Rtspoverhttpserver class in the Livemedia library that solves the problem.
MediaServer Live555mediaserver provides the main function, Dynamicrtspserver inherits Rtspserver and writes out the virtual function lookupservermediasession.
The program structure of the whole project is generally the case, and as for some of the specific implementation details, further study is needed.