blob: 39fcaa76140e9defdb717e8afd3005d60a40e580 [file] [log] [blame]
brandtr7250b392016-12-19 01:13:46 -08001/*
2 * Copyright (c) 2016 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 WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
12#define WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
13
14#include <memory>
brandtr7250b392016-12-19 01:13:46 -080015
brandtr7250b392016-12-19 01:13:46 -080016#include "webrtc/base/criticalsection.h"
17#include "webrtc/call/flexfec_receive_stream.h"
nissee4bcd6d2017-05-16 04:47:04 -070018#include "webrtc/call/rtp_demuxer.h"
brandtr7250b392016-12-19 01:13:46 -080019
20namespace webrtc {
21
brandtrfa5a3682017-01-17 01:33:54 -080022class FlexfecReceiver;
23class ProcessThread;
24class ReceiveStatistics;
25class RecoveredPacketReceiver;
26class RtcpRttStats;
27class RtpPacketReceived;
28class RtpRtcp;
29
nissee4bcd6d2017-05-16 04:47:04 -070030class FlexfecReceiveStreamImpl : public FlexfecReceiveStream,
31 public RtpPacketSinkInterface {
brandtr7250b392016-12-19 01:13:46 -080032 public:
33 FlexfecReceiveStreamImpl(const Config& config,
brandtrfa5a3682017-01-17 01:33:54 -080034 RecoveredPacketReceiver* recovered_packet_receiver,
35 RtcpRttStats* rtt_stats,
36 ProcessThread* process_thread);
brandtr7250b392016-12-19 01:13:46 -080037 ~FlexfecReceiveStreamImpl() override;
38
brandtrb29e6522016-12-21 06:37:18 -080039 const Config& GetConfig() const { return config_; }
40
nissee4bcd6d2017-05-16 04:47:04 -070041 // RtpPacketSinkInterface.
42 void OnRtpPacket(const RtpPacketReceived& packet) override;
brandtr7250b392016-12-19 01:13:46 -080043
44 // Implements FlexfecReceiveStream.
45 void Start() override;
46 void Stop() override;
47 Stats GetStats() const override;
48
49 private:
brandtrfa5a3682017-01-17 01:33:54 -080050 // Config.
brandtr7250b392016-12-19 01:13:46 -080051 const Config config_;
brandtrfa5a3682017-01-17 01:33:54 -080052 bool started_ GUARDED_BY(crit_);
53 rtc::CriticalSection crit_;
54
55 // Erasure code interfacing.
brandtr7250b392016-12-19 01:13:46 -080056 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrfa5a3682017-01-17 01:33:54 -080057
58 // RTCP reporting.
59 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
60 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
61 ProcessThread* process_thread_;
brandtr7250b392016-12-19 01:13:46 -080062};
63
64} // namespace webrtc
65
66#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_