uvgrtp-base/docs/examples
Joni Räsänen 5d2f0ccaff examples: Improved generic sending example
Makes the generic sending example so that it can be run and it performs
a small demonstration.
2021-07-26 16:02:51 +03:00
..
.gitignore examples: Added qt project for building examples 2021-07-09 14:50:59 +03:00
README.md doc: Fix example code 2021-05-30 07:52:40 +03:00
binding.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
configuration.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
custom_timestamps.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
receiving_hook.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
receiving_poll.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
rtcp_hook.cc examples: Minor fixes to previously improved examples 2021-07-26 16:02:49 +03:00
sending.cc examples: Improved sending example 2021-07-26 16:02:50 +03:00
sending_generic.cc examples: Improved generic sending example 2021-07-26 16:02:51 +03:00
srtp_user.cc common: Improve comments in example codes 2021-04-23 08:55:15 +03:00
srtp_zrtp.cc Rename uvg_rtp to uvgrtp 2021-03-23 01:18:59 +02:00
uvgRTP_examples.pro examples: Added qt project for building examples 2021-07-09 14:50:59 +03:00
zrtp_multistream.cc common: Improve comments in example codes 2021-04-23 08:55:15 +03: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)
{
    uvgrtp::context ctx;
    uvgrtp::session *sess = ctx.create_session("127.0.0.1");

    uvgrtp::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) + 1;

    for (;;) {
        strm->push_frame((uint8_t *)message, msg_len, RTP_NO_FLAGS);
        auto frame = strm->pull_frame();
        fprintf(stderr, "Message: '%s'\n", frame->payload);
        uvgrtp::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 hand-off 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