brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 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 WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_ |
| 12 | #define WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_ |
| 13 | |
| 14 | #include <memory> |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 15 | |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 16 | #include "webrtc/base/criticalsection.h" |
| 17 | #include "webrtc/call/flexfec_receive_stream.h" |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | |
brandtr | d9469d4 | 2017-01-17 09:33:54 | [diff] [blame] | 21 | class FlexfecReceiver; |
| 22 | class ProcessThread; |
| 23 | class ReceiveStatistics; |
| 24 | class RecoveredPacketReceiver; |
| 25 | class RtcpRttStats; |
| 26 | class RtpPacketReceived; |
| 27 | class RtpRtcp; |
| 28 | |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 29 | class FlexfecReceiveStreamImpl : public FlexfecReceiveStream { |
| 30 | public: |
| 31 | FlexfecReceiveStreamImpl(const Config& config, |
brandtr | d9469d4 | 2017-01-17 09:33:54 | [diff] [blame] | 32 | RecoveredPacketReceiver* recovered_packet_receiver, |
| 33 | RtcpRttStats* rtt_stats, |
| 34 | ProcessThread* process_thread); |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 35 | ~FlexfecReceiveStreamImpl() override; |
| 36 | |
brandtr | 909d383 | 2016-12-21 14:37:18 | [diff] [blame] | 37 | const Config& GetConfig() const { return config_; } |
| 38 | |
nisse | 5764fdb | 2017-02-16 14:52:32 | [diff] [blame] | 39 | // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. |
| 40 | void OnRtpPacket(const RtpPacketReceived& packet); |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 41 | |
| 42 | // Implements FlexfecReceiveStream. |
| 43 | void Start() override; |
| 44 | void Stop() override; |
| 45 | Stats GetStats() const override; |
| 46 | |
| 47 | private: |
brandtr | d9469d4 | 2017-01-17 09:33:54 | [diff] [blame] | 48 | // Config. |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 49 | const Config config_; |
brandtr | d9469d4 | 2017-01-17 09:33:54 | [diff] [blame] | 50 | bool started_ GUARDED_BY(crit_); |
| 51 | rtc::CriticalSection crit_; |
| 52 | |
| 53 | // Erasure code interfacing. |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 54 | const std::unique_ptr<FlexfecReceiver> receiver_; |
brandtr | d9469d4 | 2017-01-17 09:33:54 | [diff] [blame] | 55 | |
| 56 | // RTCP reporting. |
| 57 | const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
| 58 | const std::unique_ptr<RtpRtcp> rtp_rtcp_; |
| 59 | ProcessThread* process_thread_; |
brandtr | 02a6431 | 2016-12-19 09:13:46 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | } // namespace webrtc |
| 63 | |
| 64 | #endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_ |