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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/neteq_test.cc

Issue 2844283002: Add NetEqInput::PacketData::ToString method (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_input.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 #include "webrtc/modules/audio_coding/neteq/tools/neteq_test.h" 11 #include "webrtc/modules/audio_coding/neteq/tools/neteq_test.h"
12 12
13 #include <iostream> 13 #include <iostream>
14 14
15 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" 15 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
16 16
17 namespace webrtc { 17 namespace webrtc {
18 namespace test { 18 namespace test {
19 19
20 void DefaultNetEqTestErrorCallback::OnInsertPacketError( 20 void DefaultNetEqTestErrorCallback::OnInsertPacketError(
21 int error_code, 21 int error_code,
22 const NetEqInput::PacketData& packet) { 22 const NetEqInput::PacketData& packet) {
23 if (error_code == NetEq::kUnknownRtpPayloadType) { 23 if (error_code == NetEq::kUnknownRtpPayloadType) {
24 std::cerr << "RTP Payload type " 24 std::cerr << "RTP Payload type "
25 << static_cast<int>(packet.header.payloadType) << " is unknown." 25 << static_cast<int>(packet.header.payloadType) << " is unknown."
26 << std::endl; 26 << std::endl;
27 } else { 27 } else {
28 std::cerr << "InsertPacket returned error code " << error_code << std::endl; 28 std::cerr << "InsertPacket returned error code " << error_code << std::endl;
29 std::cerr << "Header data:" << std::endl;
30 std::cerr << " PT = " << static_cast<int>(packet.header.payloadType)
31 << std::endl;
32 std::cerr << " SN = " << packet.header.sequenceNumber << std::endl;
33 std::cerr << " TS = " << packet.header.timestamp << std::endl;
34 } 29 }
30 std::cerr << "Packet data: " << packet.ToString() << std::endl;
hlundin-webrtc 2017/04/27 13:21:07 I thought it was a good idea to dump the packet in
AleBzk 2017/04/27 13:27:00 Acknowledged.
35 FATAL(); 31 FATAL();
36 } 32 }
37 33
38 void DefaultNetEqTestErrorCallback::OnGetAudioError(int error_code) { 34 void DefaultNetEqTestErrorCallback::OnGetAudioError(int error_code) {
39 std::cerr << "GetAudio returned error code " << error_code << std::endl; 35 std::cerr << "GetAudio returned error code " << error_code << std::endl;
40 FATAL(); 36 FATAL();
41 } 37 }
42 38
43 NetEqTest::NetEqTest(const NetEq::Config& config, 39 NetEqTest::NetEqTest(const NetEq::Config& config,
44 const DecoderMap& codecs, 40 const DecoderMap& codecs,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 neteq_->RegisterExternalDecoder(c.second.decoder, c.second.codec, 123 neteq_->RegisterExternalDecoder(c.second.decoder, c.second.codec,
128 c.second.codec_name, c.first), 124 c.second.codec_name, c.first),
129 NetEq::kOK) 125 NetEq::kOK)
130 << "Cannot register " << c.second.codec_name << " to payload type " 126 << "Cannot register " << c.second.codec_name << " to payload type "
131 << c.first; 127 << c.first;
132 } 128 }
133 } 129 }
134 130
135 } // namespace test 131 } // namespace test
136 } // namespace webrtc 132 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_input.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698