PJMEDIA and PJMEDIA-CODEC Examples
Please find below some PJMEDIA related examples that may help in giving some more info:
- Samples: Reading from WAV File
This is a good place to start learning about Media Ports Framework, as it shows that Media Ports Framework are only "passive" objects with get_frame()
and put_frame()
interface, and someone has to call these to retrieve/store media frames.
- Samples: Playing WAV File to Sound Device
This example shows that when application connects a media port (in this case a WAV File Player) to Sound Device Port, media will flow automatically since the Sound Device Port provides Clock/Timing.
- Samples: Capturing Audio to WAV File
Demonstrates how to capture audio from microphone to WAV file.
- Samples: Using Custom Ports (Sine Wave Generator)
Demonstrates how to create a custom Media Ports Framework (in this case a sine wave generator) and integrate it to PJMEDIA.
- Samples: Using Conference Bridge
This demonstrates how to use the Conference Bridge. The sample program can open multiple WAV files, and instruct the conference bridge to mix the signal before playing it to the sound device.
- Samples: Benchmarking Conference Bridge
I use this to benchmark/optimize the conference bridge algorithm, but readers may find the source useful.
- Samples: Using Resample Port
Demonstrates how to use Resample Port to change the sampling rate of a media port (in this case, a WAV File Player).
- page_pjmedia_samples_sndtest_c
This program performs some tests to the sound device to get some quality parameters (such as sound jitter and clock drifts).
Screenshots on WinXP:
sndtest screenshot on WinXP
- Samples: Remote Streaming
This example mainly demonstrates how to stream media (in this case a WAV File Player) to remote peer using RTP.
- Samples: Using SIP and Custom RTP/RTCP to Monitor Quality
This is a useful program (integrated with PJSIP) to actively measure the network quality/impairment parameters by making one or more SIP calls (or receiving one or more SIP calls) and display the network impairment of each stream direction at the end of the call. The program is able to measure network quality parameters such as jitter, packet lost/reorder/duplicate, round trip time, etc.
Note that the remote peer MUST support RTCP so that network quality of each direction can be calculated. Using siprtp for both endpoints is recommended.
Screenshots on WinXP:
siprtp screenshot on WinXP
- Samples: Sine Wave/Dual-Tone Generation
This is a simple program to generate a tone and write the samples to a raw PCM file. The main purpose of this file is to analyze the quality of the tones/sine wave generated by PJMEDIA tone/sine wave generator.
- Samples: AEC Test (aectest.c)
Play a file to speaker, run AEC, and record the microphone input to see if echo is coming.