uvgrtp-base/docs/examples
Aaro Altonen 36d76a3ca5 Add Doxygen main page 2021-03-23 01:19:47 +02:00
..
README.md Add Doxygen documentation support 2021-03-23 01:18:59 +02:00
binding.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
configuration.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
custom_timestamps.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
rawvideo.cc Add Doxygen main page 2021-03-23 01:19:47 +02:00
receiving_hook.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
receiving_poll.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
rtcp_hook.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
sending.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
sending_generic.cc Update sending_generic.cc example code 2021-03-23 01:18:59 +02:00
srtp_user.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
srtp_zrtp.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
zrtp_multistream.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00

README.md

uvgRTP example codes

This directory contains a collection of simple and thoroughly commented examples that demonstrate how to use uvgRTP

Below is a very simple example usage of uvgRTP:

#include <uvgrtp/lib.hh>

/* g++ main.cc -luvgrtp -lpthread && ./a.out */

int main(void)
{
    uvg_rtp::context ctx;
    uvg_rtp::session *sess = ctx.create_session("127.0.0.1");

    uvg_rtp::media_stream *strm = sess->create_stream(8888, 8888, RTP_FORMAT_GENERIC, RTP_NO_FLAGS);

    char *message  = (char *)"Hello, world!";
    size_t msg_len = strlen(message);

    for (;;) {
        strm->push_frame((uint8_t *)message, msg_len, RTP_NO_FLAGS);
        auto frame = strm->pull_frame();
        fprintf(stderr, "Message: '%s'\n", frame->payload);
        uvg_rtp::frame::dealloc_frame(frame);
    }
}

Basic RTP functionality

How to create a simple RTP sender

How to create a simple RTP receiver (hooking)

NOTE: The hook should not be used for media processing. It should be used as interface between application and library where the frame handout happens.

How to create a simple RTP receiver (polling)

Advanced RTP functionality

How to configure uvgRTP context

How to fragment generic media types

How to enable UDP hole punching

How to use custom timestamps correctly

RTCP

How to use RTCP instance (hooking)

Security

How to use SRTP with ZRTP

How to use multi-stream SRTP with ZRTP

How to use SRTP with user-managed keys