| 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 "webrtc/modules/audio_coding/acm2/acm_receiver.h" | 11 #include "webrtc/modules/audio_coding/acm2/acm_receiver.h" |
| 12 | 12 |
| 13 #include <algorithm> // std::min | 13 #include <algorithm> // std::min |
| 14 #include <memory> |
| 14 | 15 |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "webrtc/base/scoped_ptr.h" | |
| 17 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 17 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
| 18 #include "webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h" | 18 #include "webrtc/modules/audio_coding/acm2/audio_coding_module_impl.h" |
| 19 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 19 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
| 20 #include "webrtc/system_wrappers/include/clock.h" | 20 #include "webrtc/system_wrappers/include/clock.h" |
| 21 #include "webrtc/test/test_suite.h" | 21 #include "webrtc/test/test_suite.h" |
| 22 #include "webrtc/test/testsupport/fileutils.h" | 22 #include "webrtc/test/testsupport/fileutils.h" |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 | 25 |
| 26 namespace acm2 { | 26 namespace acm2 { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (ret_val < 0) { | 146 if (ret_val < 0) { |
| 147 assert(false); | 147 assert(false); |
| 148 return -1; | 148 return -1; |
| 149 } | 149 } |
| 150 rtp_header_.header.sequenceNumber++; | 150 rtp_header_.header.sequenceNumber++; |
| 151 packet_sent_ = true; | 151 packet_sent_ = true; |
| 152 last_frame_type_ = frame_type; | 152 last_frame_type_ = frame_type; |
| 153 return 0; | 153 return 0; |
| 154 } | 154 } |
| 155 | 155 |
| 156 rtc::scoped_ptr<AcmReceiver> receiver_; | 156 std::unique_ptr<AcmReceiver> receiver_; |
| 157 rtc::ArrayView<const CodecInst> codecs_; | 157 rtc::ArrayView<const CodecInst> codecs_; |
| 158 rtc::scoped_ptr<AudioCodingModule> acm_; | 158 std::unique_ptr<AudioCodingModule> acm_; |
| 159 WebRtcRTPHeader rtp_header_; | 159 WebRtcRTPHeader rtp_header_; |
| 160 uint32_t timestamp_; | 160 uint32_t timestamp_; |
| 161 bool packet_sent_; // Set when SendData is called reset when inserting audio. | 161 bool packet_sent_; // Set when SendData is called reset when inserting audio. |
| 162 uint32_t last_packet_send_timestamp_; | 162 uint32_t last_packet_send_timestamp_; |
| 163 FrameType last_frame_type_; | 163 FrameType last_frame_type_; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 #if defined(WEBRTC_ANDROID) | 166 #if defined(WEBRTC_ANDROID) |
| 167 #define MAYBE_AddCodecGetCodec DISABLED_AddCodecGetCodec | 167 #define MAYBE_AddCodecGetCodec DISABLED_AddCodecGetCodec |
| 168 #else | 168 #else |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 receiver_->last_packet_sample_rate_hz()); | 389 receiver_->last_packet_sample_rate_hz()); |
| 390 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); | 390 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); |
| 391 EXPECT_TRUE(CodecsEqual(c.inst, codec)); | 391 EXPECT_TRUE(CodecsEqual(c.inst, codec)); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 #endif | 394 #endif |
| 395 | 395 |
| 396 } // namespace acm2 | 396 } // namespace acm2 |
| 397 | 397 |
| 398 } // namespace webrtc | 398 } // namespace webrtc |
| OLD | NEW |