Commit Graph

34 Commits

Author SHA1 Message Date
Aaro Altonen b1ccd7f788 Increase MAX_PAYLOAD by 3 bytes
1443 is the maximum payload size for H26X Fragmentation Units but
for generic frames there is no NAL + FU header meaning the 3 bytes
can be used for payload data
2021-03-23 01:18:59 +02:00
Aaro Altonen c950179790 Implement RCC_DYN_PAYLOAD_TYPE
This change removes set_dynamic_payload() as ctx_configure() function
should be used for all context configuration instead of separate functions
for some configurations
2021-03-23 01:16:42 +02:00
Aaro Altonen ca66f6f8dc Implement RCC_PKT_MAX_DELAY 2021-03-23 01:16:42 +02:00
Aaro Altonen 755fe99d88 Implement RCE_H26X_PREPEND_SC 2021-03-23 01:16:42 +02:00
Aaro Altonen 2833161d3a Add support for H.266/VVC
This code is based on the most recent draft of VVC RTP payload
format and is subjet to changes as the draft evolves
2020-12-11 07:37:16 +02:00
Aaro Altonen 4253f636bf Remove the old HEVC receiver
This thread-based approach is no longer supported and optimistic
packet reception isn't possible to implement properly using the
new packet dispatcher architecture
2020-10-12 18:46:52 +03:00
Aaro Altonen 3541212cc1 Remove SEND_ONLY/RECV_ONLY options from media_stream
The media_stream object acts as uni-/bidirectional based on usage
so there is no need to explicitly define it as send/recv only
2020-10-09 04:09:07 +03:00
Aaro Altonen eea453efd6 Implement frame getter support for packet dispatcher
If a media format needs to return multiple frames, it can install
a frame getter that is called by the packet dispatcher until all
frames have been queried and returned to user.
2020-10-07 13:33:43 +03:00
Aaro Altonen 1ad489620e Implement cross-platform structure packing 2020-10-06 07:15:45 +03:00
Aaro Altonen 5374a79a28 Add support for H.264/AVC 2020-09-25 10:23:12 +03:00
Aaro Altonen d60b240341 Separate HEVC code into H265 and H26x
H26x shall contain all code common to H26{4,5,6} and H26{4,5,6}
files shall contain format-specific code which is mainly just
NAL unit fragmentation.

This commit also changes the HEVC RTP format name from RTP_FORMAT_HEVC
to RTP_FORMAT_H265 to unify naming with upcoming AVC/VVC support
2020-09-08 09:01:45 +03:00
Aaro Altonen 793ab80fce Implement packet replay protection 2020-09-04 09:17:15 +03:00
Aaro Altonen 2a4e45032a Implement Secure RTCP for Sender Reports 2020-09-03 12:03:50 +03:00
Aaro Altonen de3e72e97f Implement RCE_SRTP_INPLACE_ENCRYPTION
By default uvgRTP assumes that the memory it gets from user is not
writable and if user doesn't explictly specify that the memory
is writable (RCE_SRTP_INPLACE_ENCRYPTION) or that encryption is
not necessary (RCE_SRTP_NULL_CIPHER), a copy of the memory block is
made before it is pushed into the frame queue.
2020-09-02 12:30:30 +03:00
Aaro Altonen 7992224325 Move SET_NEXT_FIELD_32 to include/util.hh 2020-08-26 15:33:57 +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 494765a2fa Implement memdup() utility function 2020-08-04 10:16:38 +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 a5c8adde48 Create ZRTP packet handler 2020-08-01 15:15:53 +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 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 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 574592cb10 Make System Call Clustering optional 2020-05-28 12:41:08 +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 c2e7eb1bc1 Rename kvzRTP to uvgRTP 2020-04-28 11:18:07 +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