| 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 AcmReceiverTest : public AudioPacketizationCallback, | 42 class AcmReceiverTest : public AudioPacketizationCallback, |
| 43 public ::testing::Test { | 43 public ::testing::Test { |
| 44 protected: | 44 protected: |
| 45 AcmReceiverTest() | 45 AcmReceiverTest() |
| 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 AudioCoding::Config config; | 50 AudioCoding::Config config; |
| 51 config.transport = this; | 51 config.transport = this; |
| 52 acm_.reset(new AudioCodingImpl(config)); | 52 acm_.reset(new AudioCodingImpl(config)); |
| 53 receiver_.reset(new AcmReceiver(config.ToOldConfig())); | 53 receiver_.reset(new AcmReceiver(config.ToOldConfig())); |
| 54 } | 54 } |
| 55 | 55 |
| 56 ~AcmReceiverTest() {} | 56 ~AcmReceiverTest() {} |
| 57 | 57 |
| 58 void SetUp() override { | 58 void SetUp() override { |
| 59 ASSERT_TRUE(receiver_.get() != NULL); | 59 ASSERT_TRUE(receiver_.get() != NULL); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 ++n; | 114 ++n; |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 int32_t SendData(FrameType frame_type, | 118 int32_t SendData(FrameType frame_type, |
| 119 uint8_t payload_type, | 119 uint8_t payload_type, |
| 120 uint32_t timestamp, | 120 uint32_t timestamp, |
| 121 const uint8_t* payload_data, | 121 const uint8_t* payload_data, |
| 122 size_t payload_len_bytes, | 122 size_t payload_len_bytes, |
| 123 const RTPFragmentationHeader* fragmentation) override { | 123 const RTPFragmentationHeader* fragmentation) override { |
| 124 if (frame_type == kFrameEmpty) | 124 if (frame_type == kEmptyFrame) |
| 125 return 0; | 125 return 0; |
| 126 | 126 |
| 127 rtp_header_.header.payloadType = payload_type; | 127 rtp_header_.header.payloadType = payload_type; |
| 128 rtp_header_.frameType = frame_type; | 128 rtp_header_.frameType = frame_type; |
| 129 if (frame_type == kAudioFrameSpeech) | 129 if (frame_type == kAudioFrameSpeech) |
| 130 rtp_header_.type.Audio.isCNG = false; | 130 rtp_header_.type.Audio.isCNG = false; |
| 131 else | 131 else |
| 132 rtp_header_.type.Audio.isCNG = true; | 132 rtp_header_.type.Audio.isCNG = true; |
| 133 rtp_header_.header.timestamp = timestamp; | 133 rtp_header_.header.timestamp = timestamp; |
| 134 | 134 |
| (...skipping 226 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 |