OLD | NEW |
| (Empty) |
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_MODULES_RTP_RTCP_SOURCE_FLEXFEC_RECEIVER_IMPL_H_ | |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_FLEXFEC_RECEIVER_IMPL_H_ | |
13 | |
14 #include <memory> | |
15 | |
16 #include "webrtc/base/basictypes.h" | |
17 #include "webrtc/base/sequenced_task_checker.h" | |
18 #include "webrtc/call.h" | |
19 #include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h" | |
20 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | |
21 #include "webrtc/system_wrappers/include/clock.h" | |
22 | |
23 namespace webrtc { | |
24 | |
25 class FlexfecReceiverImpl : public FlexfecReceiver { | |
26 public: | |
27 FlexfecReceiverImpl(uint32_t flexfec_ssrc, | |
28 uint32_t protected_media_ssrc, | |
29 RecoveredPacketReceiver* callback); | |
30 ~FlexfecReceiverImpl(); | |
31 | |
32 // Implements FlexfecReceiver. | |
33 bool AddAndProcessReceivedPacket(const uint8_t* packet, size_t packet_length); | |
34 FecPacketCounter GetPacketCounter() const; | |
35 | |
36 private: | |
37 bool AddReceivedPacket(const uint8_t* packet, size_t packet_length); | |
38 bool ProcessReceivedPackets(); | |
39 | |
40 // Config. | |
41 const uint32_t flexfec_ssrc_; | |
42 const uint32_t protected_media_ssrc_; | |
43 | |
44 // Erasure code interfacing and callback. | |
45 std::unique_ptr<ForwardErrorCorrection> erasure_code_; | |
46 ForwardErrorCorrection::ReceivedPacketList received_packets_; | |
47 ForwardErrorCorrection::RecoveredPacketList recovered_packets_; | |
48 RecoveredPacketReceiver* const callback_; | |
49 | |
50 // Logging and stats. | |
51 Clock* const clock_; | |
52 int64_t last_recovered_packet_ms_; | |
53 FecPacketCounter packet_counter_; | |
54 | |
55 rtc::SequencedTaskChecker sequence_checker_; | |
56 }; | |
57 | |
58 } // namespace webrtc | |
59 | |
60 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FLEXFEC_RECEIVER_IMPL_H_ | |
OLD | NEW |