1 /*
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 CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
12 #define CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
13 
14 #include <memory>
15 
16 #include "call/flexfec_receive_stream.h"
17 #include "call/rtp_packet_sink_interface.h"
18 
19 namespace webrtc {
20 
21 class FlexfecReceiver;
22 class ProcessThread;
23 class ReceiveStatistics;
24 class RecoveredPacketReceiver;
25 class RtcpRttStats;
26 class RtpPacketReceived;
27 class RtpRtcp;
28 class RtpStreamReceiverControllerInterface;
29 class RtpStreamReceiverInterface;
30 
31 class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
32  public:
33   FlexfecReceiveStreamImpl(
34       RtpStreamReceiverControllerInterface* receiver_controller,
35       const Config& config,
36       RecoveredPacketReceiver* recovered_packet_receiver,
37       RtcpRttStats* rtt_stats,
38       ProcessThread* process_thread);
39   ~FlexfecReceiveStreamImpl() override;
40 
41   // RtpPacketSinkInterface.
42   void OnRtpPacket(const RtpPacketReceived& packet) override;
43 
44   Stats GetStats() const override;
45   const Config& GetConfig() const override;
46 
47  private:
48   // Config.
49   const Config config_;
50 
51   // Erasure code interfacing.
52   const std::unique_ptr<FlexfecReceiver> receiver_;
53 
54   // RTCP reporting.
55   const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
56   const std::unique_ptr<RtpRtcp> rtp_rtcp_;
57   ProcessThread* process_thread_;
58 
59   std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;
60 };
61 
62 }  // namespace webrtc
63 
64 #endif  // CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
65