12 #ifndef ROC_RTCP_COMMUNICATOR_H_
13 #define ROC_RTCP_COMMUNICATOR_H_
100 enum PacketType { PacketType_Reports, PacketType_Goodbye };
102 void process_all_descriptions_(
const Traverser& traverser);
103 void process_all_reports_(
const Traverser& traverser);
104 void process_all_goodbyes_(
const Traverser& traverser);
110 void process_extended_report_(
const XrTraverser& xr);
113 PacketType packet_type);
117 bool continue_packet_generation_();
120 bool next_send_stream_(
size_t new_stream_index);
121 bool next_recv_stream_(
size_t new_stream_index);
129 void generate_reports_payload_(
Builder& bld);
130 void generate_goodbye_payload_(
Builder& bld);
132 void generate_standard_report_(
Builder& bld);
133 void generate_extended_report_(
Builder& bld);
134 void generate_empty_report_(
Builder& bld);
135 void generate_description_(
Builder& bld);
136 void generate_goodbye_(
Builder& bld);
151 size_t dest_addr_count_;
152 size_t dest_addr_index_;
154 size_t send_stream_count_;
155 size_t send_stream_index_;
156 size_t recv_stream_count_;
157 size_t recv_stream_index_;
161 size_t max_pkt_streams_;
162 size_t cur_pkt_send_stream_;
163 size_t cur_pkt_recv_stream_;
167 size_t processed_packet_count_;
168 size_t generated_packet_count_;
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Base class for non-copyable objects.
Packet composer interface.
RTCP compound packet builder.
core::nanoseconds_t generation_deadline(core::nanoseconds_t current_time)
When we should generate packets next time. Returns absolute time. current_time is current time in nan...
ROC_ATTR_NODISCARD status::StatusCode generate_goodbye(core::nanoseconds_t current_time)
Generate and send goodbye packet(s). Should be called before termination sender session....
Communicator(const Config &config, IParticipant &participant, packet::IWriter &packet_writer, packet::IComposer &packet_composer, packet::PacketFactory &packet_factory, core::IArena &arena)
Initialize.
bool is_valid() const
Check if initialization succeeded.
size_t total_streams() const
Get number of tracked streams, for testing.
size_t total_destinations() const
Get number of tracked destination addresses, for testing.
ROC_ATTR_NODISCARD status::StatusCode process_packet(const packet::PacketPtr &packet, core::nanoseconds_t current_time)
Parse and process incoming packet. Invokes IParticipant methods during processing.
ROC_ATTR_NODISCARD status::StatusCode generate_reports(core::nanoseconds_t current_time)
Generate and send report packet(s). Should be called according to generation_deadline()....
RTCP report processor and generator.
RTCP compound packet traverser.
Packet composer interface.
int64_t nanoseconds_t
Nanoseconds.
Commonly used types and functions.