| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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/include/neteq.h" | 11 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
| 12 | 12 |
| 13 #include <math.h> | 13 #include <math.h> |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 #include <string.h> // memset | 15 #include <string.h> // memset |
| 16 | 16 |
| 17 #include <algorithm> | 17 #include <algorithm> |
| 18 #include <memory> | 18 #include <memory> |
| 19 #include <set> | 19 #include <set> |
| 20 #include <string> | 20 #include <string> |
| 21 #include <vector> | 21 #include <vector> |
| 22 | 22 |
| 23 #include "gflags/gflags.h" | |
| 24 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" | 23 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" |
| 25 #include "webrtc/common_types.h" | 24 #include "webrtc/common_types.h" |
| 26 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" | 25 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" |
| 27 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" | 26 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" |
| 28 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" | 27 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" |
| 29 #include "webrtc/modules/include/module_common_types.h" | 28 #include "webrtc/modules/include/module_common_types.h" |
| 29 #include "webrtc/rtc_base/flags.h" |
| 30 #include "webrtc/rtc_base/ignore_wundef.h" | 30 #include "webrtc/rtc_base/ignore_wundef.h" |
| 31 #include "webrtc/rtc_base/protobuf_utils.h" | 31 #include "webrtc/rtc_base/protobuf_utils.h" |
| 32 #include "webrtc/rtc_base/sha1digest.h" | 32 #include "webrtc/rtc_base/sha1digest.h" |
| 33 #include "webrtc/rtc_base/stringencode.h" | 33 #include "webrtc/rtc_base/stringencode.h" |
| 34 #include "webrtc/test/gtest.h" | 34 #include "webrtc/test/gtest.h" |
| 35 #include "webrtc/test/testsupport/fileutils.h" | 35 #include "webrtc/test/testsupport/fileutils.h" |
| 36 #include "webrtc/typedefs.h" | 36 #include "webrtc/typedefs.h" |
| 37 | 37 |
| 38 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT | 38 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 39 RTC_PUSH_IGNORING_WUNDEF() | 39 RTC_PUSH_IGNORING_WUNDEF() |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 const std::string rtcp_stats_checksum = PlatformChecksum( | 453 const std::string rtcp_stats_checksum = PlatformChecksum( |
| 454 "b8880bf9fed2487efbddcb8d94b9937a29ae521d", | 454 "b8880bf9fed2487efbddcb8d94b9937a29ae521d", |
| 455 "f3f7b3d3e71d7e635240b5373b57df6a7e4ce9d4", | 455 "f3f7b3d3e71d7e635240b5373b57df6a7e4ce9d4", |
| 456 "b8880bf9fed2487efbddcb8d94b9937a29ae521d", | 456 "b8880bf9fed2487efbddcb8d94b9937a29ae521d", |
| 457 "b8880bf9fed2487efbddcb8d94b9937a29ae521d"); | 457 "b8880bf9fed2487efbddcb8d94b9937a29ae521d"); |
| 458 | 458 |
| 459 DecodeAndCompare(input_rtp_file, | 459 DecodeAndCompare(input_rtp_file, |
| 460 output_checksum, | 460 output_checksum, |
| 461 network_stats_checksum, | 461 network_stats_checksum, |
| 462 rtcp_stats_checksum, | 462 rtcp_stats_checksum, |
| 463 FLAGS_gen_ref); | 463 FLAG_gen_ref); |
| 464 } | 464 } |
| 465 | 465 |
| 466 #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \ | 466 #if !defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \ |
| 467 defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ | 467 defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ |
| 468 defined(WEBRTC_CODEC_OPUS) | 468 defined(WEBRTC_CODEC_OPUS) |
| 469 #define MAYBE_TestOpusBitExactness TestOpusBitExactness | 469 #define MAYBE_TestOpusBitExactness TestOpusBitExactness |
| 470 #else | 470 #else |
| 471 #define MAYBE_TestOpusBitExactness DISABLED_TestOpusBitExactness | 471 #define MAYBE_TestOpusBitExactness DISABLED_TestOpusBitExactness |
| 472 #endif | 472 #endif |
| 473 TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) { | 473 TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 489 const std::string rtcp_stats_checksum = PlatformChecksum( | 489 const std::string rtcp_stats_checksum = PlatformChecksum( |
| 490 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", | 490 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", |
| 491 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", | 491 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", |
| 492 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", | 492 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0", |
| 493 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0"); | 493 "e37c797e3de6a64dda88c9ade7a013d022a2e1e0"); |
| 494 | 494 |
| 495 DecodeAndCompare(input_rtp_file, | 495 DecodeAndCompare(input_rtp_file, |
| 496 output_checksum, | 496 output_checksum, |
| 497 network_stats_checksum, | 497 network_stats_checksum, |
| 498 rtcp_stats_checksum, | 498 rtcp_stats_checksum, |
| 499 FLAGS_gen_ref); | 499 FLAG_gen_ref); |
| 500 } | 500 } |
| 501 | 501 |
| 502 // Use fax mode to avoid time-scaling. This is to simplify the testing of | 502 // Use fax mode to avoid time-scaling. This is to simplify the testing of |
| 503 // packet waiting times in the packet buffer. | 503 // packet waiting times in the packet buffer. |
| 504 class NetEqDecodingTestFaxMode : public NetEqDecodingTest { | 504 class NetEqDecodingTestFaxMode : public NetEqDecodingTest { |
| 505 protected: | 505 protected: |
| 506 NetEqDecodingTestFaxMode() : NetEqDecodingTest() { | 506 NetEqDecodingTestFaxMode() : NetEqDecodingTest() { |
| 507 config_.playout_mode = kPlayoutFax; | 507 config_.playout_mode = kPlayoutFax; |
| 508 } | 508 } |
| 509 }; | 509 }; |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 // Pull out data once. | 1628 // Pull out data once. |
| 1629 AudioFrame output; | 1629 AudioFrame output; |
| 1630 bool muted; | 1630 bool muted; |
| 1631 ASSERT_EQ(0, neteq_->GetAudio(&output, &muted)); | 1631 ASSERT_EQ(0, neteq_->GetAudio(&output, &muted)); |
| 1632 | 1632 |
| 1633 EXPECT_EQ(std::vector<uint32_t>({kRtpTimestamp1, kRtpTimestamp2}), | 1633 EXPECT_EQ(std::vector<uint32_t>({kRtpTimestamp1, kRtpTimestamp2}), |
| 1634 neteq_->LastDecodedTimestamps()); | 1634 neteq_->LastDecodedTimestamps()); |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 } // namespace webrtc | 1637 } // namespace webrtc |
| OLD | NEW |