blob: 705182906cd060c6737b4f8ee76a338e4d32b7ca [file] [log] [blame]
brandtr02a64312016-12-19 09:13:461/*
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>
brandtr02a64312016-12-19 09:13:4615
brandtr02a64312016-12-19 09:13:4616#include "webrtc/base/criticalsection.h"
17#include "webrtc/call/flexfec_receive_stream.h"
brandtr02a64312016-12-19 09:13:4618
19namespace webrtc {
20
brandtrd9469d42017-01-17 09:33:5421class FlexfecReceiver;
22class ProcessThread;
23class ReceiveStatistics;
24class RecoveredPacketReceiver;
25class RtcpRttStats;
26class RtpPacketReceived;
27class RtpRtcp;
28
brandtr02a64312016-12-19 09:13:4629class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
30 public:
31 FlexfecReceiveStreamImpl(const Config& config,
brandtrd9469d42017-01-17 09:33:5432 RecoveredPacketReceiver* recovered_packet_receiver,
33 RtcpRttStats* rtt_stats,
34 ProcessThread* process_thread);
brandtr02a64312016-12-19 09:13:4635 ~FlexfecReceiveStreamImpl() override;
36
brandtr909d3832016-12-21 14:37:1837 const Config& GetConfig() const { return config_; }
38
nisse5764fdb2017-02-16 14:52:3239 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface.
40 void OnRtpPacket(const RtpPacketReceived& packet);
brandtr02a64312016-12-19 09:13:4641
42 // Implements FlexfecReceiveStream.
43 void Start() override;
44 void Stop() override;
45 Stats GetStats() const override;
46
47 private:
brandtrd9469d42017-01-17 09:33:5448 // Config.
brandtr02a64312016-12-19 09:13:4649 const Config config_;
brandtrd9469d42017-01-17 09:33:5450 bool started_ GUARDED_BY(crit_);
51 rtc::CriticalSection crit_;
52
53 // Erasure code interfacing.
brandtr02a64312016-12-19 09:13:4654 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrd9469d42017-01-17 09:33:5455
56 // RTCP reporting.
57 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
58 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
59 ProcessThread* process_thread_;
brandtr02a64312016-12-19 09:13:4660};
61
62} // namespace webrtc
63
64#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_