blob: 18efd826449ef1a11886a49e6662ebb8171c1310 [file] [log] [blame]
Danil Chapovalov398a7c62017-10-24 17:07:05 +02001/*
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 Chapovalova7e418c2017-11-21 11:08:53 +010016#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
Danil Chapovalov8c8d49e2017-10-30 15:21:41 +010017#include "rtc_base/task_queue.h"
18
Danil Chapovalov398a7c62017-10-24 17:07:05 +020019namespace webrtc {
20class ReceiveStatisticsProvider;
21class Transport;
22
23struct 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 Chapovalov78161ca2017-10-26 12:09:41 +020039 // Canonical End-Point Identifier of the local particiapnt.
40 // Defined in rfc3550 section 6 note 2 and section 6.5.1.
Danil Chapovalov398a7c62017-10-24 17:07:05 +020041 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 Chapovalov8c8d49e2017-10-30 15:21:41 +010049 // Queue for scheduling delayed tasks, e.g. sending periodic compound packets.
50 rtc::TaskQueue* task_queue = nullptr;
Danil Chapovalov398a7c62017-10-24 17:07:05 +020051
52 // Rtcp report block generator for outgoing receiver reports.
53 ReceiveStatisticsProvider* receive_statistics = nullptr;
Danil Chapovalov8c8d49e2017-10-30 15:21:41 +010054
Danil Chapovalov319a6752017-11-30 14:56:52 +010055 // 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 Chapovalova7e418c2017-11-21 11:08:53 +010059 // 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 Chapovalov8c8d49e2017-10-30 15:21:41 +010064 //
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 Chapovalov319a6752017-11-30 14:56:52 +010077 // 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 Chapovalov398a7c62017-10-24 17:07:05 +020080};
81
82} // namespace webrtc
83
84#endif // MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_CONFIG_H_