Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: modules/rtp_rtcp/source/ulpfec_receiver_impl.h

Issue 3012243002: Change ForwardErrorCorrection class to accept one received packet at a time. (Closed)
Patch Set: Rebased. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_ 11 #ifndef MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_
12 #define MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_ 12 #define MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <vector>
15 16
16 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" 17 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
17 #include "modules/rtp_rtcp/include/ulpfec_receiver.h" 18 #include "modules/rtp_rtcp/include/ulpfec_receiver.h"
18 #include "modules/rtp_rtcp/source/forward_error_correction.h" 19 #include "modules/rtp_rtcp/source/forward_error_correction.h"
19 #include "rtc_base/criticalsection.h" 20 #include "rtc_base/criticalsection.h"
20 #include "typedefs.h" // NOLINT(build/include) 21 #include "typedefs.h" // NOLINT(build/include)
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 class UlpfecReceiverImpl : public UlpfecReceiver { 25 class UlpfecReceiverImpl : public UlpfecReceiver {
25 public: 26 public:
26 explicit UlpfecReceiverImpl(uint32_t ssrc, RecoveredPacketReceiver* callback); 27 explicit UlpfecReceiverImpl(uint32_t ssrc, RecoveredPacketReceiver* callback);
27 virtual ~UlpfecReceiverImpl(); 28 virtual ~UlpfecReceiverImpl();
28 29
29 int32_t AddReceivedRedPacket(const RTPHeader& rtp_header, 30 int32_t AddReceivedRedPacket(const RTPHeader& rtp_header,
30 const uint8_t* incoming_rtp_packet, 31 const uint8_t* incoming_rtp_packet,
31 size_t packet_length, 32 size_t packet_length,
32 uint8_t ulpfec_payload_type) override; 33 uint8_t ulpfec_payload_type) override;
33 34
34 int32_t ProcessReceivedFec() override; 35 int32_t ProcessReceivedFec() override;
35 36
36 FecPacketCounter GetPacketCounter() const override; 37 FecPacketCounter GetPacketCounter() const override;
37 38
38 private: 39 private:
39 const uint32_t ssrc_; 40 const uint32_t ssrc_;
40 41
41 rtc::CriticalSection crit_sect_; 42 rtc::CriticalSection crit_sect_;
42 RecoveredPacketReceiver* recovered_packet_callback_; 43 RecoveredPacketReceiver* recovered_packet_callback_;
43 std::unique_ptr<ForwardErrorCorrection> fec_; 44 std::unique_ptr<ForwardErrorCorrection> fec_;
44 // TODO(holmer): In the current version |received_packets_| is never more 45 // TODO(nisse): The AddReceivedRedPacket method adds one or two packets to
45 // than one packet, since we process FEC every time a new packet 46 // this list at a time, after which it is emptied by ProcessReceivedFec. It
46 // arrives. We should remove the list. 47 // will make things simpler to merge AddReceivedRedPacket and
47 ForwardErrorCorrection::ReceivedPacketList received_packets_; 48 // ProcessReceivedFec into a single method, and we can then delete this list.
49 std::vector<std::unique_ptr<ForwardErrorCorrection::ReceivedPacket>>
50 received_packets_;
48 ForwardErrorCorrection::RecoveredPacketList recovered_packets_; 51 ForwardErrorCorrection::RecoveredPacketList recovered_packets_;
49 FecPacketCounter packet_counter_; 52 FecPacketCounter packet_counter_;
50 }; 53 };
51 54
52 } // namespace webrtc 55 } // namespace webrtc
53 56
54 #endif // MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_ 57 #endif // MODULES_RTP_RTCP_SOURCE_ULPFEC_RECEIVER_IMPL_H_
OLDNEW
« no previous file with comments | « modules/rtp_rtcp/source/rtp_fec_unittest.cc ('k') | modules/rtp_rtcp/source/ulpfec_receiver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698