| 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 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 class AcmReceiverTestOldApi : public AudioPacketizationCallback, | 42 class AcmReceiverTestOldApi : public AudioPacketizationCallback, |
| 43 public ::testing::Test { | 43 public ::testing::Test { |
| 44 protected: | 44 protected: |
| 45 AcmReceiverTestOldApi() | 45 AcmReceiverTestOldApi() |
| 46 : timestamp_(0), | 46 : timestamp_(0), |
| 47 packet_sent_(false), | 47 packet_sent_(false), |
| 48 last_packet_send_timestamp_(timestamp_), | 48 last_packet_send_timestamp_(timestamp_), |
| 49 last_frame_type_(kFrameEmpty) { | 49 last_frame_type_(kEmptyFrame) { |
| 50 AudioCodingModule::Config config; | 50 AudioCodingModule::Config config; |
| 51 acm_.reset(new AudioCodingModuleImpl(config)); | 51 acm_.reset(new AudioCodingModuleImpl(config)); |
| 52 receiver_.reset(new AcmReceiver(config)); | 52 receiver_.reset(new AcmReceiver(config)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 ~AcmReceiverTestOldApi() {} | 55 ~AcmReceiverTestOldApi() {} |
| 56 | 56 |
| 57 void SetUp() override { | 57 void SetUp() override { |
| 58 ASSERT_TRUE(receiver_.get() != NULL); | 58 ASSERT_TRUE(receiver_.get() != NULL); |
| 59 ASSERT_TRUE(acm_.get() != NULL); | 59 ASSERT_TRUE(acm_.get() != NULL); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ++n; | 113 ++n; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 int SendData(FrameType frame_type, | 117 int SendData(FrameType frame_type, |
| 118 uint8_t payload_type, | 118 uint8_t payload_type, |
| 119 uint32_t timestamp, | 119 uint32_t timestamp, |
| 120 const uint8_t* payload_data, | 120 const uint8_t* payload_data, |
| 121 size_t payload_len_bytes, | 121 size_t payload_len_bytes, |
| 122 const RTPFragmentationHeader* fragmentation) override { | 122 const RTPFragmentationHeader* fragmentation) override { |
| 123 if (frame_type == kFrameEmpty) | 123 if (frame_type == kEmptyFrame) |
| 124 return 0; | 124 return 0; |
| 125 | 125 |
| 126 rtp_header_.header.payloadType = payload_type; | 126 rtp_header_.header.payloadType = payload_type; |
| 127 rtp_header_.frameType = frame_type; | 127 rtp_header_.frameType = frame_type; |
| 128 if (frame_type == kAudioFrameSpeech) | 128 if (frame_type == kAudioFrameSpeech) |
| 129 rtp_header_.type.Audio.isCNG = false; | 129 rtp_header_.type.Audio.isCNG = false; |
| 130 else | 130 else |
| 131 rtp_header_.type.Audio.isCNG = true; | 131 rtp_header_.type.Audio.isCNG = true; |
| 132 rtp_header_.header.timestamp = timestamp; | 132 rtp_header_.header.timestamp = timestamp; |
| 133 | 133 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 EXPECT_EQ(kCodecId[n], receiver_->last_audio_codec_id()); | 361 EXPECT_EQ(kCodecId[n], receiver_->last_audio_codec_id()); |
| 362 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); | 362 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); |
| 363 EXPECT_TRUE(CodecsEqual(codecs_[kCodecId[n]], codec)); | 363 EXPECT_TRUE(CodecsEqual(codecs_[kCodecId[n]], codec)); |
| 364 ++n; | 364 ++n; |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace acm2 | 368 } // namespace acm2 |
| 369 | 369 |
| 370 } // namespace webrtc | 370 } // namespace webrtc |
| OLD | NEW |