Go to file
Aaro Altonen 3577b87379 Create optimistic HEVC fragment receiver
Small frames work, larger frames are sometimes dropped. This is supposed
to reduce the amount of copying but the performance will degrade as
network load increases
2019-09-11 11:33:41 +03:00
benchmarks Create formats folder for all different media types 2019-09-11 11:14:24 +03:00
examples Replace the overwritten byte before exitint from __get_hevc_start() 2019-09-11 11:16:01 +03:00
src Create optimistic HEVC fragment receiver 2019-09-11 11:33:41 +03:00
.gitignore Update gitignore 2019-09-11 10:10:09 +03:00
COPYING Add license 2019-07-26 09:29:04 +03:00
Makefile Create formats folder for all different media types 2019-09-11 11:14:24 +03:00
README.md Add probation zone for RTP frames 2019-09-11 11:18:09 +03:00
kvzrtp.pro Create formats folder for all different media types 2019-09-11 11:14:24 +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 __RTP_NO_PROBATION_ZONE__ to disable the probation zone allocation for RTP frames

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.