2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_TEST_HELPER_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_TEST_HELPER_H_
14 #include "webrtc/modules/interface/module_common_types.h"
15 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
32 typedef ForwardErrorCorrection::Packet Packet;
34 struct RtpPacket : public Packet {
35 WebRtcRTPHeader header;
38 class FrameGenerator {
42 void NewFrame(int num_packets);
44 uint16_t NextSeqNum();
46 RtpPacket* NextPacket(int offset, size_t length);
48 // Creates a new RtpPacket with the RED header added to the packet.
49 RtpPacket* BuildMediaRedPacket(const RtpPacket* packet);
51 // Creates a new RtpPacket with FEC payload and red header. Does this by
52 // creating a new fake media RtpPacket, clears the marker bit and adds a RED
53 // header. Finally replaces the payload with the content of |packet->data|.
54 RtpPacket* BuildFecRedPacket(const Packet* packet);
56 void SetRedHeader(Packet* red_packet, uint8_t payload_type,
57 int header_length) const;
60 static void BuildRtpHeader(uint8_t* data, const RTPHeader* header);
68 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_TEST_HELPER_H_