Go to file
Aaro Altonen c041a9c703 Set all frame pointers to NULL initially 2019-08-21 08:37:22 +03:00
examples Rewrite examples 2019-08-21 08:04:45 +03:00
src Set all frame pointers to NULL initially 2019-08-21 08:37:22 +03:00
.gitignore Update gitignore 2019-08-15 07:24:09 +03:00
COPYING Add license 2019-07-26 09:29:04 +03:00
Makefile Disable LOG_DEBUG() by default 2019-08-02 09:50:50 +03:00
README.md Update README 2019-08-21 07:35:58 +03:00
kvzrtp.pro Fix random.cc for windows 2019-08-16 09:11:25 +03:00

README.md

kvzRTP

Based on Marko Viitanen's fRTPlib

Building

Linux

make -j8
sudo make install

You can also use QtCreator to build the library. The library must be built using a 64-bit compiler!

Usage

The library should be linked as a static library to your program.

Linux

-L<path to library folder> -lkvzrtp -lpthread

Windows

-L<path to library folder> -lkvzrtp -lpthread -lwsock32 -lws2_32

Defines

Use __RTP_SILENT__ to disable all prints

Use NDEBUG to disable LOG_DEBUG which is the most verbose level of logging

Return values

There are two classes of return values: positive and negative

Negative return value means that some condition that the library can't handle happened and the function failed (out of memory, invalid parameters etc.)

Positive return value means that the function call didn't succeed but didn't fail completely either. Examples of these would be polling a socket timeouts when listening to incoming RTCP status reports (RTP_INTERRUPTED) or when process_hevc_frame() returns RTP_NOT_READY when the full frame has not been received.

When an operation succeeds, RTP_OK is returned

API

Sending data

Sending data is a simple as calling writer->push_frame(), see examples/sending/hevc_sender.cc.

Receiving data

Reading frames can be done using two different ways: polling frames or installing a receive hook.

Polling frames is a blocking operation and a separate thread should be created for it. examples/receiving/recv_example_1.cc shows how the polling approach works.

The second way to receive frames is to install a receive hook and when an RTP frame is received, this receive hook is called. Creating separate thread for reading data is not necessary if the receiving is hooked. examples/receiving/recv_example_2.cc shows how the hooking works.