blob: a89940f8c3e52d9bb01e46eeea682f69aac882de [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
Henrik Kjellandera80c16a2017-07-01 16:48:15 +020016#include "webrtc/base/criticalsection.h"
brandtr7250b392016-12-19 01:13:46 -080017#include "webrtc/call/flexfec_receive_stream.h"
nissed76b7b22017-06-01 04:02:35 -070018#include "webrtc/call/rtp_packet_sink_interface.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;
nisse0f15f922017-06-21 01:05:22 -070029class RtpStreamReceiverControllerInterface;
30class RtpStreamReceiverInterface;
brandtrfa5a3682017-01-17 01:33:54 -080031
nissee4bcd6d2017-05-16 04:47:04 -070032class FlexfecReceiveStreamImpl : public FlexfecReceiveStream,
33 public RtpPacketSinkInterface {
brandtr7250b392016-12-19 01:13:46 -080034 public:
nisse0f15f922017-06-21 01:05:22 -070035 FlexfecReceiveStreamImpl(
36 RtpStreamReceiverControllerInterface* receiver_controller,
37 const Config& config,
38 RecoveredPacketReceiver* recovered_packet_receiver,
39 RtcpRttStats* rtt_stats,
40 ProcessThread* process_thread);
brandtr7250b392016-12-19 01:13:46 -080041 ~FlexfecReceiveStreamImpl() override;
42
brandtrb29e6522016-12-21 06:37:18 -080043 const Config& GetConfig() const { return config_; }
44
nissee4bcd6d2017-05-16 04:47:04 -070045 // RtpPacketSinkInterface.
46 void OnRtpPacket(const RtpPacketReceived& packet) override;
brandtr7250b392016-12-19 01:13:46 -080047
48 // Implements FlexfecReceiveStream.
49 void Start() override;
50 void Stop() override;
51 Stats GetStats() const override;
52
53 private:
brandtrfa5a3682017-01-17 01:33:54 -080054 // Config.
brandtr7250b392016-12-19 01:13:46 -080055 const Config config_;
brandtrfa5a3682017-01-17 01:33:54 -080056 bool started_ GUARDED_BY(crit_);
57 rtc::CriticalSection crit_;
58
59 // Erasure code interfacing.
brandtr7250b392016-12-19 01:13:46 -080060 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrfa5a3682017-01-17 01:33:54 -080061
62 // RTCP reporting.
63 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
64 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
65 ProcessThread* process_thread_;
nisse0f15f922017-06-21 01:05:22 -070066
67 std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
brandtr7250b392016-12-19 01:13:46 -080068};
69
70} // namespace webrtc
71
72#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_