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.
15 #include "modules/audio_coding/neteq/test/NETEQTEST_RTPpacket.h"
16 #include "modules/audio_coding/neteq/test/NETEQTEST_DummyRTPpacket.h"
18 //#define WEBRTC_DUMMY_RTP
24 int main(int argc, char* argv[]) {
25 FILE* in_file = fopen(argv[1], "rb");
27 printf("Cannot open input file %s\n", argv[1]);
30 printf("Input file: %s\n", argv[1]);
32 FILE* out_file = fopen(argv[2], "wt");
34 printf("Cannot open output file %s\n", argv[2]);
37 printf("Output file: %s\n\n", argv[2]);
40 fprintf(out_file, "SeqNo TimeStamp SendTime Size PT M SSRC\n");
43 NETEQTEST_RTPpacket::skipFileHeader(in_file);
44 #ifdef WEBRTC_DUMMY_RTP
45 NETEQTEST_DummyRTPpacket packet;
47 NETEQTEST_RTPpacket packet;
50 while (packet.readFromFile(in_file) >= 0) {
51 // Write packet data to file.
52 fprintf(out_file, "%5u %10u %10u %5i %5i %2i %#08X\n",
53 packet.sequenceNumber(), packet.timeStamp(), packet.time(),
54 packet.dataLen(), packet.payloadType(), packet.markerBit(),
56 if (packet.payloadType() == kRedPayloadType) {
57 WebRtcNetEQ_RTPInfo red_header;
60 while ((len = packet.extractRED(red_index++, red_header)) >= 0) {
61 fprintf(out_file, "* %5u %10u %10u %5i %5i\n",
62 red_header.sequenceNumber, red_header.timeStamp,
63 packet.time(), len, red_header.payloadType);
65 assert(red_index > 1); // We must get at least one payload.