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

Unified Diff: webrtc/modules/rtp_rtcp/source/fec_test_helper.h

Issue 2276473002: Rename FrameGenerator -> UlpfecPacketGenerator. (pt. 6b) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@headers-pt5-add_flexfec
Patch Set: Created 4 years, 4 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: webrtc/modules/rtp_rtcp/source/fec_test_helper.h
diff --git a/webrtc/modules/rtp_rtcp/source/fec_test_helper.h b/webrtc/modules/rtp_rtcp/source/fec_test_helper.h
index 2afe9cf002921547be0f70baf964a564c8a041fa..e012ccfd498c285e5080c53d7c3a1ac81eca26d9 100644
--- a/webrtc/modules/rtp_rtcp/source/fec_test_helper.h
+++ b/webrtc/modules/rtp_rtcp/source/fec_test_helper.h
@@ -18,44 +18,13 @@
namespace webrtc {
namespace test {
-
-// needed to not clash with another webrtc::FrameGenerator.
namespace fec {
struct RawRtpPacket : public ForwardErrorCorrection::Packet {
WebRtcRTPHeader header;
};
-class FrameGenerator {
- public:
- FrameGenerator();
-
- void NewFrame(int num_packets);
-
- uint16_t NextSeqNum();
-
- RawRtpPacket* NextPacket(int offset, size_t length);
-
- // Creates a new RtpPacket with the RED header added to the packet.
- RawRtpPacket* BuildMediaRedPacket(const RawRtpPacket* packet);
-
- // Creates a new RtpPacket with FEC payload and red header. Does this by
- // creating a new fake media RtpPacket, clears the marker bit and adds a RED
- // header. Finally replaces the payload with the content of |packet->data|.
- RawRtpPacket* BuildFecRedPacket(const ForwardErrorCorrection::Packet* packet);
-
- void SetRedHeader(ForwardErrorCorrection::Packet* red_packet,
- uint8_t payload_type,
- size_t header_length) const;
-
- private:
- static void BuildRtpHeader(uint8_t* data, const RTPHeader* header);
-
- int num_packets_;
- uint16_t seq_num_;
- uint32_t timestamp_;
-};
-
+// This class generates media packets corresponding to a single frame.
class MediaPacketGenerator {
public:
MediaPacketGenerator(uint32_t min_packet_size,
@@ -84,6 +53,38 @@ class MediaPacketGenerator {
uint16_t fec_seq_num_;
};
+// This class generates media and ULPFEC packets (both encapsulated in RED)
+// for a single frame.
+class UlpfecPacketGenerator {
+ public:
+ UlpfecPacketGenerator();
+
+ void NewFrame(int num_packets);
+
+ uint16_t NextSeqNum();
+
+ RawRtpPacket* NextPacket(int offset, size_t length);
+
+ // Creates a new RtpPacket with the RED header added to the packet.
+ RawRtpPacket* BuildMediaRedPacket(const RawRtpPacket* packet);
+
+ // Creates a new RtpPacket with FEC payload and RED header. Does this by
+ // creating a new fake media RtpPacket, clears the marker bit and adds a RED
+ // header. Finally replaces the payload with the content of |packet->data|.
+ RawRtpPacket* BuildFecRedPacket(const ForwardErrorCorrection::Packet* packet);
+
+ void SetRedHeader(ForwardErrorCorrection::Packet* red_packet,
+ uint8_t payload_type,
+ size_t header_length) const;
+
+ private:
+ static void BuildRtpHeader(uint8_t* data, const RTPHeader* header);
+
+ int num_packets_;
+ uint16_t seq_num_;
+ uint32_t timestamp_;
+};
+
} // namespace fec
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/fec_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698