diff --git a/examples/simple/rtp/deallocation_1.cc b/examples/simple/rtp/deallocation_1.cc index 193b754..5e86fcf 100644 --- a/examples/simple/rtp/deallocation_1.cc +++ b/examples/simple/rtp/deallocation_1.cc @@ -4,7 +4,9 @@ int main(int argc, char **argv) { - kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566); + kvz_rtp::context ctx; + + kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, RTP_FORMAT_GENERIC); (void)writer->start(); diff --git a/examples/simple/rtp/deallocation_2.cc b/examples/simple/rtp/deallocation_2.cc index 205b2db..444cc99 100644 --- a/examples/simple/rtp/deallocation_2.cc +++ b/examples/simple/rtp/deallocation_2.cc @@ -4,7 +4,9 @@ int main(int argc, char **argv) { - kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888); + kvz_rtp::context ctx; + + kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888, RTP_FORMAT_GENERIC); (void)writer->start(); diff --git a/examples/simple/rtp/deallocation_3.cc b/examples/simple/rtp/deallocation_3.cc index 86ae293..d652abc 100644 --- a/examples/simple/rtp/deallocation_3.cc +++ b/examples/simple/rtp/deallocation_3.cc @@ -9,7 +9,9 @@ void dealloc_hook(void *mem) int main(int argc, char **argv) { - kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888); + kvz_rtp::context ctx; + + kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888, RTP_FORMAT_GENERIC); /* When SCD has processed this memory chunk, it will call dealloc_hook() * which will do all necessary deallocation steps required by the application diff --git a/examples/simple/rtp/sending.cc b/examples/simple/rtp/sending.cc index c3a1c83..5e8e921 100644 --- a/examples/simple/rtp/sending.cc +++ b/examples/simple/rtp/sending.cc @@ -9,11 +9,22 @@ int main(int argc, char **argv) kvz_rtp::context ctx; /* Creating a writer is very simple: all that needs to be provided is the - * destination address and port. + * destination address and port, and media type + * + * "RTP_FORMAT_GENERIC" means that no assumptions should be made about the data + * and it should be sent as it. + * This can be used for example raw video/raw audio or for media formats not supported + * by the library + * + * If "RTP_FORMAT_HEVC" is provided, push_frame() splits the buffer into NAL units + * and sends these NAL units in one or more RTP frames (if NAL unit size > MTU, + * the NAL unit is split into fragments) + * HEVC frame receiver will reconstruct the frame from these fragments and return + * complete NAL units back * * Source port is an optional argument that can be provided if UDP hole * punching is utilized */ - kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888); + kvz_rtp::writer *writer = ctx.create_writer("127.0.0.1", 5566, 8888, RTP_FORMAT_GENERIC); /* Before the writer can be used, it must be started. * This initializes the underlying socket and all needed data structures */ @@ -23,21 +34,8 @@ int main(int argc, char **argv) for (int i = 0; i < 10; ++i) { - /* Sending data is as simple as calling push_frame() - * - * "RTP_FORMAT_GENERIC" means that no assumptions should be made about the data - * and it should be sent as it. - * This can be used for example raw video/raw audio or for media formats not supported - * by the library - * - * If "RTP_FORMAT_HEVC" is provided, push_frame() splits the buffer into NAL units - * and sends these NAL units in one or more RTP frames (if NAL unit size > MTU, - * the NAL unit is split into fragments) - * HEVC frame receiver will reconstruct the frame from these fragments and return - * complete NAL units back - * - */ - if (writer->push_frame(buffer, PAYLOAD_MAXLEN, RTP_FORMAT_GENERIC) != RTP_OK) { + /* Sending data is as simple as calling push_frame() */ + if (writer->push_frame(buffer, PAYLOAD_MAXLEN, RTP_NO_FLAGS) != RTP_OK) { fprintf(stderr, "Failed to send RTP frame!"); } }