| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2  *  Copyright (c) 2015 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 | 
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 115   EXPECT_EQ(&external_encoder, rac.RentEncoderStack(¶m)); | 115   EXPECT_EQ(&external_encoder, rac.RentEncoderStack(¶m)); | 
| 116   const int kPacketSizeSamples = kSampleRateHz / 100; | 116   const int kPacketSizeSamples = kSampleRateHz / 100; | 
| 117   int16_t audio[kPacketSizeSamples] = {0}; | 117   int16_t audio[kPacketSizeSamples] = {0}; | 
| 118   rtc::Buffer encoded; | 118   rtc::Buffer encoded; | 
| 119   AudioEncoder::EncodedInfo info; | 119   AudioEncoder::EncodedInfo info; | 
| 120 | 120 | 
| 121   { | 121   { | 
| 122     ::testing::InSequence s; | 122     ::testing::InSequence s; | 
| 123     info.encoded_timestamp = 0; | 123     info.encoded_timestamp = 0; | 
| 124     EXPECT_CALL(external_encoder, | 124     EXPECT_CALL(external_encoder, | 
| 125                 EncodeInternal(0, rtc::ArrayView<const int16_t>(audio), | 125                 EncodeImpl(0, rtc::ArrayView<const int16_t>(audio), | 
| 126                                &encoded)) | 126                                &encoded)) | 
| 127         .WillOnce(Return(info)); | 127         .WillOnce(Return(info)); | 
| 128     EXPECT_CALL(external_encoder, Mark("A")); | 128     EXPECT_CALL(external_encoder, Mark("A")); | 
| 129     EXPECT_CALL(external_encoder, Mark("B")); | 129     EXPECT_CALL(external_encoder, Mark("B")); | 
| 130     info.encoded_timestamp = 2; | 130     info.encoded_timestamp = 2; | 
| 131     EXPECT_CALL(external_encoder, | 131     EXPECT_CALL(external_encoder, | 
| 132                 EncodeInternal(2, rtc::ArrayView<const int16_t>(audio), | 132                 EncodeImpl(2, rtc::ArrayView<const int16_t>(audio), | 
| 133                                &encoded)) | 133                                &encoded)) | 
| 134         .WillOnce(Return(info)); | 134         .WillOnce(Return(info)); | 
| 135     EXPECT_CALL(external_encoder, Die()); | 135     EXPECT_CALL(external_encoder, Die()); | 
| 136   } | 136   } | 
| 137 | 137 | 
| 138   info = external_encoder.Encode(0, audio, &encoded); | 138   info = external_encoder.Encode(0, audio, &encoded); | 
| 139   EXPECT_EQ(0u, info.encoded_timestamp); | 139   EXPECT_EQ(0u, info.encoded_timestamp); | 
| 140   external_encoder.Mark("A"); | 140   external_encoder.Mark("A"); | 
| 141 | 141 | 
| 142   // Change to internal encoder. | 142   // Change to internal encoder. | 
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 213 #if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 213 #if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 
| 214 TEST(RentACodecTest, RentEncoderStackWithoutSpeechEncoder) { | 214 TEST(RentACodecTest, RentEncoderStackWithoutSpeechEncoder) { | 
| 215   RentACodec::StackParameters sp; | 215   RentACodec::StackParameters sp; | 
| 216   EXPECT_EQ(nullptr, sp.speech_encoder); | 216   EXPECT_EQ(nullptr, sp.speech_encoder); | 
| 217   EXPECT_DEATH(RentACodec().RentEncoderStack(&sp), ""); | 217   EXPECT_DEATH(RentACodec().RentEncoderStack(&sp), ""); | 
| 218 } | 218 } | 
| 219 #endif | 219 #endif | 
| 220 | 220 | 
| 221 }  // namespace acm2 | 221 }  // namespace acm2 | 
| 222 }  // namespace webrtc | 222 }  // namespace webrtc | 
| OLD | NEW | 
|---|