OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 frame2.samples_per_channel_); | 46 frame2.samples_per_channel_); |
47 for (size_t i = 0; i < frame1.samples_per_channel_ * frame1.num_channels_; | 47 for (size_t i = 0; i < frame1.samples_per_channel_ * frame1.num_channels_; |
48 i++) { | 48 i++) { |
49 EXPECT_EQ(frame1.data_[i], frame2.data_[i]); | 49 EXPECT_EQ(frame1.data_[i], frame2.data_[i]); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 void InitFrame(AudioFrame* frame, size_t channels, size_t samples_per_channel, | 53 void InitFrame(AudioFrame* frame, size_t channels, size_t samples_per_channel, |
54 int16_t left_data, int16_t right_data) { | 54 int16_t left_data, int16_t right_data) { |
55 RTC_DCHECK(frame); | 55 RTC_DCHECK(frame); |
56 RTC_DCHECK_GE(2u, channels); | 56 RTC_DCHECK_GE(2, channels); |
57 RTC_DCHECK_GE(AudioFrame::kMaxDataSizeSamples, | 57 RTC_DCHECK_GE(AudioFrame::kMaxDataSizeSamples, |
58 samples_per_channel * channels); | 58 samples_per_channel * channels); |
59 frame->samples_per_channel_ = samples_per_channel; | 59 frame->samples_per_channel_ = samples_per_channel; |
60 frame->num_channels_ = channels; | 60 frame->num_channels_ = channels; |
61 if (channels == 2) { | 61 if (channels == 2) { |
62 SetFrameData(frame, left_data, right_data); | 62 SetFrameData(frame, left_data, right_data); |
63 } else if (channels == 1) { | 63 } else if (channels == 1) { |
64 SetFrameData(frame, left_data); | 64 SetFrameData(frame, left_data); |
65 } | 65 } |
66 } | 66 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 AudioFrame scaled_frame; | 361 AudioFrame scaled_frame; |
362 scaled_frame.samples_per_channel_ = 320; | 362 scaled_frame.samples_per_channel_ = 320; |
363 scaled_frame.num_channels_ = 1; | 363 scaled_frame.num_channels_ = 1; |
364 SetFrameData(&scaled_frame, 2); | 364 SetFrameData(&scaled_frame, 2); |
365 VerifyFramesAreEqual(scaled_frame, frame_); | 365 VerifyFramesAreEqual(scaled_frame, frame_); |
366 } | 366 } |
367 | 367 |
368 } // namespace | 368 } // namespace |
369 } // namespace webrtc | 369 } // namespace webrtc |
OLD | NEW |