| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 15 |
| 14 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 15 #include "webrtc/modules/rtp_rtcp/include/fec_receiver.h" | 17 #include "webrtc/modules/rtp_rtcp/include/fec_receiver.h" |
| 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 17 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | 19 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
| 18 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
| 19 | 21 |
| 20 namespace webrtc { | 22 namespace webrtc { |
| 21 | 23 |
| 22 class FecReceiverImpl : public FecReceiver { | 24 class FecReceiverImpl : public FecReceiver { |
| 23 public: | 25 public: |
| 24 explicit FecReceiverImpl(RtpData* callback); | 26 explicit FecReceiverImpl(RtpData* callback); |
| 25 virtual ~FecReceiverImpl(); | 27 virtual ~FecReceiverImpl(); |
| 26 | 28 |
| 27 int32_t AddReceivedRedPacket(const RTPHeader& rtp_header, | 29 int32_t AddReceivedRedPacket(const RTPHeader& rtp_header, |
| 28 const uint8_t* incoming_rtp_packet, | 30 const uint8_t* incoming_rtp_packet, |
| 29 size_t packet_length, | 31 size_t packet_length, |
| 30 uint8_t ulpfec_payload_type) override; | 32 uint8_t ulpfec_payload_type) override; |
| 31 | 33 |
| 32 int32_t ProcessReceivedFec() override; | 34 int32_t ProcessReceivedFec() override; |
| 33 | 35 |
| 34 FecPacketCounter GetPacketCounter() const override; | 36 FecPacketCounter GetPacketCounter() const override; |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 rtc::CriticalSection crit_sect_; | 39 rtc::CriticalSection crit_sect_; |
| 38 RtpData* recovered_packet_callback_; | 40 RtpData* recovered_packet_callback_; |
| 39 ForwardErrorCorrection fec_; | 41 std::unique_ptr<ForwardErrorCorrection> fec_; |
| 40 // TODO(holmer): In the current version |received_packets_| is never more | 42 // TODO(holmer): In the current version |received_packets_| is never more |
| 41 // than one packet, since we process FEC every time a new packet | 43 // than one packet, since we process FEC every time a new packet |
| 42 // arrives. We should remove the list. | 44 // arrives. We should remove the list. |
| 43 ForwardErrorCorrection::ReceivedPacketList received_packets_; | 45 ForwardErrorCorrection::ReceivedPacketList received_packets_; |
| 44 ForwardErrorCorrection::RecoveredPacketList recovered_packets_; | 46 ForwardErrorCorrection::RecoveredPacketList recovered_packets_; |
| 45 FecPacketCounter packet_counter_; | 47 FecPacketCounter packet_counter_; |
| 46 }; | 48 }; |
| 47 } // namespace webrtc | 49 } // namespace webrtc |
| 48 | 50 |
| 49 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ | 51 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_ |
| OLD | NEW |