OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/audio_parameters.h" | 5 #include "media/audio/audio_parameters.h" |
6 | 6 |
7 #include "media/base/limits.h" | 7 #include "media/base/limits.h" |
8 | 8 |
| 9 const int AudioInputBuffer::kSizeOfStructMinusArr = sizeof(AudioInputBuffer) - |
| 10 sizeof(reinterpret_cast<AudioInputBuffer*>(0)->audio); |
| 11 |
9 AudioParameters::AudioParameters() | 12 AudioParameters::AudioParameters() |
10 : format(AUDIO_PCM_LINEAR), | 13 : format(AUDIO_PCM_LINEAR), |
11 channel_layout(CHANNEL_LAYOUT_NONE), | 14 channel_layout(CHANNEL_LAYOUT_NONE), |
12 sample_rate(0), | 15 sample_rate(0), |
13 bits_per_sample(0), | 16 bits_per_sample(0), |
14 samples_per_packet(0), | 17 samples_per_packet(0), |
15 channels(0) { | 18 channels(0) { |
16 } | 19 } |
17 | 20 |
18 AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, | 21 AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 if (a.sample_rate < b.sample_rate) | 61 if (a.sample_rate < b.sample_rate) |
59 return true; | 62 return true; |
60 if (a.sample_rate > b.sample_rate) | 63 if (a.sample_rate > b.sample_rate) |
61 return false; | 64 return false; |
62 if (a.bits_per_sample < b.bits_per_sample) | 65 if (a.bits_per_sample < b.bits_per_sample) |
63 return true; | 66 return true; |
64 if (a.bits_per_sample > b.bits_per_sample) | 67 if (a.bits_per_sample > b.bits_per_sample) |
65 return false; | 68 return false; |
66 return a.samples_per_packet < b.samples_per_packet; | 69 return a.samples_per_packet < b.samples_per_packet; |
67 } | 70 } |
OLD | NEW |