blob: de5de4190ccbda08722732b14e02659cac103513 [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/call/flexfec_receive_stream.h"
nissed76b7b22017-06-01 04:02:35 -070017#include "webrtc/call/rtp_packet_sink_interface.h"
Edward Lemurc20978e2017-07-06 19:44:34 +020018#include "webrtc/rtc_base/criticalsection.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
nissee4bcd6d2017-05-16 04:47:04 -070043 // RtpPacketSinkInterface.
44 void OnRtpPacket(const RtpPacketReceived& packet) override;
brandtr7250b392016-12-19 01:13:46 -080045
46 // Implements FlexfecReceiveStream.
47 void Start() override;
48 void Stop() override;
49 Stats GetStats() const override;
eladalon42f44f92017-07-25 06:40:06 -070050 const Config& GetConfig() const override;
brandtr7250b392016-12-19 01:13:46 -080051
52 private:
brandtrfa5a3682017-01-17 01:33:54 -080053 // Config.
brandtr7250b392016-12-19 01:13:46 -080054 const Config config_;
brandtrfa5a3682017-01-17 01:33:54 -080055 bool started_ GUARDED_BY(crit_);
56 rtc::CriticalSection crit_;
57
58 // Erasure code interfacing.
brandtr7250b392016-12-19 01:13:46 -080059 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrfa5a3682017-01-17 01:33:54 -080060
61 // RTCP reporting.
62 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
63 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
64 ProcessThread* process_thread_;
nisse0f15f922017-06-21 01:05:22 -070065
66 std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
brandtr7250b392016-12-19 01:13:46 -080067};
68
69} // namespace webrtc
70
71#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_