Skip to content

Commit 0e12e57

Browse files
committed
Rename uvg_rtp to uvgrtp
I have no idea why the name had an underscore but now it's gone. The old namespace is kept as an alias for backwards-compatibility but it may be removed in the future
1 parent 871242b commit 0e12e57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1053
-979
lines changed

docs/examples/binding.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
int main(void)
66
{
77
/* See sending.cc for more details */
8-
uvg_rtp::context rtp_ctx;
8+
uvgrtp::context rtp_ctx;
99

1010
/* Start session with remote at IP address 10.21.25.2
1111
* and bind ourselves to interface pointed to by the IP address 10.21.25.200 */
12-
uvg_rtp::session *sess = rtp_ctx.create_session("10.21.25.2", "10.21.25.200");
12+
uvgrtp::session *sess = rtp_ctx.create_session("10.21.25.2", "10.21.25.200");
1313

1414
/* 8888 is source port or the port for the interface where data is received (ie. 10.21.25.200:8888)
1515
* 8889 is remote port or the port for the interface where the data is sent (ie. 10.21.25.2:8889) */
16-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
16+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
1717

1818
while (true) {
1919
std::unique_ptr<uint8_t[]> buffer = std::unique_ptr<uint8_t[]>(new uint8_t[PAYLOAD_MAXLEN]);

docs/examples/configuration.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
int main(void)
66
{
77
/* To use the library, one must create a global RTP context object */
8-
uvg_rtp::context ctx;
8+
uvgrtp::context ctx;
99

1010
/* Each new IP address requires a separate RTP session.
1111
* This session object contains all media streams and an RTCP object (if enabled) */
12-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
12+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1313

1414
/* Some of the functionality of uvgRTP can be enabled/disabled using RCE_* flags.
1515
*
@@ -21,7 +21,7 @@ int main(void)
2121
RCE_NO_SYSTEM_CALL_CLUSTERING | /* disable System Call Clustering */
2222
RCE_H26X_PREPEND_SC; /* prepend start code to each returned HEVC frame */
2323

24-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, flags);
24+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, flags);
2525

2626
/* uvgRTP context can also be configured using RCC_* flags
2727
* These flags do not enable/disable functionality but alter default behaviour of uvgRTP

docs/examples/custom_timestamps.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
int main(void)
66
{
77
/* To use the library, one must create a global RTP context object */
8-
uvg_rtp::context ctx;
8+
uvgrtp::context ctx;
99

1010
/* Each new IP address requires a separate RTP session.
1111
* This session object contains all media streams and an RTCP object (if enabled) */
12-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
12+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1313

1414
/* Create MediaStream and RTCP for the session */
15-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, RCE_RTCP);
15+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, RCE_RTCP);
1616

1717
uint8_t *buffer = new uint8_t[PAYLOAD_MAXLEN];
1818
uint32_t clock_rate = 90000 / 30;
@@ -31,7 +31,7 @@ int main(void)
3131

3232
/* You can also use uvgRTP's cross-platform clock interface to get current NTP timestamp */
3333
if (0)
34-
hevc->get_rtcp()->set_ts_info(uvg_rtp::clock::ntp::now(), clock_rate, timestamp);
34+
hevc->get_rtcp()->set_ts_info(uvgrtp::clock::ntp::now(), clock_rate, timestamp);
3535

3636
for (int i = 0; i < 10; ++i) {
3737
/* If needed, custom timestamps can be given to push_frame().

docs/examples/receiving_hook.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <uvgrtp/lib.hh>
22
#include <thread>
33

4-
void receive_hook(void *arg, uvg_rtp::frame::rtp_frame *frame)
4+
void receive_hook(void *arg, uvgrtp::frame::rtp_frame *frame)
55
{
66
if (!frame) {
77
fprintf(stderr, "invalid frame received!\n");
@@ -14,17 +14,17 @@ void receive_hook(void *arg, uvg_rtp::frame::rtp_frame *frame)
1414
* arg->copy_frame(frame) or whatever
1515
*
1616
* When we're done with the frame, it must be deallocated manually */
17-
(void)uvg_rtp::frame::dealloc_frame(frame);
17+
(void)uvgrtp::frame::dealloc_frame(frame);
1818
}
1919

2020
int main(void)
2121
{
2222
/* To use the library, one must create a global RTP context object */
23-
uvg_rtp::context ctx;
23+
uvgrtp::context ctx;
2424

2525
/* Each new IP address requires a separate RTP session.
2626
* This session object contains all media streams and an RTCP object (if enabled) */
27-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
27+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
2828

2929
/* Each RTP session has one or more media streams. These media streams are bidirectional
3030
* and they require both source and destination ports for the connection. One must also
@@ -40,7 +40,7 @@ int main(void)
4040
* This same object is used for both sending and receiving media
4141
*
4242
* In this example, we have one media stream with remote participant: HEVC */
43-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
43+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
4444

4545
/* Receive hook can be installed and the receiver will call this hook when an RTP frame is received
4646
*

docs/examples/receiving_poll.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
int main(void)
55
{
66
/* To use the library, one must create a global RTP context object */
7-
uvg_rtp::context ctx;
7+
uvgrtp::context ctx;
88

99
/* Each new IP address requires a separate RTP session.
1010
* This session object contains all media streams and an RTCP object (if enabled) */
11-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
11+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1212

1313
/* Each RTP session has one or more media streams. These media streams are bidirectional
1414
* and they require both source and destination ports for the connection. One must also
@@ -24,17 +24,17 @@ int main(void)
2424
* This same object is used for both sending and receiving media
2525
*
2626
* In this example, we have one media stream with remote participant: HEVC */
27-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
27+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
2828

2929
/* pull_frame() will block until a frame is received.
3030
*
3131
* If that is not acceptable, a separate thread for the reader should be created */
32-
uvg_rtp::frame::rtp_frame *frame = nullptr;
32+
uvgrtp::frame::rtp_frame *frame = nullptr;
3333

3434
while ((frame = hevc->pull_frame()) != nullptr) {
3535
/* When we receive a frame, the ownership of the frame belongs to us and
3636
* when we're done with it, we need to deallocate the frame */
37-
(void)uvg_rtp::frame::dealloc_frame(frame);
37+
(void)uvgrtp::frame::dealloc_frame(frame);
3838
}
3939

4040
ctx.destroy_session(sess);

docs/examples/rtcp_hook.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
/* uvgRTP calls this hook when it receives an RTCP Receiver Report
55
*
66
* NOTE: If application uses hook, it must also free the frame when it's done with i
7-
* Frame must deallocated using uvg_rtp::frame::dealloc_frame() function */
8-
void receiver_hook(uvg_rtp::frame::rtcp_receiver_report *frame)
7+
* Frame must deallocated using uvgrtp::frame::dealloc_frame() function */
8+
void receiver_hook(uvgrtp::frame::rtcp_receiver_report *frame)
99
{
1010
LOG_INFO("Received an RTCP Receiver Report");
1111

@@ -16,13 +16,13 @@ void receiver_hook(uvg_rtp::frame::rtcp_receiver_report *frame)
1616
int main(void)
1717
{
1818
/* See rtp/sending.cc for more information about session initialization */
19-
uvg_rtp::context ctx;
19+
uvgrtp::context ctx;
2020

21-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
21+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
2222

2323
/* For s1, RTCP runner is using port 7778 and for s2 port 8889 */
24-
uvg_rtp::media_stream *s1 = sess->create_stream(7777, 8888, RTP_FORMAT_GENERIC, RCE_RTCP);
25-
uvg_rtp::media_stream *s2 = sess->create_stream(8888, 7777, RTP_FORMAT_GENERIC, RCE_RTCP);
24+
uvgrtp::media_stream *s1 = sess->create_stream(7777, 8888, RTP_FORMAT_GENERIC, RCE_RTCP);
25+
uvgrtp::media_stream *s2 = sess->create_stream(8888, 7777, RTP_FORMAT_GENERIC, RCE_RTCP);
2626

2727
/* In this example code, s1 acts as the sender and because it is the only sender,
2828
* it does not send any RTCP frames but only receives RTCP Receiver reports from s2.

docs/examples/sending.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
int main(void)
66
{
77
/* To use the library, one must create a global RTP context object */
8-
uvg_rtp::context ctx;
8+
uvgrtp::context ctx;
99

1010
/* Each new IP address requires a separate RTP session.
1111
* This session object contains all media streams and an RTCP object (if enabled) */
12-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
12+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1313

1414
/* Each RTP session has one or more media streams. These media streams are bidirectional
1515
* and they require both source and destination ports for the connection. One must also
@@ -25,7 +25,7 @@ int main(void)
2525
* This same object is used for both sending and receiving media
2626
*
2727
* In this example, we have one media stream with remote participant: hevc */
28-
uvg_rtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
28+
uvgrtp::media_stream *hevc = sess->create_stream(8888, 8889, RTP_FORMAT_H265, 0);
2929

3030
uint8_t *buffer = new uint8_t[PAYLOAD_MAXLEN];
3131
uint32_t timestamp = 0;

docs/examples/sending_generic.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
int main(void)
77
{
88
/* See sending.cc for more details */
9-
uvg_rtp::context ctx;
9+
uvgrtp::context ctx;
1010

1111
/* See sending.cc for more details */
12-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
12+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1313

1414
/* To enable interoperability between RTP libraries, uvgRTP won't fragment generic frames by default.
1515
*
@@ -22,8 +22,8 @@ int main(void)
2222
* received, uvgRTP constructs one full RTP frame from the fragments and returns the frame to user.
2323
*
2424
* See sending.cc for more details about create_stream() */
25-
uvg_rtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, RCE_FRAGMENT_GENERIC);
26-
uvg_rtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, RCE_FRAGMENT_GENERIC);
25+
uvgrtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, RCE_FRAGMENT_GENERIC);
26+
uvgrtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, RCE_FRAGMENT_GENERIC);
2727

2828
/* Notice that PAYLOAD_MAXLEN > MTU (4096 > 1500).
2929
*
@@ -48,7 +48,7 @@ int main(void)
4848
}
4949

5050
/* the frame must be destroyed manually */
51-
(void)uvg_rtp::frame::dealloc_frame(frame);
51+
(void)uvgrtp::frame::dealloc_frame(frame);
5252

5353
/* Session must be destroyed manually */
5454
ctx.destroy_session(sess);

docs/examples/srtp_user.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ uint8_t salt[SALT_SIZE] = { 0 };
1414
void thread_func(void)
1515
{
1616
/* See sending.cc for more details */
17-
uvg_rtp::context ctx;
18-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
17+
uvgrtp::context ctx;
18+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1919

2020
/* Enable SRTP and let user manage keys */
2121
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_USER;
2222

2323
/* See sending.cc for more details about create_stream() */
24-
uvg_rtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
24+
uvgrtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
2525

2626
/* Before anything else can be done,
2727
* add_srtp_ctx() must be called with the SRTP key and salt.
@@ -35,7 +35,7 @@ void thread_func(void)
3535
fprintf(stderr, "Message: '%s'\n", frame->payload);
3636

3737
/* the frame must be destroyed manually */
38-
(void)uvg_rtp::frame::dealloc_frame(frame);
38+
(void)uvgrtp::frame::dealloc_frame(frame);
3939
}
4040
}
4141

@@ -52,14 +52,14 @@ int main(void)
5252
new std::thread(thread_func);
5353

5454
/* See sending.cc for more details */
55-
uvg_rtp::context ctx;
56-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
55+
uvgrtp::context ctx;
56+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
5757

5858
/* Enable SRTP and let user manage keys */
5959
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_USER;
6060

6161
/* See sending.cc for more details about create_stream() */
62-
uvg_rtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
62+
uvgrtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
6363

6464
/* Before anything else can be done,
6565
* add_srtp_ctx() must be called with the SRTP key and salt.

docs/examples/srtp_zrtp.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
void thread_func(void)
66
{
77
/* See sending.cc for more details */
8-
uvg_rtp::context ctx;
9-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
8+
uvgrtp::context ctx;
9+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1010

1111
/* Enable SRTP and use ZRTP to manage keys */
1212
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_ZRTP;
1313

1414
/* See sending.cc for more details about create_stream() */
15-
uvg_rtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
15+
uvgrtp::media_stream *recv = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
1616

1717
for (;;) {
1818
auto frame = recv->pull_frame();
1919
fprintf(stderr, "Message: '%s'\n", frame->payload);
2020

2121
/* the frame must be destroyed manually */
22-
(void)uvg_rtp::frame::dealloc_frame(frame);
22+
(void)uvgrtp::frame::dealloc_frame(frame);
2323
}
2424
}
2525

@@ -33,14 +33,14 @@ int main(void)
3333
new std::thread(thread_func);
3434

3535
/* See sending.cc for more details */
36-
uvg_rtp::context ctx;
37-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
36+
uvgrtp::context ctx;
37+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
3838

3939
/* Enable SRTP and use ZRTP to manage keys */
4040
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_ZRTP;
4141

4242
/* See sending.cc for more details about create_stream() */
43-
uvg_rtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
43+
uvgrtp::media_stream *send = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
4444

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

docs/examples/zrtp_multistream.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
void thread_func(void)
66
{
77
/* See sending.cc for more details */
8-
uvg_rtp::context ctx;
9-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
8+
uvgrtp::context ctx;
9+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
1010

1111
/* Enable SRTP and use ZRTP to manage keys */
1212
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_ZRTP;
1313

1414
/* Keys creates using Diffie-Hellman mode */
15-
uvg_rtp::media_stream *recv1 = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
15+
uvgrtp::media_stream *recv1 = sess->create_stream(8889, 8888, RTP_FORMAT_GENERIC, flags);
1616

1717
/* Keys created using Multistream mode */
18-
uvg_rtp::media_stream *recv2 = sess->create_stream(7778, 7777, RTP_FORMAT_GENERIC, flags);
18+
uvgrtp::media_stream *recv2 = sess->create_stream(7778, 7777, RTP_FORMAT_GENERIC, flags);
1919

2020
for (;;) {
2121
auto frame = recv1->pull_frame();
2222
fprintf(stderr, "Message: '%s'\n", frame->payload);
23-
(void)uvg_rtp::frame::dealloc_frame(frame);
23+
(void)uvgrtp::frame::dealloc_frame(frame);
2424

2525
frame = recv2->pull_frame();
2626
fprintf(stderr, "Message: '%s'\n", frame->payload);
27-
(void)uvg_rtp::frame::dealloc_frame(frame);
27+
(void)uvgrtp::frame::dealloc_frame(frame);
2828
}
2929
}
3030

@@ -38,19 +38,19 @@ int main(void)
3838
new std::thread(thread_func);
3939

4040
/* See sending.cc for more details */
41-
uvg_rtp::context ctx;
42-
uvg_rtp::session *sess = ctx.create_session("127.0.0.1");
41+
uvgrtp::context ctx;
42+
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
4343

4444
/* Enable SRTP and use ZRTP to manage keys */
4545
unsigned flags = RCE_SRTP | RCE_SRTP_KMNGMNT_ZRTP;
4646

4747
/* Initialize ZRTP and negotiate the keys used to encrypt the media */
48-
uvg_rtp::media_stream *send1 = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
48+
uvgrtp::media_stream *send1 = sess->create_stream(8888, 8889, RTP_FORMAT_GENERIC, flags);
4949

5050
/* The first call to create_stream() creates keys for the session using Diffie-Hellman
5151
* key exchange and all subsequent calls to create_stream() initialize keys for the
5252
* stream using Multistream mode */
53-
uvg_rtp::media_stream *send2 = sess->create_stream(7777, 7778, RTP_FORMAT_GENERIC, flags);
53+
uvgrtp::media_stream *send2 = sess->create_stream(7777, 7778, RTP_FORMAT_GENERIC, flags);
5454

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

include/clock.hh

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <chrono>
44

5-
namespace uvg_rtp {
5+
namespace uvgrtp {
66
namespace clock {
77

88
/* network time protocol */
@@ -42,3 +42,5 @@ namespace uvg_rtp {
4242
#endif
4343
};
4444
};
45+
46+
namespace uvg_rtp = uvgrtp;

0 commit comments

Comments
 (0)