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

Unified Diff: modules/rtp_rtcp/source/forward_error_correction.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 side-by-side diff with in-line comments
Download patch
Index: modules/rtp_rtcp/source/forward_error_correction.h
diff --git a/modules/rtp_rtcp/source/forward_error_correction.h b/modules/rtp_rtcp/source/forward_error_correction.h
index f821f6f26d45d9abce8da50311a05bc0ca10e91f..97acb393f35a1265e93ba21609cb30b9c1152cbc 100644
--- a/modules/rtp_rtcp/source/forward_error_correction.h
+++ b/modules/rtp_rtcp/source/forward_error_correction.h
@@ -75,9 +75,10 @@ class ForwardErrorCorrection {
uint16_t seq_num;
};
- // The received list parameter of DecodeFec() references structs of this type.
+ // Used for the input to DecodeFec().
//
- // TODO(holmer): Refactor into a proper class.
+ // TODO(nisse): Delete class, instead passing |is_fec| and |pkt| as separate
+ // arguments.
class ReceivedPacket : public SortablePacket {
public:
ReceivedPacket();
@@ -141,7 +142,6 @@ class ForwardErrorCorrection {
};
using PacketList = std::list<std::unique_ptr<Packet>>;
- using ReceivedPacketList = std::list<std::unique_ptr<ReceivedPacket>>;
using RecoveredPacketList = std::list<std::unique_ptr<RecoveredPacket>>;
using ReceivedFecPacketList = std::list<std::unique_ptr<ReceivedFecPacket>>;
@@ -218,10 +218,8 @@ class ForwardErrorCorrection {
// list will be valid until the next call to
// DecodeFec().
//
- // Returns 0 on success, -1 on failure.
- //
- int DecodeFec(ReceivedPacketList* received_packets,
- RecoveredPacketList* recovered_packets);
+ void DecodeFec(const ReceivedPacket& received_packet,
+ RecoveredPacketList* recovered_packets);
// Get the number of generated FEC packets, given the number of media packets
// and the protection factor.
@@ -266,14 +264,14 @@ class ForwardErrorCorrection {
uint32_t media_ssrc,
uint16_t seq_num_base);
- // Inserts the |received_packets| into the internal received FEC packet list
+ // Inserts the |received_packet| into the internal received FEC packet list
// or into |recovered_packets|.
- void InsertPackets(ReceivedPacketList* received_packets,
- RecoveredPacketList* recovered_packets);
+ void InsertPacket(const ReceivedPacket& received_packet,
+ RecoveredPacketList* recovered_packets);
// Inserts the |received_packet| into |recovered_packets|. Deletes duplicates.
void InsertMediaPacket(RecoveredPacketList* recovered_packets,
- ReceivedPacket* received_packet);
+ const ReceivedPacket& received_packet);
// Assigns pointers to the recovered packet from all FEC packets which cover
// it.
@@ -284,7 +282,7 @@ class ForwardErrorCorrection {
// Insert |received_packet| into internal FEC list. Deletes duplicates.
void InsertFecPacket(const RecoveredPacketList& recovered_packets,
- ReceivedPacket* received_packet);
+ const ReceivedPacket& received_packet);
// Assigns pointers to already recovered packets covered by |fec_packet|.
static void AssignRecoveredPackets(
« no previous file with comments | « modules/rtp_rtcp/source/flexfec_receiver_unittest.cc ('k') | modules/rtp_rtcp/source/forward_error_correction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698