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

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

Issue 2318503002: neteq_rtpplay: Add an error message for unmatched SSRC (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 <errno.h> 11 #include <errno.h>
12 #include <inttypes.h> 12 #include <inttypes.h>
13 #include <limits.h> // For ULONG_MAX returned by strtoul. 13 #include <limits.h> // For ULONG_MAX returned by strtoul.
14 #include <stdio.h> 14 #include <stdio.h>
15 #include <stdlib.h> // For strtoul. 15 #include <stdlib.h> // For strtoul.
16 16
17 #include <algorithm> 17 #include <algorithm>
18 #include <ios>
18 #include <iostream> 19 #include <iostream>
19 #include <memory> 20 #include <memory>
20 #include <string> 21 #include <string>
21 22
22 #include "gflags/gflags.h" 23 #include "gflags/gflags.h"
23 #include "webrtc/base/checks.h" 24 #include "webrtc/base/checks.h"
24 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" 25 #include "webrtc/modules/audio_coding/neteq/include/neteq.h"
25 #include "webrtc/modules/audio_coding/neteq/tools/fake_decode_from_file.h" 26 #include "webrtc/modules/audio_coding/neteq/tools/fake_decode_from_file.h"
26 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" 27 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
27 #include "webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.h" 28 #include "webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return -1; 239 return -1;
239 } 240 }
240 241
241 // Class to let through only the packets with a given SSRC. Should be used as an 242 // Class to let through only the packets with a given SSRC. Should be used as an
242 // outer layer on another NetEqInput object. 243 // outer layer on another NetEqInput object.
243 class FilterSsrcInput : public NetEqInput { 244 class FilterSsrcInput : public NetEqInput {
244 public: 245 public:
245 FilterSsrcInput(std::unique_ptr<NetEqInput> source, uint32_t ssrc) 246 FilterSsrcInput(std::unique_ptr<NetEqInput> source, uint32_t ssrc)
246 : source_(std::move(source)), ssrc_(ssrc) { 247 : source_(std::move(source)), ssrc_(ssrc) {
247 FindNextWithCorrectSsrc(); 248 FindNextWithCorrectSsrc();
249 RTC_CHECK(source_->NextHeader()) << "Found no packet with SSRC = 0x"
250 << std::hex << ssrc_;
248 } 251 }
249 252
250 // All methods but PopPacket() simply relay to the |source_| object. 253 // All methods but PopPacket() simply relay to the |source_| object.
251 rtc::Optional<int64_t> NextPacketTime() const override { 254 rtc::Optional<int64_t> NextPacketTime() const override {
252 return source_->NextPacketTime(); 255 return source_->NextPacketTime();
253 } 256 }
254 rtc::Optional<int64_t> NextOutputEventTime() const override { 257 rtc::Optional<int64_t> NextOutputEventTime() const override {
255 return source_->NextOutputEventTime(); 258 return source_->NextOutputEventTime();
256 } 259 }
257 260
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 return 0; 452 return 0;
450 } 453 }
451 454
452 } // namespace 455 } // namespace
453 } // namespace test 456 } // namespace test
454 } // namespace webrtc 457 } // namespace webrtc
455 458
456 int main(int argc, char* argv[]) { 459 int main(int argc, char* argv[]) {
457 webrtc::test::RunTest(argc, argv); 460 webrtc::test::RunTest(argc, argv);
458 } 461 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698