Commit Graph

28 Commits

Author SHA1 Message Date
Aaro Altonen 6e53f686f9 rtcp: Extract fraction and lost fields correctly from the report 2021-04-22 13:25:04 +03:00
Aaro Altonen 0806522ab9 doc: Add documentation for RTCP 2021-04-19 12:15:23 +03:00
Aaro Altonen c2e6207698 Document set_ts_info() 2021-03-23 01:19:47 +02:00
Aaro Altonen 0e12e57a47 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
2021-03-23 01:18:59 +02:00
Aaro Altonen 13989c66f1 Add Doxygen documentation support
Some of the API is still undocumented
2021-03-23 01:18:59 +02:00
Aaro Altonen 2a4e45032a Implement Secure RTCP for Sender Reports 2020-09-03 12:03:50 +03:00
Aaro Altonen bb826570ef Separate Secure RTP code into SRTP and SRTCP
Create separate classes for SRTP and SRTCP because even though
they are quite similar, they require some different actions when
en/decrypting the packets and create a whole bunch of if-elses
is ugly
2020-09-02 10:07:20 +03:00
Aaro Altonen be74a58ab1 Remove terminate_self()
This function no longer serves any purpose
2020-08-26 15:54:47 +03:00
Aaro Altonen 8f55079e62 Fix RTCP BYE generation/reception code
Operate on a raw block of memory and remove all participants from
the active session that are indicated in the BYE packet by their SSRCs
2020-08-26 15:52:19 +03:00
Aaro Altonen e586a007be Fix RTCP APP generation/reception code
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the APP packet that
can be queried using SSRC

Caller must remember to free the memory occupied by the APP payload
2020-08-26 15:36:56 +03:00
Aaro Altonen 2807ccc83b Fix RTCP SDES generation/reception code
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the SDES packet that
can be queried using SSRC

Caller must remember to free the memory occupied by the SDES items
2020-08-26 15:34:06 +03:00
Aaro Altonen 49575ed1ca Fix RTCP Sender Report generation/reception code
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the Sender Report that
can be queried using SSRC
2020-08-26 15:33:59 +03:00
Aaro Altonen fc117e6eba Fix RTCP Receiver Report reception code
Craft user-friendly rtcp_receiver_report struct from the raw
message which can be fetched using SSRC
2020-08-26 15:33:52 +03:00
Aaro Altonen 47b17bb1d1 Handle incoming RTCP reports as raw memory blocks
PACKED_STRUCT is quite an ugly hack if it must be cross-platform
so better to process the incoming (and soon outgoing) RTCP data
as raw memory and craft user-friendly RTCP packets from those
memory blocks which do not including strict padding or truncated fields.
2020-08-26 07:33:02 +03:00
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 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 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 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 c2e7eb1bc1 Rename kvzRTP to uvgRTP 2020-04-28 11:18:07 +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