| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "media/base/channel_layout.h" | 9 #include "media/base/channel_layout.h" |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| 11 | 11 |
| 12 struct MEDIA_EXPORT AudioInputBufferParameters { |
| 13 double volume; |
| 14 uint32 size; |
| 15 }; |
| 16 |
| 17 // Use a struct-in-struct approach to ensure that we can calculate the required |
| 18 // size as sizeof(AudioInputBufferParameters) + #(bytes in audio buffer) without |
| 19 // using packing. |
| 20 struct MEDIA_EXPORT AudioInputBuffer { |
| 21 AudioInputBufferParameters params; |
| 22 int8 audio[1]; |
| 23 }; |
| 24 |
| 12 // TODO(vrk): This should probably be changed to an immutable object instead of | 25 // TODO(vrk): This should probably be changed to an immutable object instead of |
| 13 // a struct. See crbug.com/115902. | 26 // a struct. See crbug.com/115902. |
| 14 struct MEDIA_EXPORT AudioParameters { | 27 struct MEDIA_EXPORT AudioParameters { |
| 15 // Compare is useful when AudioParameters is used as a key in std::map. | 28 // Compare is useful when AudioParameters is used as a key in std::map. |
| 16 class MEDIA_EXPORT Compare { | 29 class MEDIA_EXPORT Compare { |
| 17 public: | 30 public: |
| 18 bool operator()(const AudioParameters& a, const AudioParameters& b) const; | 31 bool operator()(const AudioParameters& a, const AudioParameters& b) const; |
| 19 }; | 32 }; |
| 20 | 33 |
| 21 enum Format { | 34 enum Format { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 ChannelLayout channel_layout; // Order of surround sound channels. | 63 ChannelLayout channel_layout; // Order of surround sound channels. |
| 51 int sample_rate; // Sampling frequency/rate. | 64 int sample_rate; // Sampling frequency/rate. |
| 52 int bits_per_sample; // Number of bits per sample. | 65 int bits_per_sample; // Number of bits per sample. |
| 53 int samples_per_packet; // Size of a packet in frames. | 66 int samples_per_packet; // Size of a packet in frames. |
| 54 | 67 |
| 55 int channels; // Number of channels. Value set based on | 68 int channels; // Number of channels. Value set based on |
| 56 // |channel_layout|. | 69 // |channel_layout|. |
| 57 }; | 70 }; |
| 58 | 71 |
| 59 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 72 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
| OLD | NEW |