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 #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/audio_decoder_config.h" | 9 #include "media/base/audio_decoder_config.h" |
10 #include "media/base/media_export.h" | |
11 | 10 |
12 struct MEDIA_EXPORT AudioParameters { | 11 struct AudioParameters { |
13 // Compare is useful when AudioParameters is used as a key in std::map. | 12 // Compare is useful when AudioParameters is used as a key in std::map. |
14 class MEDIA_EXPORT Compare { | 13 class Compare { |
15 public: | 14 public: |
16 bool operator()(const AudioParameters& a, const AudioParameters& b) const; | 15 bool operator()(const AudioParameters& a, const AudioParameters& b) const; |
17 }; | 16 }; |
18 | 17 |
19 enum Format { | 18 enum Format { |
20 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. | 19 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
21 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. | 20 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
22 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. | 21 AUDIO_MOCK, // Creates a dummy AudioOutputStream object. |
23 AUDIO_LAST_FORMAT // Only used for validation of format.y | 22 AUDIO_LAST_FORMAT // Only used for validation of format. |
24 }; | 23 }; |
25 | 24 |
26 // Telephone quality sample rate, mostly for speech-only audio. | 25 // Telephone quality sample rate, mostly for speech-only audio. |
27 static const uint32 kTelephoneSampleRate = 8000; | 26 static const uint32 kTelephoneSampleRate = 8000; |
28 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. | 27 // CD sampling rate is 44.1 KHz or conveniently 2x2x3x3x5x5x7x7. |
29 static const uint32 kAudioCDSampleRate = 44100; | 28 static const uint32 kAudioCDSampleRate = 44100; |
30 // Digital Audio Tape sample rate. | 29 // Digital Audio Tape sample rate. |
31 static const uint32 kAudioDATSampleRate = 48000; | 30 static const uint32 kAudioDATSampleRate = 48000; |
32 | 31 |
33 AudioParameters(); | 32 AudioParameters(); |
(...skipping 17 matching lines...) Expand all Loading... |
51 ChannelLayout channel_layout; // Order of surround sound channels. | 50 ChannelLayout channel_layout; // Order of surround sound channels. |
52 int sample_rate; // Sampling frequency/rate. | 51 int sample_rate; // Sampling frequency/rate. |
53 int bits_per_sample; // Number of bits per sample. | 52 int bits_per_sample; // Number of bits per sample. |
54 int samples_per_packet; // Size of a packet in frames. | 53 int samples_per_packet; // Size of a packet in frames. |
55 | 54 |
56 int channels; // Number of channels. Value set based on | 55 int channels; // Number of channels. Value set based on |
57 // |channel_layout|. | 56 // |channel_layout|. |
58 }; | 57 }; |
59 | 58 |
60 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ | 59 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ |
OLD | NEW |