Commit Graph

488 Commits

Author SHA1 Message Date
Aaro Altonen a946ffcb2a Give the timestamp info after the first RTP packet to RTCP
Previously the information was given too early which meant that
RTCP used incorrect information when calculating the RTP timestamps
for RTCP Sender Reports
2019-06-27 09:33:46 +03:00
Aaro Altonen 52fccc96fa Send Sender Reports to all participant
The code erroneously send the reports to other senders only
2019-06-27 08:58:06 +03:00
Aaro Altonen 2d210ea6cd Send RTCP status reports every 5 seconds
5 seconds is the mimimum interval betwen RTCP packets required by
the spec. Some time in the future a better scheduling algorithm
will be implemented for RTCP reports
2019-06-27 08:53:43 +03:00
Aaro Altonen 96ff8b6d4f Give correct RTCP payload type for Sender Reports 2019-06-27 08:20:03 +03:00
Aaro Altonen 0b80d87d33 Give RTCP initial NTP and RTP timestamps + clock rate
These values are for calculating timestamps for Sender Reports
2019-06-26 12:43:36 +03:00
Aaro Altonen f19fdbda7b Calculate RTP timestamp properly
Generating NTP and random RTP timestamp allows us to sync different
media streams and provide useful RTP timestamps for RTCP Sender Reports
2019-06-26 12:32:08 +03:00
Aaro Altonen 00bca33585 Add clock_rate_ variable for RTP timestamp calculations
Clock rate varies based on the the media sent and it's used to
calculate the RTP timestamp from t = 0 time
2019-06-26 12:30:17 +03:00
Aaro Altonen 914bcf1f8d Calculate an estimate for number of dropped packets 2019-06-26 11:07:18 +03:00
Aaro Altonen 6115a05eb9 Increase the amount of senders when participant is initialized 2019-06-26 11:07:18 +03:00
Aaro Altonen 0e68f89777 Add winsock poll implementation
The code has not been tested
2019-06-26 11:07:18 +03:00
Aaro Altonen c17b6e3259 Create CNAME for every RTCP instance 2019-06-26 11:07:15 +03:00
Aaro Altonen 864989570e Use received_bytes/_pkts field for incoming frame statistics 2019-06-25 11:23:32 +03:00
Aaro Altonen 32098f1a2c Create Receiver Report Blocks for other senders only in Sender Report 2019-06-25 11:10:00 +03:00
Aaro Altonen 3868fe83d9 Remove the constraint where Sender Report must contain Receiver Report Blocks
The session may consist of single writer and multiple readers. In this
case it must still be possible to send RTCP status reports to readers.
2019-06-25 11:03:41 +03:00
Aaro Altonen 74534494ab Include the size of SSRC when allocating Report frames 2019-06-25 11:02:03 +03:00
Aaro Altonen 2eb45047d2 Set the recv_buffer_len_ to correct length 2019-06-25 11:01:36 +03:00
Aaro Altonen 87ad9e4688 Call delete[] instead of delete when freeing arrays 2019-06-25 11:01:04 +03:00
Aaro Altonen 6342ba24cb Rename functions more logically
Use only the word "participant" and not both "peer" and "participant"
2019-06-25 09:46:00 +03:00
Aaro Altonen 0c7b3da4e4 Remove set_sender_ssrc()
It is no longer used because the status of the sender is checked
on every RTP packet
2019-06-25 09:40:16 +03:00
Aaro Altonen 2b6e2ba2c1 Update the sequence properly after each packet 2019-06-25 09:37:10 +03:00
Aaro Altonen 7621b59515 Return the actual return value instead of just RTP_OK 2019-06-24 11:40:59 +03:00
Aaro Altonen 97d7691ba2 Remove the check for first message in reader.cc
RTCP keeps a list of participating members and will do necessary
initializations if this is a first message from a peer
2019-06-24 11:37:44 +03:00
Aaro Altonen 2fe24c26b4 Update RTP Sequence cycle count if the sequence wraps around 2019-06-24 08:54:22 +03:00
Aaro Altonen a28a932b84 Give SSRC to RTCP when creating the object 2019-06-24 08:53:13 +03:00
Aaro Altonen 18ef00c99e Use one function to update all session statistics 2019-06-24 08:51:58 +03:00
Aaro Altonen 3f5bd6a020 Add RTCP example code 2019-06-24 07:44:29 +03:00
Aaro Altonen 3546ea11db Fix memory leak in Sender/Receiver Report generators 2019-06-20 13:13:01 +03:00
Aaro Altonen 2058cec187 Check has the RTCP instance received any messages from remote
If we haven't received any message, it's impossible to include the
correct SSRC to RTCP packets. Thus we should return early if the
session doesn't have any participants
2019-06-20 13:12:25 +03:00
Aaro Altonen 5d313d47f2 Give SSRC to RTCP 2019-06-20 13:09:36 +03:00
Aaro Altonen 15c765c39e Implement RTCP BYE functionality
Participant is removed from the map and all memory is released
2019-06-20 11:40:58 +03:00
Aaro Altonen bbd5d0f46b Update RTCP bandwidth statistics after each packet 2019-06-20 11:36:39 +03:00
Aaro Altonen bb2e256b77 Remove some warnings 2019-06-20 10:16:38 +03:00
Aaro Altonen 3b169d5d74 Check if the sender of Receiver Report is already a participant 2019-06-20 10:03:01 +03:00
Aaro Altonen cc182467ca Rename is_valid_sender() to is_participant()
The previous name was misleading because not all participant are
senders
2019-06-20 09:49:05 +03:00
Aaro Altonen c3d9f5f504 Increase the number of participants when the first message is received 2019-06-20 09:42:07 +03:00
Aaro Altonen 57aef595a1 Add missing files to Qt project file 2019-06-20 09:27:28 +03:00
Aaro Altonen c5b12ef4f4 Add support for multiple RTCP participants
This is preliminary support for multicast groups
2019-06-20 09:25:01 +03:00
Aaro Altonen 40c619d12b Add poll functionality
This is used by RTCP to listen to multiple sockets at a time.
Winsock implementation is missing
2019-06-20 09:22:53 +03:00
Aaro Altonen 7a325e8600 Add multicast files 2019-06-20 09:22:10 +03:00
Aaro Altonen 44e6655c68 Remove some of the RTP session statistics functions
They gathered unused information (ie. not required by the spec)
so they can be removed
2019-06-20 08:36:44 +03:00
Aaro Altonen 9088f9c6d2 Overload recvfrom() to accept sender and bytes_read parameters
If the caller doesn't need them, he can just call one of the overloaded
functions
2019-06-19 09:26:04 +03:00
Aaro Altonen 6075c7bdbc Add overloaded sendto() which doesn't take the bytes_sent parameter 2019-06-19 09:16:57 +03:00
Aaro Altonen ea1db5338f Add RTCP packet handling functions for all packet types
Most of the functions don't do much just yet because we don't have
an API for the user for querying RTCP reports etc.
2019-06-19 08:09:28 +03:00
Aaro Altonen 94117e95d8 Add APP/BYE/SDES sending routines
These functions convert the fields of the input frame to network byte order
and sent it to remote
2019-06-19 08:09:28 +03:00
Aaro Altonen f0c265f820 Create sendto() function that accepts remote address as parameter 2019-06-19 08:09:22 +03:00
Aaro Altonen f55b53ff51 Add documentation for the socket API 2019-06-18 11:19:49 +03:00
Aaro Altonen c062384394 Make sure the socket family is AF_INET
Only IPv4 addresses are supported for now
2019-06-18 10:59:54 +03:00
Aaro Altonen 72157a7e6b Don't deallocate the frame parameter
We don't know if it's allocated on the heap or the stack
so deallocating it is dangerous
2019-06-18 10:32:34 +03:00
Aaro Altonen a0a60d1972 Rename report_cnt to count in RTCP header
Different packets have different counts (not all packets contain reports),
so the name was misleading
2019-06-18 10:29:31 +03:00
Aaro Altonen 6eb08dece8 Add missing (de)allocation routines for BYE/APP/SDES packets 2019-06-18 09:55:45 +03:00