| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Inserts a received packet (can be either media or FlexFEC) into the | 32 // Inserts a received packet (can be either media or FlexFEC) into the |
| 33 // internal buffer, and sends the received packets to the erasure code. | 33 // internal buffer, and sends the received packets to the erasure code. |
| 34 // All newly recovered packets are sent back through the callback. | 34 // All newly recovered packets are sent back through the callback. |
| 35 void OnRtpPacket(const RtpPacketReceived& packet); | 35 void OnRtpPacket(const RtpPacketReceived& packet); |
| 36 | 36 |
| 37 // Returns a counter describing the added and recovered packets. | 37 // Returns a counter describing the added and recovered packets. |
| 38 FecPacketCounter GetPacketCounter() const; | 38 FecPacketCounter GetPacketCounter() const; |
| 39 | 39 |
| 40 // Protected to aid testing. | 40 // Protected to aid testing. |
| 41 protected: | 41 protected: |
| 42 bool AddReceivedPacket(const RtpPacketReceived& packet); | 42 std::unique_ptr<ForwardErrorCorrection::ReceivedPacket> AddReceivedPacket( |
| 43 bool ProcessReceivedPackets(); | 43 const RtpPacketReceived& packet); |
| 44 void ProcessReceivedPacket( |
| 45 const ForwardErrorCorrection::ReceivedPacket& received_packet); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 // Config. | 48 // Config. |
| 47 const uint32_t ssrc_; | 49 const uint32_t ssrc_; |
| 48 const uint32_t protected_media_ssrc_; | 50 const uint32_t protected_media_ssrc_; |
| 49 | 51 |
| 50 // Erasure code interfacing and callback. | 52 // Erasure code interfacing and callback. |
| 51 std::unique_ptr<ForwardErrorCorrection> erasure_code_ | 53 std::unique_ptr<ForwardErrorCorrection> erasure_code_ |
| 52 RTC_GUARDED_BY(sequence_checker_); | 54 RTC_GUARDED_BY(sequence_checker_); |
| 53 ForwardErrorCorrection::ReceivedPacketList received_packets_ | |
| 54 RTC_GUARDED_BY(sequence_checker_); | |
| 55 ForwardErrorCorrection::RecoveredPacketList recovered_packets_ | 55 ForwardErrorCorrection::RecoveredPacketList recovered_packets_ |
| 56 RTC_GUARDED_BY(sequence_checker_); | 56 RTC_GUARDED_BY(sequence_checker_); |
| 57 RecoveredPacketReceiver* const recovered_packet_receiver_; | 57 RecoveredPacketReceiver* const recovered_packet_receiver_; |
| 58 | 58 |
| 59 // Logging and stats. | 59 // Logging and stats. |
| 60 Clock* const clock_; | 60 Clock* const clock_; |
| 61 int64_t last_recovered_packet_ms_ RTC_GUARDED_BY(sequence_checker_); | 61 int64_t last_recovered_packet_ms_ RTC_GUARDED_BY(sequence_checker_); |
| 62 FecPacketCounter packet_counter_ RTC_GUARDED_BY(sequence_checker_); | 62 FecPacketCounter packet_counter_ RTC_GUARDED_BY(sequence_checker_); |
| 63 | 63 |
| 64 rtc::SequencedTaskChecker sequence_checker_; | 64 rtc::SequencedTaskChecker sequence_checker_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace webrtc | 67 } // namespace webrtc |
| 68 | 68 |
| 69 #endif // MODULES_RTP_RTCP_INCLUDE_FLEXFEC_RECEIVER_H_ | 69 #endif // MODULES_RTP_RTCP_INCLUDE_FLEXFEC_RECEIVER_H_ |
| OLD | NEW |