OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |