uvgRTP 2.3.0
An open-source library for RTP/SRTP media delivery
Loading...
Searching...
No Matches
rtcp.hh
1#pragma once
2
3#include "clock.hh"
4#include "util.hh"
5#include "frame.hh"
6
7#ifdef _WIN32
8#include <ws2ipdef.h>
9#else
10#include <sys/socket.h>
11#include <netinet/in.h>
12#endif
13
14#include <bitset>
15#include <map>
16#include <thread>
17#include <vector>
18#include <functional>
19#include <memory>
20#include <mutex>
21#include <deque>
22#include <atomic>
23
24namespace uvgrtp {
25
26 class rtp;
27 class srtcp;
28 class socket;
29
30 typedef std::vector<std::pair<size_t, uint8_t*>> buf_vec; // also defined in socket.hh
31
33 enum RTCP_ROLE {
34 RECEIVER,
35 SENDER
36 };
37
38 struct sender_statistics {
39 /* sender stats */
40 uint32_t sent_pkts = 0; /* Number of sent RTP packets */
41 uint32_t sent_bytes = 0; /* Number of sent bytes excluding RTP Header */
42 bool sent_rtp_packet = false; // since last report
43 };
44
45 struct receiver_statistics {
46 /* receiver stats */
47 uint32_t received_pkts = 0; /* Number of packets received */
48 uint32_t lost_pkts = 0; /* Number of dropped RTP packets */
49 uint32_t received_bytes = 0; /* Number of bytes received excluding RTP Header */
50 bool received_rtp_packet = false; // since last report
51
52 uint32_t expected_pkts = 0; /* Number of expected packets */
53 uint32_t received_prior = 0; /* Number of received packets in last report */
54 uint32_t expected_prior = 0; /* Number of expected packets in last report */
55
56 double jitter = 0; /* The estimation of jitter (see RFC 3550 A.8) */
57 uint32_t transit = 0; /* TODO: */
58
59
60 /* Receiver clock related stuff */
61 uint64_t initial_ntp = 0; /* Wallclock reading when the first RTP packet was received */
62 uint32_t initial_rtp = 0; /* RTP timestamp of the first RTP packet received */
63 uint32_t clock_rate = 0; /* Rate of the clock (used for jitter calculations) */
64
65 uint32_t lsr = 0; /* Middle 32 bits of the 64-bit NTP timestamp of previous SR */
66 uvgrtp::clock::hrc::hrc_t sr_ts; /* When the last SR was received (used to calculate delay) */
67
68 uint16_t max_seq = 0; /* Highest sequence number received */
69 uint32_t base_seq = 0; /* First sequence number received */
70 uint32_t bad_seq = 0; /* TODO: */
71 uint16_t cycles = 0; /* Number of sequence cycles */
72 };
73
74 struct rtcp_participant {
75 struct receiver_statistics stats; /* RTCP session statistics of the participant */
76
77 uint32_t probation = 0; /* has the participant been fully accepted to the session */
78 int role = 0; /* is the participant a sender or a receiver */
79
80 /* Save the latest RTCP packets received from this participant
81 * Users can query these packets using the SSRC of participant */
82 uvgrtp::frame::rtcp_sender_report *sr_frame = nullptr;
83 uvgrtp::frame::rtcp_receiver_report *rr_frame = nullptr;
84 uvgrtp::frame::rtcp_sdes_packet *sdes_frame = nullptr;
85 uvgrtp::frame::rtcp_app_packet *app_frame = nullptr;
86 };
87
88 struct rtcp_app_packet {
89 rtcp_app_packet(const rtcp_app_packet& orig_packet) = delete;
90 rtcp_app_packet(const char* name, uint8_t subtype, uint32_t payload_len, std::unique_ptr<uint8_t[]> payload);
91 ~rtcp_app_packet();
92
93 const char* name;
94 uint8_t subtype;
95
96 uint32_t payload_len;
97 std::unique_ptr<uint8_t[]> payload;
98 };
100
118 class rtcp {
119 public:
121 rtcp(std::shared_ptr<uvgrtp::rtp> rtp, std::shared_ptr<std::atomic<std::uint32_t>> ssrc, std::string cname, int rce_flags);
122 rtcp(std::shared_ptr<uvgrtp::rtp> rtp, std::shared_ptr<std::atomic<std::uint32_t>> ssrc, std::string cname, std::shared_ptr<uvgrtp::srtcp> srtcp, int rce_flags);
123 ~rtcp();
124
125 /* start the RTCP runner thread
126 *
127 * return RTP_OK on success and RTP_MEMORY_ERROR if the allocation fails */
128 rtp_error_t start();
129
130 /* End the RTCP session and send RTCP BYE to all participants
131 *
132 * return RTP_OK on success */
133 rtp_error_t stop();
134
135 /* Generate either RTCP Sender or Receiver report and sent it to all participants
136 * Return RTP_OK on success and RTP_ERROR on error */
137 rtp_error_t generate_report();
138
139 /* Handle incoming RTCP packet (first make sure it's a valid RTCP packet)
140 * This function will call one of the above functions internally
141 *
142 * Return RTP_OK on success and RTP_ERROR on error */
143 rtp_error_t handle_incoming_packet(uint8_t *buffer, size_t size);
145
146 /* Send "frame" to all participants
147 *
148 * These routines will convert all necessary fields to network byte order
149 *
150 * Return RTP_OK on success
151 * Return RTP_INVALID_VALUE if "frame" is in some way invalid
152 * Return RTP_SEND_ERROR if sending "frame" did not succeed (see socket.hh for details) */
153
163 rtp_error_t send_sdes_packet(const std::vector<uvgrtp::frame::rtcp_sdes_item>& items);
164
177 rtp_error_t send_app_packet(const char *name, uint8_t subtype, uint32_t payload_len, const uint8_t *payload);
178
193 rtp_error_t send_bye_packet(std::vector<uint32_t> ssrcs);
194
196 /* Return the latest RTCP packet received from participant of "ssrc"
197 * Return nullptr if we haven't received this kind of packet or if "ssrc" doesn't exist
198 *
199 * NOTE: Caller is responsible for deallocating the memory */
200 uvgrtp::frame::rtcp_sender_report *get_sender_packet(uint32_t ssrc);
201 uvgrtp::frame::rtcp_receiver_report *get_receiver_packet(uint32_t ssrc);
202 uvgrtp::frame::rtcp_sdes_packet *get_sdes_packet(uint32_t ssrc);
203 uvgrtp::frame::rtcp_app_packet *get_app_packet(uint32_t ssrc);
204
205 /* Somebody joined the multicast group the owner of this RTCP instance is part of
206 * Add it to RTCP participant list so we can start listening for reports
207 *
208 * "clock_rate" tells how much the RTP timestamp advances, this information is needed
209 * to calculate the interarrival jitter correctly. It has nothing do with our clock rate,
210 * (or whether we're even sending anything)
211 *
212 * Return RTP_OK on success and RTP_ERROR on error */
213 rtp_error_t add_initial_participant(uint32_t clock_rate);
214
215 /* Functions for updating various RTP sender statistics */
216 void sender_update_stats(const uvgrtp::frame::rtp_frame *frame);
217
218 /* If we've detected that our SSRC has collided with someone else's SSRC, we need to
219 * generate new random SSRC and reinitialize our own RTCP state.
220 * RTCP object still has the participants of "last session", we can use their SSRCs
221 * to detected new collision
222 *
223 * Return RTP_OK if reinitialization succeeded
224 * Return RTP_SSRC_COLLISION if our new SSRC has collided and we need to generate new SSRC */
225 rtp_error_t reset_rtcp_state(uint32_t ssrc);
226
227 /* Update various session statistics */
228 void update_session_statistics(const uvgrtp::frame::rtp_frame *frame);
229
230 /* Getter for interval_ms_, which is calculated by set_session_bandwidth */
231 uint32_t get_rtcp_interval_ms() const;
232
233 /* Set RTCP packet transmission interval in milliseconds
234 *
235 * Return RTP_OK if interval was set successfully
236 * Return RTP_INVALID_VALUE if new interval is invalid */
237 rtp_error_t set_rtcp_interval_ms(int32_t new_interval);
238
239 /* Set total bandwidth for this session, called at the start
240 * If you want to set the interval manually later, use
241 * set_rtcp_interval_ms() function */
242 void set_session_bandwidth(uint32_t kbps);
243
244 std::shared_ptr<uvgrtp::socket> get_socket() const;
245
246 /* Store the following info in RTCP
247 * Local IP address
248 * Remote IP address
249 * Local port number for RTCP
250 * Destination port number for RTCP
251 * These are used when adding new participants and creating sockets for them */
252
253 rtp_error_t set_network_addresses(std::string local_addr, std::string remote_addr,
254 uint16_t local_port, uint16_t dst_port, bool ipv6);
255
256 /* Return SSRCs of all participants */
257 std::vector<uint32_t> get_participants() const;
259
274 void set_ts_info(uint64_t clock_start, uint32_t clock_rate, uint32_t rtp_ts_start);
275
276 /* Alternate way to get RTCP packets is to install a hook for them. So instead of
277 * polling an RTCP packet, user can install a function that is called when
278 * a specific RTCP packet is received. */
279
291
302 rtp_error_t install_sender_hook(std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_sender_report>)> sr_handler);
303
315
326 rtp_error_t install_receiver_hook(std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_receiver_report>)> rr_handler);
327
339
350 rtp_error_t install_sdes_hook(std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_sdes_packet>)> sdes_handler);
351
363
374 rtp_error_t install_app_hook(std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_app_packet>)> app_handler);
375
377 // These have been replaced by functions with unique_ptr in them
378 rtp_error_t install_sender_hook(std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_sender_report>)> sr_handler);
379 rtp_error_t install_receiver_hook(std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_receiver_report>)> rr_handler);
380 rtp_error_t install_sdes_hook(std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_sdes_packet>)> sdes_handler);
381 rtp_error_t install_app_hook(std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_app_packet>)> app_handler);
383
394 rtp_error_t install_send_app_hook(std::string app_name, std::function<std::unique_ptr<uint8_t[]>(uint8_t& subtype, uint32_t& payload_len)> app_sending_func);
395
403 rtp_error_t remove_all_hooks();
404
405 rtp_error_t remove_send_app_hook(std::string app_name);
406
408 /* Update RTCP-related sender statistics */
409 rtp_error_t update_sender_stats(size_t pkt_size);
410
411 /* Update RTCP-related receiver statistics */
412 static rtp_error_t recv_packet_handler(void *arg, int rce_flags, frame::rtp_frame **out);
413
414 /* Update RTCP-related sender statistics */
415 static rtp_error_t send_packet_handler_vec(void *arg, uvgrtp::buf_vec& buffers);
416
417 // the length field is the rtcp packet size measured in 32-bit words - 1
418 size_t rtcp_length_in_bytes(uint16_t length);
419
420 void set_payload_size(size_t mtu_size);
422
423 private:
424
425 rtp_error_t set_sdes_items(const std::vector<uvgrtp::frame::rtcp_sdes_item>& items);
426
427 uint32_t size_of_ready_app_packets() const;
428 uint32_t size_of_apps_from_hook(std::vector< std::shared_ptr<rtcp_app_packet>> packets) const;
429
430 uint32_t size_of_compound_packet(uint16_t reports,
431 bool sr_packet, bool rr_packet, bool sdes_packet, uint32_t app_size, bool bye_packet) const;
432
433 /* read the header values from rtcp packet */
434 void read_rtcp_header(const uint8_t* buffer, size_t& read_ptr,
436 void read_reports(const uint8_t* buffer, size_t& read_ptr, size_t packet_end, uint8_t count,
437 std::vector<uvgrtp::frame::rtcp_report_block>& reports);
438
439 void read_ssrc(const uint8_t* buffer, size_t& read_ptr, uint32_t& out_ssrc);
440
441 /* Handle different kinds of incoming rtcp packets. The read header is passed to functions
442 which read rest of the frame type specific data.
443 * Return RTP_OK on success and RTP_ERROR on error */
444 rtp_error_t handle_sender_report_packet(uint8_t* buffer, size_t& read_ptr, size_t packet_end,
446 rtp_error_t handle_receiver_report_packet(uint8_t* buffer, size_t& read_ptr, size_t packet_end,
448 rtp_error_t handle_sdes_packet(uint8_t* buffer, size_t& read_ptr, size_t packet_end,
449 uvgrtp::frame::rtcp_header& header, uint32_t sender_ssrc);
450 rtp_error_t handle_bye_packet(uint8_t* buffer, size_t& read_ptr,
452 rtp_error_t handle_app_packet(uint8_t* buffer, size_t& read_ptr, size_t packet_end,
454
455 static void rtcp_runner(rtcp *rtcp);
456
457 static void rtcp_report_reader(rtcp *rtcp);
458
459 /* when we start the RTCP instance, we don't know what the SSRC of the remote is
460 * when an RTP packet is received, we must check if we've already received a packet
461 * from this sender and if not, create new entry to receiver_stats_ map */
462 bool is_participant(uint32_t ssrc) const;
463
464 //TODO: Resolve collision??
465 /* When we receive an RTP or RTCP packet, we need to check the source address and see if it's
466 * the same address where we've received packets before.
467 *
468 * If the address is new, it means we have detected an SSRC collision and the paket should
469 * be dropped We also need to check whether this SSRC matches with our own SSRC and if it does
470 * we need to send RTCP BYE and rejoin to the session */
471 bool collision_detected(uint32_t ssrc) const;
472
473 /* Move participant from initial_peers_ to participants_ */
474 rtp_error_t add_participant(uint32_t ssrc);
475
476 /* We've got a message from new source (the SSRC of the frame is not known to us)
477 * Initialize statistics for the peer and move it to participants_ */
478 rtp_error_t init_new_participant(const uvgrtp::frame::rtp_frame *frame);
479
480 /* Initialize the RTP Sequence related stuff of peer
481 * This function assumes that the peer already exists in the participants_ map */
482 rtp_error_t init_participant_seq(uint32_t ssrc, uint16_t base_seq);
483
484 /* Update the SSRC's sequence related data in participants_ map
485 *
486 * Return RTP_OK if the received packet was OK
487 * Return RTP_GENERIC_ERROR if it wasn't and
488 * packet-related statistics should not be updated */
489 rtp_error_t update_participant_seq(uint32_t ssrc, uint16_t seq);
490
491 /* Update the RTCP bandwidth variables
492 *
493 * "pkt_size" tells how much rtcp_byte_count_
494 * should be increased before calculating the new average */
495 void update_rtcp_bandwidth(size_t pkt_size);
496
497 /* Update average RTCP packet size variable
498 * packet_size is the size of received RTCP packet in octets */
499 void update_avg_rtcp_size(uint64_t packet_size);
500
501 /* Calculate the RTCP report interval in seconds
502 * rtcp_bw is given in kbps
503 * Defined in RFC3550 Appendix A.7 */
504 double rtcp_interval(int members, int senders,
505 double rtcp_bw, bool we_sent, double avg_rtcp_size, bool red_min, bool randomisation);
506
507 /* RTCP runner keeps track of ssrcs and how long they have been silent.
508 * By default a source get timed out if it has been silent for 25 seconds
509 * If an ssrc is timed out, this function removes it from participants_ map and
510 * updates any other infos */
511 rtp_error_t remove_timeout_ssrc(uint32_t ssrc);
512
513 /* Because struct statistics contains uvgRTP clock object we cannot
514 * zero it out without compiler complaining about it so all the fields
515 * must be set to zero manually */
516 void zero_stats(uvgrtp::sender_statistics *stats);
517
518 void zero_stats(uvgrtp::receiver_statistics *stats);
519
520 /* Takes ownership of the frame */
521 rtp_error_t send_rtcp_packet_to_participants(uint8_t* frame, uint32_t frame_size, bool encrypt);
522
523 void free_participant(std::unique_ptr<rtcp_participant> participant);
524
525 void cleanup_participants();
526
527 /* Secure RTCP context */
528 std::shared_ptr<uvgrtp::srtcp> srtcp_;
529
530 /* RTP context flags */
531 int rce_flags_;
532
533 /* are we a sender (and possible a receiver) or just a receiver */
534 int our_role_;
535
536 /* TODO: time_t?? */
537 // TODO: Check these, they don't seem to be used
538 size_t tp_; /* the last time an RTCP packet was transmitted */
539 size_t tc_; /* the current time */
540 size_t tn_; /* the next scheduled transmission time of an RTCP packet */
541 size_t pmembers_; /* the estimated number of session members at the time tn was last recomputed */
542 size_t members_; /* the most current estimate for the number of session members */
543 size_t senders_; /* the most current estimate for the number of senders in the session */
544
545 /* Total session bandwidth. RTCP bandwidth will be set to 5 % of this */
546 uint32_t total_bandwidth_;
547
548 /* The target RTCP bandwidth, i.e., the total bandwidth
549 * that will be used for RTCP packets by all members of this session,
550 * in octets per second. This will be a specified fraction of the
551 * "session bandwidth" parameter supplied to the application at startup. */
552 double rtcp_bandwidth_;
553
554 /* "Minimum" value for RTCP transmission interval, depends on the session bandwidth
555 * Actual interval can be 50 % smaller due to randomisation */
556 uint32_t reduced_minimum_;
557
558 /* Flag that is true if the application has sent data since
559 * the 2nd previous RTCP report was transmitted. */
560 // TODO: Only set, never read
561 bool we_sent_;
562
563 /* Store sender and receiver info, this is needed when calling
564 * add_participant dynamically (i.e. after initializing the stream) */
565 std::string local_addr_;
566 std::string remote_addr_;
567 uint16_t local_port_;
568 uint16_t dst_port_;
569
570 /* The average compound RTCP packet size, in octets,
571 * over all RTCP packets sent and received by this participant. The
572 * size includes lower-layer transport and network protocol headers
573 * (e.g., UDP and IP) as explained in Section 6.2 */
574 // TODO: Only set, never read
575 size_t avg_rtcp_pkt_pize_;
576
577 /* Average RTCP packet size in octets.
578 * Initialized to 64 */
579 uint64_t avg_rtcp_size_;
580
581 /* Number of RTCP packets and bytes sent and received by this participant */
582 // TODO: Only set, never read
583 size_t rtcp_pkt_count_;
584 size_t rtcp_byte_count_;
585
586 /* Number of RTCP packets sent */
587 uint32_t rtcp_pkt_sent_count_;
588
589 /* Flag that is true if the application has not yet sent an RTCP packet. */
590 // TODO: Only set, never read
591 bool initial_;
592
593 /* Copy of our own current SSRC */
594 std::shared_ptr<std::atomic_uint> ssrc_;
595
596 /* NTP timestamp associated with initial RTP timestamp (aka t = 0) */
597 uint64_t clock_start_;
598
599 /* Clock rate of the media ie. how fast does the time increase */
600 uint32_t clock_rate_;
601
602 /* The first value of RTP timestamp (aka t = 0) */
603 uint32_t rtp_ts_start_;
604
605 std::map<uint32_t, std::unique_ptr<rtcp_participant>> participants_;
606 uint8_t num_receivers_; // maximum is 32 at the moment (5 bits)
607 bool ipv6_;
608
609 /* Address of the socket that we are sending data to */
610 sockaddr_in socket_address_;
611 sockaddr_in6 socket_address_ipv6_;
612
613
614 /* Map for keeping track of sources for timeouts
615 * First number is the sources ssrc
616 * Second number is how many milliseconds it has been silent*/
617 std::map<uint32_t, uint32_t> ms_since_last_rep_;
618
619 /* statistics for RTCP Sender and Receiver Reports */
620 struct sender_statistics our_stats;
621
622 /* If we expect frames from remote but haven't received anything from remote yet,
623 * the participant resides in this vector until he's moved to participants_ */
624 std::vector<std::unique_ptr<rtcp_participant>> initial_participants_;
625
626
627
628 void (*sender_hook_)(uvgrtp::frame::rtcp_sender_report *);
629 void (*receiver_hook_)(uvgrtp::frame::rtcp_receiver_report *);
630 void (*sdes_hook_)(uvgrtp::frame::rtcp_sdes_packet *);
631 void (*app_hook_)(uvgrtp::frame::rtcp_app_packet *);
632
633 std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_sender_report>)> sr_hook_f_;
634 std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_sender_report>)> sr_hook_u_;
635 std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_receiver_report>)> rr_hook_f_;
636 std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_receiver_report>)> rr_hook_u_;
637 std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_sdes_packet>)> sdes_hook_f_;
638 std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_sdes_packet>)> sdes_hook_u_;
639 std::function<void(std::shared_ptr<uvgrtp::frame::rtcp_app_packet>)> app_hook_f_;
640 std::function<void(std::unique_ptr<uvgrtp::frame::rtcp_app_packet>)> app_hook_u_;
641
642 std::mutex sr_mutex_;
643 std::mutex rr_mutex_;
644 std::mutex sdes_mutex_;
645 std::mutex app_mutex_;
646 mutable std::mutex participants_mutex_;
647 std::mutex send_app_mutex_;
648
649 std::unique_ptr<std::thread> report_generator_;
650 std::unique_ptr<std::thread> report_reader_;
651 std::shared_ptr<uvgrtp::socket> rtcp_socket_;
652
653 bool is_active() const
654 {
655 return active_;
656 }
657
658 bool active_;
659
660 std::atomic<uint32_t> interval_ms_;
661
662 std::shared_ptr<uvgrtp::rtp> rtp_ptr_;
663
664 std::mutex packet_mutex_;
665
666 // messages waiting to be sent
667 std::vector<uvgrtp::frame::rtcp_sdes_item> ourItems_; // always sent
668 std::vector<uint32_t> bye_ssrcs_; // sent once
669
670 std::map<std::string, std::deque<rtcp_app_packet>> app_packets_; // sent one at a time per name
671 // APPs for hook
672 std::multimap<std::string, std::function <std::unique_ptr<uint8_t[]>(uint8_t& subtype, uint32_t& payload_len)>> outgoing_app_hooks_;
673
674 bool hooked_app_;
675
676
678 char cname_[255];
679
680 size_t mtu_size_;
681 };
682}
683
684namespace uvg_rtp = uvgrtp;
RTCP instance handles all incoming and outgoing RTCP traffic, including report generation.
Definition: rtcp.hh:118
rtp_error_t install_receiver_hook(void(*hook)(uvgrtp::frame::rtcp_receiver_report *))
Install an RTCP Receiver Report hook.
rtp_error_t send_app_packet(const char *name, uint8_t subtype, uint32_t payload_len, const uint8_t *payload)
Send an RTCP APP packet.
rtp_error_t install_receiver_hook(std::function< void(std::unique_ptr< uvgrtp::frame::rtcp_receiver_report >)> rr_handler)
Install an RTCP Receiver Report hook.
rtp_error_t send_bye_packet(std::vector< uint32_t > ssrcs)
Send an RTCP BYE packet.
rtp_error_t install_sdes_hook(std::function< void(std::unique_ptr< uvgrtp::frame::rtcp_sdes_packet >)> sdes_handler)
Install an RTCP SDES packet hook.
rtp_error_t install_sender_hook(void(*hook)(uvgrtp::frame::rtcp_sender_report *))
Install an RTCP Sender Report hook.
void set_ts_info(uint64_t clock_start, uint32_t clock_rate, uint32_t rtp_ts_start)
Provide timestamping information for RTCP.
rtp_error_t send_sdes_packet(const std::vector< uvgrtp::frame::rtcp_sdes_item > &items)
Send an RTCP SDES packet.
rtp_error_t install_app_hook(std::function< void(std::unique_ptr< uvgrtp::frame::rtcp_app_packet >)> app_handler)
Install an RTCP APP packet hook.
rtp_error_t install_sender_hook(std::function< void(std::unique_ptr< uvgrtp::frame::rtcp_sender_report >)> sr_handler)
Install an RTCP Sender Report hook.
rtp_error_t remove_all_hooks()
Remove all installed hooks for RTCP.
rtp_error_t install_app_hook(void(*hook)(uvgrtp::frame::rtcp_app_packet *))
Install an RTCP APP packet hook.
rtp_error_t install_send_app_hook(std::string app_name, std::function< std::unique_ptr< uint8_t[]>(uint8_t &subtype, uint32_t &payload_len)> app_sending_func)
Install hook for one type of APP packets.
rtp_error_t install_sdes_hook(void(*hook)(uvgrtp::frame::rtcp_sdes_packet *))
Install an RTCP SDES packet hook.
See RFC 3550 section 6.7
Definition: frame.hh:151
Header of for all RTCP packets defined in RFC 3550 section 6
Definition: frame.hh:74
See RFC 3550 section 6.4.2
Definition: frame.hh:117
See RFC 3550 section 6.5
Definition: frame.hh:132
See RFC 3550 section 6.5
Definition: frame.hh:145
See RFC 3550 section 6.4.1
Definition: frame.hh:124
See RFC 3550 section 5
Definition: frame.hh:53