blob: 2a9e3d359e75b635ea7101d80204403196b69ccf [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_IMPL_H_
12#define MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_IMPL_H_
13
14#include <memory>
15#include <string>
16
17#include "api/array_view.h"
18#include "modules/rtp_rtcp/source/rtcp_transceiver_config.h"
19#include "rtc_base/constructormagic.h"
Danil Chapovalov8c8d49e2017-10-30 15:21:41 +010020#include "rtc_base/weak_ptr.h"
Danil Chapovalov398a7c62017-10-24 17:07:05 +020021
22namespace webrtc {
23//
24// Manage incoming and outgoing rtcp messages for multiple BUNDLED streams.
25//
26// This class is not thread-safe.
27class RtcpTransceiverImpl {
28 public:
29 explicit RtcpTransceiverImpl(const RtcpTransceiverConfig& config);
30 ~RtcpTransceiverImpl();
31
32 // Sends RTCP packets starting with a sender or receiver report.
33 void SendCompoundPacket();
34
35 private:
Danil Chapovalov8c8d49e2017-10-30 15:21:41 +010036 void ReschedulePeriodicCompoundPackets(int64_t delay_ms);
37 // Sends RTCP packets.
38 void SendPacket();
39
Danil Chapovalov398a7c62017-10-24 17:07:05 +020040 const RtcpTransceiverConfig config_;
41
Danil Chapovalov8c8d49e2017-10-30 15:21:41 +010042 rtc::WeakPtrFactory<RtcpTransceiverImpl> ptr_factory_;
43
Danil Chapovalov398a7c62017-10-24 17:07:05 +020044 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtcpTransceiverImpl);
45};
46
47} // namespace webrtc
48
49#endif // MODULES_RTP_RTCP_SOURCE_RTCP_TRANSCEIVER_IMPL_H_