blob: 4054aa8f822373d5f920f27e6a39a32db5a05291 [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
eladalon3d4c2872017-08-02 07:17:04 -070014#include <atomic>
brandtr7250b392016-12-19 01:13:46 -080015#include <memory>
brandtr7250b392016-12-19 01:13:46 -080016
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"
Edward Lemurc20978e2017-07-06 19:44:34 +020019#include "webrtc/rtc_base/criticalsection.h"
brandtr7250b392016-12-19 01:13:46 -080020
21namespace webrtc {
22
brandtrfa5a3682017-01-17 01:33:54 -080023class FlexfecReceiver;
24class ProcessThread;
25class ReceiveStatistics;
26class RecoveredPacketReceiver;
27class RtcpRttStats;
28class RtpPacketReceived;
29class RtpRtcp;
nisse0f15f922017-06-21 01:05:22 -070030class RtpStreamReceiverControllerInterface;
31class RtpStreamReceiverInterface;
brandtrfa5a3682017-01-17 01:33:54 -080032
eladalonc0d481a2017-08-02 07:39:07 -070033class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
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_;
eladalon3d4c2872017-08-02 07:17:04 -070055 std::atomic<bool> started_;
brandtrfa5a3682017-01-17 01:33:54 -080056
57 // Erasure code interfacing.
brandtr7250b392016-12-19 01:13:46 -080058 const std::unique_ptr<FlexfecReceiver> receiver_;
brandtrfa5a3682017-01-17 01:33:54 -080059
60 // RTCP reporting.
61 const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
62 const std::unique_ptr<RtpRtcp> rtp_rtcp_;
63 ProcessThread* process_thread_;
nisse0f15f922017-06-21 01:05:22 -070064
65 std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
brandtr7250b392016-12-19 01:13:46 -080066};
67
68} // namespace webrtc
69
70#endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_