blob: 705182906cd060c6737b4f8ee76a338e4d32b7ca [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"
brandtr7250b392016-12-19 01:13:46 -080018
19namespace webrtc {
20
brandtrfa5a3682017-01-17 01:33:54 -080021class FlexfecReceiver;
22class ProcessThread;
23class ReceiveStatistics;
24class RecoveredPacketReceiver;
25class RtcpRttStats;
26class RtpPacketReceived;
27class RtpRtcp;
28
brandtr7250b392016-12-19 01:13:46 -080029class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
30 public:
31 FlexfecReceiveStreamImpl(const Config& config,
brandtrfa5a3682017-01-17 01:33:54 -080032 RecoveredPacketReceiver* recovered_packet_receiver,
33 RtcpRttStats* rtt_stats,
34 ProcessThread* process_thread);
brandtr7250b392016-12-19 01:13:46 -080035 ~FlexfecReceiveStreamImpl() override;
36
brandtrb29e6522016-12-21 06:37:18 -080037 const Config& GetConfig() const { return config_; }
38
nisse5c29a7a2017-02-16 06:52:32 -080039 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface.
40 void OnRtpPacket(const RtpPacketReceived& packet);
brandtr7250b392016-12-19 01:13:46 -080041
42 // Implements FlexfecReceiveStream.
43 void Start() override;
44 void Stop() override;
45 Stats GetStats() const override;
46
47 private:
brandtrfa5a3682017-01-17 01:33:54 -080048 // Config.
brandtr7250b392016-12-19 01:13:46 -080049 const Config config_;
brandtrfa5a3682017-01-17 01:33:54 -080050 bool started_ GUARDED_BY(crit_);
51 rtc::CriticalSection crit_;
52
53 // Erasure code interfacing.
brandtr7250b392016-12-19 01:13:46 -080054 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrfa5a3682017-01-17 01:33:54 -080055
56 // RTCP reporting.
57 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
58 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
59 ProcessThread* process_thread_;
brandtr7250b392016-12-19 01:13:46 -080060};
61
62} // namespace webrtc
63
64#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_