Commit Graph

432 Commits

Author SHA1 Message Date
Aaro Altonen 09caee904f Relay RTP context flags to RTCP object 2020-08-25 09:14:34 +03:00
Aaro Altonen 5d680d454b Add example code for custom timestamping 2020-08-20 11:36:33 +03:00
Aaro Altonen b51fef61ee Merge branch 'security-fixes' into develop 2020-08-18 10:11:19 +03:00
Aaro Altonen 5dcb9e68ec Implement RTP packet authentication using the frame queue
The authentication tag for each packet is stored inside the active
transaction and they are destroyed when the transaction is deallocated.

This way neither Socket nor SRTP needs to worry about (de)allocation
of those tags.

The authentication tag occupies the last slot in the pkt_vec structure
of each packet so it's easily accessible for the security layer when
calculating the checksum and guaranteed to be there if
RCE_SRTP_AUTHENTICATE_RTP has been provided.
2020-08-18 09:38:16 +03:00
Aaro Altonen 12ac580290 Deprecate the single buffer based sendto(2) for RTP packets
All RTP packets use buf_vec/pkt_vec style I/O and thus the old
single buffer based approach is no longer needed.
2020-08-18 09:38:16 +03:00
Aaro Altonen 1a36eebc99 Use frame queue with all media formats
Move frame queue to Media object and implement the generic push API
using a frame queue

This change temporarily disable the fragmentation of generic frames
2020-08-18 09:38:16 +03:00
Aaro Altonen 079c3ab23c Implement cross-platform frame queue
Introduce buf_vec and pkt_vec structures which enable cross-platform
scatter/gather I/O. This supersedes the previous Linux-only mmsghdr
hack. Buf_vec contains buffers of a single RTP frame
whereas pkt_vec contains multiple buf_vec structures that are sent
all at once when flush_queue() is called.

From now on all media formats should use frame queue to implement
RTP frame sending. This is because internally the frame queue
updates RTP header information and it can inject additional fields
to the RTP frame such as an authentication tag.
2020-08-18 09:38:16 +03:00
Aaro Altonen bfc6283f91 Pass RTP context flags to frame queue 2020-08-18 09:38:16 +03:00
Aaro Altonen ef2a27e3b6 Remove all SRTP-related code from src/socket.cc
SRTP functionality is provided to packet handlers
2020-08-18 09:38:16 +03:00
Aaro Altonen b6595822cb Fix warnings 2020-08-18 09:38:16 +03:00
Aaro Altonen 6b5ec3b5c0 Create socket as a pointer in src/media_stream.cc
All the other MediaStream objects are pointers and they also
only accept the socket as a pointer so it makes sense to covert
that to a pointer
2020-08-18 09:38:16 +03:00
Aaro Altonen 0bbe6966f1 Implement decryption handler for SRTP 2020-08-18 09:38:16 +03:00
Aaro Altonen 359e84076c Implement encryption/authentication handlers for SRTP 2020-08-18 09:38:16 +03:00
Aaro Altonen 9060ec9859 Merge SRTP context and SRTP key context structures
Packet handlers need both general context and session keys so it's
easier to store both in one struct. Keys are anyways part of
the larger context.
2020-08-18 09:38:16 +03:00
Aaro Altonen 29d274d72b Fix Media Stream initialization when ZRTP is used 2020-08-18 09:38:16 +03:00
Aaro Altonen 007ba4cb5c Move ZRTP packet handler to src/zrtp.cc 2020-08-18 09:38:16 +03:00
Aaro Altonen 953621eca8 Rename role enums for RTCP and ZRTP 2020-08-18 09:38:16 +03:00
Aaro Altonen 34b07066b3 Implement RTCP sender packet handler
This handler only grabs the packet size and changes the role
from receiver to sender if that hasn't been done yet
2020-08-15 04:05:42 +03:00
Aaro Altonen 906f6e6853 Implement packet handler support for outgoing frames
uvgRTP can install handler f.ex. for collecting RTCP sender statistics
information or to install SRTP encryption handler.

This way these unrelated objects don't have to be passed to src/socket.cc
and it will only contain code pertaining to actual socket operations
2020-08-15 04:05:42 +03:00
Aaro Altonen 9ee2318384 Remove low-level socket handlers
This kind of functionality is now provided by RTP packet dispatcher
for receive-functionality and similar kind of send functionality
is implemented very soon
2020-08-15 04:05:42 +03:00
Aaro Altonen ad4edc9747 Refactor RTCP code
Move RTCP runner related code to a separate file for clarity and
reorder code in src/rtcp.cc to move related code close to each other
2020-08-15 04:05:42 +03:00
Aaro Altonen 034315a013 Implement RTCP packet handler 2020-08-15 04:05:42 +03:00
Aaro Altonen 863d3a825e Add optional argument for auxiliary packet handlers
Some packet handlers (such as RTCP) may need access to the parent
object or they may require some additional data from outside the
packet handler that is required when processing the packet.
2020-08-15 04:05:42 +03:00
Aaro Altonen 7927f3682d Simplify RTCP code 2020-08-15 04:05:42 +03:00
Aaro Altonen d98757758c Split RTCP code into different files
Having a 1100 lines long file is not manageable so split RTCP
code into different files by packet type and leave all the
session-related code to src/rtcp.cc
2020-08-15 04:05:42 +03:00
Aaro Altonen f964201c12 Separate packet handlers into primary and auxiliary
Because most packet handlers do not require the raw UDP datagram
received through the socket, it makes little sense to relay those
parameters to them.

Additionally, there's a clear distinction between crafting
an RTP frame and operating on it so having one handler type
for both operations is not the best design choice.

Thus the packet handlers are divided into primary and auxiliary
handlers. Primary handlers are responsible for creating a packet
that the auxiliary handlers can operate on and auxiliary handlers
are responsible for doing all other operations on the packet such as
gathering sessions statistic information or decrypting the packet.
2020-08-15 04:05:42 +03:00
Aaro Altonen d06eed5833 Create RTCP for the media stream unconditionally
RTCP is used to gather session statistics and detect SSRC collisions
so all packets should be relayd to the RTCP layer for monitoring
even if RTCP packets are not being sent.

If RTCP Sender/Receiver reports are needed, RCE_RTCP should be given
when creating a media stream.
2020-08-15 04:05:42 +03:00
Aaro Altonen fb4c781233 Remove Opus code from the project 2020-08-15 04:05:42 +03:00
Aaro Altonen 529544cc81 Use RTP context to determine payload type in src/queue.cc 2020-08-15 04:05:42 +03:00
Aaro Altonen effc2f7b22 Exit from RTP packet dispatcher gracefully
Indicate to the main thread through a mutex that the packet dispatcher
object can be destroyed. If this is not done, there's race condition
that can result into a segmentation fault as the dispatcher object
could be destroyed before it stops running.
2020-08-15 04:05:42 +03:00
Aaro Altonen b9ea6558d5 Implement frame return functionality 2020-08-15 04:05:42 +03:00
Aaro Altonen ddef2b4c71 Do not pass socket reference to RTP packet dispatcher's constructor
Packet dispatcher does not need to store the socket because it
is passed to the actual runner when the packet dispatcher is started.

This also fixes a bug where the socket's destructor is called right
after the packet dispatcher's constructor
2020-08-15 04:05:42 +03:00
Aaro Altonen 1dd628d927 Start the RTP packet dispatcher in pkt_dispatch.cc 2020-08-15 04:05:42 +03:00
Aaro Altonen 96ba50a159 Fix includes in formats/media.hh 2020-08-15 04:05:42 +03:00
Aaro Altonen 95ebd4289d Spawn thread for RTP packet dispatcher 2020-08-15 04:05:42 +03:00
Aaro Altonen 42aeccfaa1 Implement RTP packet handler for generic frames
Remove the old generic interface and replace it with the push_frame()
implemented in some previous commit and with the new packet handler
implemented in this commit.

All media formats that do not require extra processing (such as Opus)
should use the generic interface.
2020-08-15 04:05:42 +03:00
Aaro Altonen f5a73f5b64 Pass RTP context flags to RTP packet dispatcher and handlers
Context flags may contain important information about how a packet
should be handled (such as RCE_FRAGMENT_GENERIC or RCE_HEVC_NO_INTRA_DELAY)
2020-08-15 04:05:42 +03:00
Aaro Altonen 3d0a77fb16 Move Media object code to formats directory 2020-08-15 04:05:42 +03:00
Aaro Altonen 9d820d5953 Implement RTP packet handler 2020-08-15 04:05:42 +03:00
Aaro Altonen 53e6c72d17 Implement memdup() utility function 2020-08-15 04:05:42 +03:00
Aaro Altonen 6b812cddc8 Add RTP packet dispatcher and Media object to Media Stream
Deprecate the old sender/receiver architecture from vanilla uvgRTP
and start using RTP packet dispatcher for incoming frames and Media
object for outgoing frames.
2020-08-15 04:05:42 +03:00
Aaro Altonen 9cc21ebf35 Implement push_frame() for HEVC 2020-08-15 04:05:42 +03:00
Aaro Altonen 3eb02207d9 Add ability to return an RTP frame from packet handler
When a complete RTP frame has been received, the packet handler
must return the frame to RTP packet dispatcher which then returns
the frame to user either through frame queue or receive hook
2020-08-15 04:05:42 +03:00
Aaro Altonen 2bbe34924f Remove RTP receiver
Media objects and RTP packet dispatcher shall perform all the needed
functionality of RTP receiver in the near future.
2020-08-15 04:05:42 +03:00
Aaro Altonen 08bb44207d Implement pull_frame() for RTP packet dispatcher 2020-08-15 04:05:42 +03:00
Aaro Altonen d721a52a3d Add receive hook to RTP packet dispatcher 2020-08-15 04:05:42 +03:00
Aaro Altonen 9e49ad4b09 Remove old send interface
This interface was hardly used and it provided very little benefit
over using the socket API directly.
2020-08-15 04:05:42 +03:00
Aaro Altonen 8f0e746e59 Introduce Media object
Media is the base class from which all other media formats inherit
the common operations.

Media object contains two push_frame()s: one for normal pointers and
one for smart pointers. It also contains a packet handler which is
called by the RTP packet dispatcher when a UDP datagram is received.

All media formats must implement packet_handler() and __push_frame()
methods. If the media media format does not require any extra processing
(such as Opus), it can directly use the Media object and its implementation
of __push_frame() and packet_handler().

Media object implements the generic interface which supports sending
any kind of data and a uvgRTP-specific way of fragmenting/reconstructing
generic RTP frames which can be enabled with RCE_FRAGMENT_GENERIC.
2020-08-15 04:05:42 +03:00
Aaro Altonen 2c4b02dfa6 Remove RTP sender
Media-specific object is going to handle all send operations in the near
future, thus deprecating sender
2020-08-15 04:05:42 +03:00
Aaro Altonen e2c4006972 Pass socket and RTP context to frame queue
Only RTP context and socketa are needed for the operations performed
by the frame queue so passing them to a constructor is much simpler
than passing sender to every function call and accessing the
context/socket through that.
2020-08-15 04:05:42 +03:00
Aaro Altonen 3312a0b559 Add getter for RTP payload format 2020-08-15 04:05:42 +03:00
Aaro Altonen 157b21a05c Create ZRTP packet handler 2020-08-15 04:05:42 +03:00
Aaro Altonen 14ecd34fdd Implement RTP packet dispatcher
Packet dispatcher is responsible for doing receive-related socket operations
and dispatching the received UDP datagram to the installed packet handlers.

Packet dispatcher goes through all installed handlers until a suitable
handler for the packet is found.
2020-08-15 04:05:42 +03:00
Aaro Altonen 66a4c2a412 Create log_platform_error() utility function 2020-08-15 04:05:42 +03:00
Aaro Altonen 693c5331c3 Add support for RTP packet authentication
By default authentication is disabled for RTP but in can be enabled
by giving RCE_SRTP_AUTHENTICATE_RTP when creating a media stream.

When security layer gets a packet, outgoing or incoming, it will add
an authentication tag to the packet or verify the tag, respectively.

This implementation is not perfect. The largest issue is
that there is no proper packet dispatcher so late ZRTP packets
can cause some real trouble.

This and a few other issues will be addresses later on when the
architecture of packet reception and the whole socket layer is improved.
2020-08-15 04:05:42 +03:00
Aaro Altonen 484c626ba4 Pass context flags directly to SRTP 2020-08-15 04:05:42 +03:00
Aaro Altonen 1a3dd9ca43 Store maximum payload size to RTP context
Store the size to context because different streams may have different
maximum payload sizes. For example, an SRTP stream with RTP authentication
enabled has a smaller payload size than a normal RTP stream.
2020-08-15 04:05:42 +03:00
Aaro Altonen 77fc7df078 Add support for SRTP NULL cipher 2020-08-15 04:05:42 +03:00
Aaro Altonen 61f7ef0416 Update SRTP code 2020-08-15 04:05:42 +03:00
Aaro Altonen 0d033cda59 Create TIME_DIFF macro 2020-08-15 04:05:42 +03:00
Aaro Altonen 00d10cd0b7 Add Multistream mode key generation 2020-08-15 04:05:42 +03:00
Aaro Altonen ffc24e6b49 Protect access to ZRTP state by a mutex 2020-08-15 04:05:42 +03:00
Aaro Altonen b1a072b9f0 Fix Preshared and Multistream names 2020-08-15 04:05:42 +03:00
Aaro Altonen e8b2947072 Give key agreement type for init_session() as a parameter 2020-08-15 04:05:42 +03:00
Aaro Altonen f4024dd730 Implement RTCP sender packet handler
This handler only grabs the packet size and changes the role
from receiver to sender if that hasn't been done yet
2020-08-12 11:47:12 +03:00
Aaro Altonen 49ddc269db Implement packet handler support for outgoing frames
uvgRTP can install handler f.ex. for collecting RTCP sender statistics
information or to install SRTP encryption handler.

This way these unrelated objects don't have to be passed to src/socket.cc
and it will only contain code pertaining to actual socket operations
2020-08-12 11:34:41 +03:00
Aaro Altonen 0cb55baaad Remove low-level socket handlers
This kind of functionality is now provided by RTP packet dispatcher
for receive-functionality and similar kind of send functionality
is implemented very soon
2020-08-12 11:08:14 +03:00
Aaro Altonen 7fae21db8c Refactor RTCP code
Move RTCP runner related code to a separate file for clarity and
reorder code in src/rtcp.cc to move related code close to each other
2020-08-12 10:18:57 +03:00
Aaro Altonen c05eadbced Implement RTCP packet handler 2020-08-10 12:11:59 +03:00
Aaro Altonen d32b2b82b9 Add optional argument for auxiliary packet handlers
Some packet handlers (such as RTCP) may need access to the parent
object or they may require some additional data from outside the
packet handler that is required when processing the packet.
2020-08-10 08:58:23 +03:00
Aaro Altonen 3ee835a305 Simplify RTCP code 2020-08-06 13:03:18 +03:00
Aaro Altonen 6067a2ed18 Split RTCP code into different files
Having a 1100 lines long file is not manageable so split RTCP
code into different files by packet type and leave all the
session-related code to src/rtcp.cc
2020-08-06 10:39:54 +03:00
Aaro Altonen 39e9b07726 Separate packet handlers into primary and auxiliary
Because most packet handlers do not require the raw UDP datagram
received through the socket, it makes little sense to relay those
parameters to them.

Additionally, there's a clear distinction between crafting
an RTP frame and operating on it so having one handler type
for both operations is not the best design choice.

Thus the packet handlers are divided into primary and auxiliary
handlers. Primary handlers are responsible for creating a packet
that the auxiliary handlers can operate on and auxiliary handlers
are responsible for doing all other operations on the packet such as
gathering sessions statistic information or decrypting the packet.
2020-08-06 08:43:18 +03:00
Aaro Altonen 9a59dd0cc8 Create RTCP for the media stream unconditionally
RTCP is used to gather session statistics and detect SSRC collisions
so all packets should be relayd to the RTCP layer for monitoring
even if RTCP packets are not being sent.

If RTCP Sender/Receiver reports are needed, RCE_RTCP should be given
when creating a media stream.
2020-08-06 07:39:55 +03:00
Aaro Altonen 9cba1af32a Remove Opus code from the project 2020-08-06 07:39:55 +03:00
Aaro Altonen 5cc862ac9d Use RTP context to determine payload type in src/queue.cc 2020-08-06 07:39:41 +03:00
Aaro Altonen eb33b7edf7 Exit from RTP packet dispatcher gracefully
Indicate to the main thread through a mutex that the packet dispatcher
object can be destroyed. If this is not done, there's race condition
that can result into a segmentation fault as the dispatcher object
could be destroyed before it stops running.
2020-08-06 07:39:41 +03:00
Aaro Altonen bdfe027352 Implement frame return functionality 2020-08-06 07:39:41 +03:00
Aaro Altonen d70c077d77 Do not pass socket reference to RTP packet dispatcher's constructor
Packet dispatcher does not need to store the socket because it
is passed to the actual runner when the packet dispatcher is started.

This also fixes a bug where the socket's destructor is called right
after the packet dispatcher's constructor
2020-08-05 09:50:23 +03:00
Aaro Altonen f938750194 Start the RTP packet dispatcher in pkt_dispatch.cc 2020-08-05 09:10:16 +03:00
Aaro Altonen b1d73dad36 Fix includes in formats/media.hh 2020-08-05 09:09:33 +03:00
Aaro Altonen 0dd3d67655 Spawn thread for RTP packet dispatcher 2020-08-05 08:18:29 +03:00
Aaro Altonen 4b9f06acd4 Implement RTP packet handler for generic frames
Remove the old generic interface and replace it with the push_frame()
implemented in some previous commit and with the new packet handler
implemented in this commit.

All media formats that do not require extra processing (such as Opus)
should use the generic interface.
2020-08-04 13:28:26 +03:00
Aaro Altonen 43e0452bfa Pass RTP context flags to RTP packet dispatcher and handlers
Context flags may contain important information about how a packet
should be handled (such as RCE_FRAGMENT_GENERIC or RCE_HEVC_NO_INTRA_DELAY)
2020-08-04 13:10:54 +03:00
Aaro Altonen e92529bf41 Move Media object code to formats directory 2020-08-04 11:32:50 +03:00
Aaro Altonen 4af15727cf Implement RTP packet handler 2020-08-04 10:43:56 +03:00
Aaro Altonen 494765a2fa Implement memdup() utility function 2020-08-04 10:16:38 +03:00
Aaro Altonen 574580c0f8 Add RTP packet dispatcher and Media object to Media Stream
Deprecate the old sender/receiver architecture from vanilla uvgRTP
and start using RTP packet dispatcher for incoming frames and Media
object for outgoing frames.
2020-08-04 08:53:27 +03:00
Aaro Altonen 858ac54b13 Implement push_frame() for HEVC 2020-08-04 08:39:12 +03:00
Aaro Altonen 91a12af92d Add ability to return an RTP frame from packet handler
When a complete RTP frame has been received, the packet handler
must return the frame to RTP packet dispatcher which then returns
the frame to user either through frame queue or receive hook
2020-08-04 08:39:12 +03:00
Aaro Altonen 7e16140e85 Remove RTP receiver
Media objects and RTP packet dispatcher shall perform all the needed
functionality of RTP receiver in the near future.
2020-08-04 08:39:12 +03:00
Aaro Altonen c2bdf3a4fd Implement pull_frame() for RTP packet dispatcher 2020-08-04 08:39:12 +03:00
Aaro Altonen fc597fd2f8 Add receive hook to RTP packet dispatcher 2020-08-04 08:39:12 +03:00
Aaro Altonen 00259dbcc7 Remove old send interface
This interface was hardly used and it provided very little benefit
over using the socket API directly.
2020-08-04 08:39:08 +03:00
Aaro Altonen 3519378821 Introduce Media object
Media is the base class from which all other media formats inherit
the common operations.

Media object contains two push_frame()s: one for normal pointers and
one for smart pointers. It also contains a packet handler which is
called by the RTP packet dispatcher when a UDP datagram is received.

All media formats must implement packet_handler() and __push_frame()
methods. If the media media format does not require any extra processing
(such as Opus), it can directly use the Media object and its implementation
of __push_frame() and packet_handler().

Media object implements the generic interface which supports sending
any kind of data and a uvgRTP-specific way of fragmenting/reconstructing
generic RTP frames which can be enabled with RCE_FRAGMENT_GENERIC.
2020-08-03 10:10:29 +03:00
Aaro Altonen 86837e82d5 Remove RTP sender
Media-specific object is going to handle all send operations in the near
future, thus deprecating sender
2020-08-03 10:07:45 +03:00
Aaro Altonen 95f103eac1 Pass socket and RTP context to frame queue
Only RTP context and socketa are needed for the operations performed
by the frame queue so passing them to a constructor is much simpler
than passing sender to every function call and accessing the
context/socket through that.
2020-08-02 13:19:07 +03:00
Aaro Altonen e8da36b113 Add getter for RTP payload format 2020-08-02 10:50:12 +03:00
Aaro Altonen a5c8adde48 Create ZRTP packet handler 2020-08-01 15:15:53 +03:00
Aaro Altonen ff583c3cdd Implement RTP packet dispatcher
Packet dispatcher is responsible for doing receive-related socket operations
and dispatching the received UDP datagram to the installed packet handlers.

Packet dispatcher goes through all installed handlers until a suitable
handler for the packet is found.
2020-08-01 15:15:49 +03:00
Aaro Altonen 5a53f8d563 Create log_platform_error() utility function 2020-07-31 12:42:18 +03:00
Aaro Altonen 7c2142dddf Merge branch 'secure-rtp' into develop 2020-07-31 11:29:24 +03:00
Aaro Altonen b1a48f6b2c Add support for RTP packet authentication
By default authentication is disabled for RTP but in can be enabled
by giving RCE_SRTP_AUTHENTICATE_RTP when creating a media stream.

When security layer gets a packet, outgoing or incoming, it will add
an authentication tag to the packet or verify the tag, respectively.

This implementation is not perfect. The largest issue is
that there is no proper packet dispatcher so late ZRTP packets
can cause some real trouble.

This and a few other issues will be addresses later on when the
architecture of packet reception and the whole socket layer is improved.
2020-07-31 09:56:06 +03:00
Aaro Altonen 74cf102df2 Pass context flags directly to SRTP 2020-07-30 19:19:20 +03:00
Aaro Altonen dc494747a4 Store maximum payload size to RTP context
Store the size to context because different streams may have different
maximum payload sizes. For example, an SRTP stream with RTP authentication
enabled has a smaller payload size than a normal RTP stream.
2020-07-30 14:03:28 +03:00
Aaro Altonen 7d31f0ba08 Add support for SRTP NULL cipher 2020-07-30 11:47:11 +03:00
Aaro Altonen 3207713c24 Update SRTP code 2020-07-30 09:41:01 +03:00
Aaro Altonen 568b40a70b Create TIME_DIFF macro 2020-07-28 10:35:21 +03:00
Aaro Altonen e12a329fbc Add Multistream mode key generation 2020-07-23 13:21:27 +03:00
Aaro Altonen ef0c074d80 Protect access to ZRTP state by a mutex 2020-07-23 13:05:55 +03:00
Aaro Altonen ec30260763 Fix Preshared and Multistream names 2020-06-26 08:19:38 +03:00
Aaro Altonen 8d786d1217 Give key agreement type for init_session() as a parameter 2020-06-26 08:18:55 +03:00
Aaro Altonen 5217d42814 Add RTCP support to RTP receiver
Receiver calls RTCP after every received frame to update
session statistics
2020-06-18 09:33:41 +03:00
Aaro Altonen 73f5c4a35a Add ability to create unidirectional senders/receivers
This may be useful in situations where a user wishes to join a
conference call but does not wish to send any data only receiver or
vice versa.

This unidirectionality will also dictate the role for the media_stream's
RTCP object
2020-06-17 08:23:50 +03:00
Aaro Altonen 06f2891b86 Create RTCP gettter 2020-06-17 07:55:47 +03:00
Aaro Altonen b243d7d47e Remove RTCP forwards from media_stream
RTCP state should be modified only through the RTCP object allocated
for each media_stream
2020-06-17 07:55:02 +03:00
Aaro Altonen a522c81324 Add RTCP support for media_stream 2020-06-16 06:41:16 +03:00
Aaro Altonen 2af23d653e Add get_clock_rate() to rtp.cc 2020-06-16 06:41:14 +03:00
Aaro Altonen c997a94c2a Add ability to use custom timestamps for media
Instead of using uvgRTP's internal RTP timestamps, let user specify
timestamp for the media when push_frame() is called.

Instead of propagating the timestamp through the send stack, store
the timestamp value temporarily to the RTP context of the media
stream and reset it after push_frame() is done.

User should not mix and match uvgRTP's internal RTP timestamps with
custom timestamps so either all of the calls or none of the calls should
given a timestamp to push_frame().

Custom timestamps should be increased in accordance with the media clock
rate, otherwise problems may occur with media reception.
2020-06-02 08:25:34 +03:00
Aaro Altonen 574592cb10 Make System Call Clustering optional 2020-05-28 12:41:08 +03:00
Aaro Altonen 7b73aede33 Add pull_frame(timeout)
Instead of blocking until the library is destroyed, add ability
to block at most N milliseconds before returning.

The code returns early if a frame is received within the specified
timeframe but will block at most "timeout "milliseconds
2020-05-11 17:36:13 +03:00
Aaro Altonen 867aa02dbd Rename debug() to uvgrtp_debug()
Prevent name clahes with other software, debug is after all
quite a common symbol name
2020-05-06 06:46:13 +03:00
Aaro Altonen c2438e3017 Add support for user-managed SRTP session
Because the architecture has changed a bit, the context is initialized
only after add_srtp_ctx() has been called to prevent the user from
sending unencrypted messages.
2020-04-30 01:45:28 +03:00
Aaro Altonen 649be450e5 Enable runtime configuration functionality
Remove old context configuration flags that are no longer used,
convert configure_ctx() to work as a handler for all RCC_* flags
and use default values in sender/receiver/queue during initialization
2020-04-28 11:18:13 +03:00
Aaro Altonen c62194aea2 Add ability to specify custom payload type 2020-04-28 11:18:13 +03:00
Aaro Altonen c2e7eb1bc1 Rename kvzRTP to uvgRTP 2020-04-28 11:18:07 +03:00
Aaro Altonen df4c96c072 Removed unused Opus function 2020-04-27 12:57:00 +03:00
Aaro Altonen 29749c3623 Create RCE_INPLACE_ENCRYPTION flag
This flag indicates to kvzRTP that the input data given to push_frame()
is writable and the encryption can be done in-place.

By default kvzRTP assumes that the input cannot be modified and creates
a copy of the input data.
2020-04-27 12:22:28 +03:00
Aaro Altonen 98404d9316 Increase the MAX_PAYLOAD to 1443
There's 2 bytes left in the budget after all media headers
2020-04-26 21:04:28 +03:00
Aaro Altonen 5cedd36641 Add ability to fragment/reconstruct generic frames 2020-04-24 21:51:12 +03:00
Aaro Altonen 082372fba1 Merge RTP context configuration flags into one enum
Having separate enums for general configuration and media configuration
might be too confusing given that they are passed to kvzRTP using same
variable and the configuration values must not clash with each other
so the second enum's values would have to start from RCE_LAST which
might look weird
2020-04-24 21:51:12 +03:00
Aaro Altonen 8409706749 Create separate include directory
Create separate include directory which follows the kvzRTP include
style to make it easy for external applications to use kvzRTP
2020-04-22 04:58:41 +03:00