Danil Chapovalov | 398a7c6 | 2017-10-24 17:07:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_CONFIG_H_ |
| 12 | #define MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_CONFIG_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | |
Danil Chapovalov | a7e418c | 2017-11-21 11:08:53 +0100 | [diff] [blame] | 16 | #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
Danil Chapovalov | 8c8d49e | 2017-10-30 15:21:41 +0100 | [diff] [blame] | 17 | #include "rtc_base/task_queue.h" |
| 18 | |
Danil Chapovalov | 398a7c6 | 2017-10-24 17:07:05 +0200 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | class ReceiveStatisticsProvider; |
| 21 | class Transport; |
| 22 | |
| 23 | struct RtcpTransceiverConfig { |
| 24 | RtcpTransceiverConfig(); |
| 25 | RtcpTransceiverConfig(const RtcpTransceiverConfig&); |
| 26 | RtcpTransceiverConfig& operator=(const RtcpTransceiverConfig&); |
| 27 | ~RtcpTransceiverConfig(); |
| 28 | |
| 29 | // Logs the error and returns false if configuration miss key objects or |
| 30 | // is inconsistant. May log warnings. |
| 31 | bool Validate() const; |
| 32 | |
| 33 | // Used to prepend all log messages. Can be empty. |
| 34 | std::string debug_id; |
| 35 | |
| 36 | // Ssrc to use as default sender ssrc, e.g. for transport-wide feedbacks. |
| 37 | uint32_t feedback_ssrc = 1; |
| 38 | |
Danil Chapovalov | 78161ca | 2017-10-26 12:09:41 +0200 | [diff] [blame] | 39 | // Canonical End-Point Identifier of the local particiapnt. |
| 40 | // Defined in rfc3550 section 6 note 2 and section 6.5.1. |
Danil Chapovalov | 398a7c6 | 2017-10-24 17:07:05 +0200 | [diff] [blame] | 41 | std::string cname; |
| 42 | |
| 43 | // Maximum packet size outgoing transport accepts. |
| 44 | size_t max_packet_size = 1200; |
| 45 | |
| 46 | // Transport to send rtcp packets to. Should be set. |
| 47 | Transport* outgoing_transport = nullptr; |
| 48 | |
Danil Chapovalov | 8c8d49e | 2017-10-30 15:21:41 +0100 | [diff] [blame] | 49 | // Queue for scheduling delayed tasks, e.g. sending periodic compound packets. |
| 50 | rtc::TaskQueue* task_queue = nullptr; |
Danil Chapovalov | 398a7c6 | 2017-10-24 17:07:05 +0200 | [diff] [blame] | 51 | |
| 52 | // Rtcp report block generator for outgoing receiver reports. |
| 53 | ReceiveStatisticsProvider* receive_statistics = nullptr; |
Danil Chapovalov | 8c8d49e | 2017-10-30 15:21:41 +0100 | [diff] [blame] | 54 | |
Danil Chapovalov | 319a675 | 2017-11-30 14:56:52 +0100 | [diff] [blame] | 55 | // Callback to pass result of rtt calculation. Should outlive RtcpTransceiver. |
| 56 | // Callbacks will be invoked on the task_queue. |
| 57 | RtcpRttStats* rtt_observer = nullptr; |
| 58 | |
Danil Chapovalov | a7e418c | 2017-11-21 11:08:53 +0100 | [diff] [blame] | 59 | // Configures if sending should |
| 60 | // enforce compound packets: https://tools.ietf.org/html/rfc4585#section-3.1 |
| 61 | // or allow reduced size packets: https://tools.ietf.org/html/rfc5506 |
| 62 | // Receiving accepts both compound and reduced-size packets. |
| 63 | RtcpMode rtcp_mode = RtcpMode::kCompound; |
Danil Chapovalov | 8c8d49e | 2017-10-30 15:21:41 +0100 | [diff] [blame] | 64 | // |
| 65 | // Tuning parameters. |
| 66 | // |
| 67 | // Delay before 1st periodic compound packet. |
| 68 | int initial_report_delay_ms = 500; |
| 69 | |
| 70 | // Period between periodic compound packets. |
| 71 | int report_period_ms = 1000; |
| 72 | |
| 73 | // |
| 74 | // Flags for features and experiments. |
| 75 | // |
| 76 | bool schedule_periodic_compound_packets = true; |
Danil Chapovalov | 319a675 | 2017-11-30 14:56:52 +0100 | [diff] [blame] | 77 | // Estimate RTT as non-sender as described in |
| 78 | // https://tools.ietf.org/html/rfc3611#section-4.4 and #section-4.5 |
| 79 | bool non_sender_rtt_measurement = false; |
Danil Chapovalov | 398a7c6 | 2017-10-24 17:07:05 +0200 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | } // namespace webrtc |
| 83 | |
| 84 | #endif // MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_CONFIG_H_ |