Mediastreamer2 is a powerful and lightweighted streaming engine specialized for voice/video telephony applications.
It is the library that is responsible for all the receiving and sending of multimedia streams in linphone, including voice/video capture, encoding and decoding, and rendering.
Mediastreamer2 can be extended with dynamic plugins, currently a H264 and an ILBC codec plugins are available.
Each processing entity is contained within a MSFilter object. MSFilter(s) have inputs and/or outputs that can be used to connect from and to other MSFilters.
A trivial example to understand:
MSFilters can be connected together to become filter chain. If we assemble the three above examples, we obtain a processing chain that receives RTP packet, decode them and write the uncompressed result into a wav file.
The execution of the media processing work is scheduled by a MSTicker object, a thread that wakes up every 10 ms to process data in all the MSFilter chains it manages. Several MSTicker can be used simultaneously, for example one for audio filters, one for video filters, or one on each processor of the machine where it runs.
If your intent is simply to create audio and video streams, a simple API is defined in audiostream.h and videostream.h to create audio and video stream.
It can be as simple as:
AudioStream *as=audio_stream_start(.../*list of parameters*/);sleep(10);
audio_stream_stop(as);
If your intent is to add new functionalities to mediastreamer2, you'll be glad to know that implementing a mediastreamer2 filter is very straightforward: no complex declarations, inheritance or such like this.
As an example, have a look at this: it is the 'MSVolume' MSFilter, whose goal is to measure and control loudness of an audio stream.
Thanks to this lightweighted framework, developers can concentrate on what matters: the implementation of the algorithm !
Mediastreamer2 is documented using doxygen. You can browse the API documention here.
Mediastreamer2 is part of linphone releases.
You can also use git to retrieve the lastest source code (recommended for developers):
git clone git://git.linphone.org/mediastreamer2.git
Mediastreamer2 is licensed under GPL.
Proprietary licenses can be ordered from Belledonne Communications.
Please contact
Belledonne Communications.