brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [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 | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 15 | |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 16 | #include "webrtc/call/flexfec_receive_stream.h" |
nisse | d76b7b2 | 2017-06-01 04:02:35 -0700 | [diff] [blame] | 17 | #include "webrtc/call/rtp_packet_sink_interface.h" |
Edward Lemur | c20978e | 2017-07-06 19:44:34 +0200 | [diff] [blame] | 18 | #include "webrtc/rtc_base/criticalsection.h" |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
brandtr | fa5a368 | 2017-01-17 01:33:54 -0800 | [diff] [blame] | 22 | class FlexfecReceiver; |
| 23 | class ProcessThread; |
| 24 | class ReceiveStatistics; |
| 25 | class RecoveredPacketReceiver; |
| 26 | class RtcpRttStats; |
| 27 | class RtpPacketReceived; |
| 28 | class RtpRtcp; |
nisse | 0f15f92 | 2017-06-21 01:05:22 -0700 | [diff] [blame] | 29 | class RtpStreamReceiverControllerInterface; |
| 30 | class RtpStreamReceiverInterface; |
brandtr | fa5a368 | 2017-01-17 01:33:54 -0800 | [diff] [blame] | 31 | |
nisse | e4bcd6d | 2017-05-16 04:47:04 -0700 | [diff] [blame] | 32 | class FlexfecReceiveStreamImpl : public FlexfecReceiveStream, |
| 33 | public RtpPacketSinkInterface { |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 34 | public: |
nisse | 0f15f92 | 2017-06-21 01:05:22 -0700 | [diff] [blame] | 35 | FlexfecReceiveStreamImpl( |
| 36 | RtpStreamReceiverControllerInterface* receiver_controller, |
| 37 | const Config& config, |
| 38 | RecoveredPacketReceiver* recovered_packet_receiver, |
| 39 | RtcpRttStats* rtt_stats, |
| 40 | ProcessThread* process_thread); |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 41 | ~FlexfecReceiveStreamImpl() override; |
| 42 | |
nisse | e4bcd6d | 2017-05-16 04:47:04 -0700 | [diff] [blame] | 43 | // RtpPacketSinkInterface. |
| 44 | void OnRtpPacket(const RtpPacketReceived& packet) override; |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 45 | |
| 46 | // Implements FlexfecReceiveStream. |
| 47 | void Start() override; |
| 48 | void Stop() override; |
| 49 | Stats GetStats() const override; |
eladalon | 42f44f9 | 2017-07-25 06:40:06 -0700 | [diff] [blame^] | 50 | const Config& GetConfig() const override; |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 51 | |
| 52 | private: |
brandtr | fa5a368 | 2017-01-17 01:33:54 -0800 | [diff] [blame] | 53 | // Config. |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 54 | const Config config_; |
brandtr | fa5a368 | 2017-01-17 01:33:54 -0800 | [diff] [blame] | 55 | bool started_ GUARDED_BY(crit_); |
| 56 | rtc::CriticalSection crit_; |
| 57 | |
| 58 | // Erasure code interfacing. |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 59 | const std::unique_ptr<FlexfecReceiver> receiver_; |
brandtr | fa5a368 | 2017-01-17 01:33:54 -0800 | [diff] [blame] | 60 | |
| 61 | // RTCP reporting. |
| 62 | const std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
| 63 | const std::unique_ptr<RtpRtcp> rtp_rtcp_; |
| 64 | ProcessThread* process_thread_; |
nisse | 0f15f92 | 2017-06-21 01:05:22 -0700 | [diff] [blame] | 65 | |
| 66 | std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_; |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | } // namespace webrtc |
| 70 | |
| 71 | #endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_ |