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> |
| 15 | #include <string> |
| 16 | |
| 17 | #include "webrtc/base/basictypes.h" |
| 18 | #include "webrtc/base/criticalsection.h" |
| 19 | #include "webrtc/call/flexfec_receive_stream.h" |
| 20 | #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" |
brandtr | ab2ffa3 | 2016-12-20 03:33:58 -0800 | [diff] [blame] | 21 | #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | class FlexfecReceiveStreamImpl : public FlexfecReceiveStream { |
| 26 | public: |
| 27 | FlexfecReceiveStreamImpl(const Config& config, |
brandtr | ab2ffa3 | 2016-12-20 03:33:58 -0800 | [diff] [blame] | 28 | RecoveredPacketReceiver* recovered_packet_receiver); |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 29 | ~FlexfecReceiveStreamImpl() override; |
| 30 | |
brandtr | ab2ffa3 | 2016-12-20 03:33:58 -0800 | [diff] [blame] | 31 | const Config& GetConfig() const { return config_; } |
| 32 | |
| 33 | bool AddAndProcessReceivedPacket(RtpPacketReceived packet); |
brandtr | 7250b39 | 2016-12-19 01:13:46 -0800 | [diff] [blame] | 34 | |
| 35 | // Implements FlexfecReceiveStream. |
| 36 | void Start() override; |
| 37 | void Stop() override; |
| 38 | Stats GetStats() const override; |
| 39 | |
| 40 | private: |
| 41 | rtc::CriticalSection crit_; |
| 42 | bool started_ GUARDED_BY(crit_); |
| 43 | |
| 44 | const Config config_; |
| 45 | const std::unique_ptr<FlexfecReceiver> receiver_; |
| 46 | }; |
| 47 | |
| 48 | } // namespace webrtc |
| 49 | |
| 50 | #endif // WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_ |