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_BASE_AUDIO_DECODER_CONFIG_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "media/base/channel_layout.h" | 12 #include "media/base/channel_layout.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "media/base/sample_format.h" | 14 #include "media/base/sample_format.h" |
15 | 15 |
16 namespace media { | 16 namespace media { |
17 | 17 |
18 enum AudioCodec { | 18 enum AudioCodec { |
19 // These values are histogrammed over time; do not change their ordinal | 19 // These values are histogrammed over time; do not change their ordinal |
20 // values. When deleting a codec replace it with a dummy value; when adding a | 20 // values. When deleting a codec replace it with a dummy value; when adding a |
21 // codec, do so at the bottom before kAudioCodecMax. | 21 // codec, do so at the bottom before kAudioCodecMax, and update the value of |
| 22 // kAudioCodecMax to equal the new codec. |
22 kUnknownAudioCodec = 0, | 23 kUnknownAudioCodec = 0, |
23 kCodecAAC = 1, | 24 kCodecAAC = 1, |
24 kCodecMP3 = 2, | 25 kCodecMP3 = 2, |
25 kCodecPCM = 3, | 26 kCodecPCM = 3, |
26 kCodecVorbis = 4, | 27 kCodecVorbis = 4, |
27 kCodecFLAC = 5, | 28 kCodecFLAC = 5, |
28 kCodecAMR_NB = 6, | 29 kCodecAMR_NB = 6, |
29 kCodecAMR_WB = 7, | 30 kCodecAMR_WB = 7, |
30 kCodecPCM_MULAW = 8, | 31 kCodecPCM_MULAW = 8, |
31 kCodecGSM_MS = 9, | 32 kCodecGSM_MS = 9, |
32 kCodecPCM_S16BE = 10, | 33 kCodecPCM_S16BE = 10, |
33 kCodecPCM_S24BE = 11, | 34 kCodecPCM_S24BE = 11, |
34 kCodecOpus = 12, | 35 kCodecOpus = 12, |
35 // kCodecEAC3 = 13, | 36 // kCodecEAC3 = 13, |
36 kCodecPCM_ALAW = 14, | 37 kCodecPCM_ALAW = 14, |
37 // DO NOT ADD RANDOM AUDIO CODECS! | 38 // DO NOT ADD RANDOM AUDIO CODECS! |
38 // | 39 // |
39 // The only acceptable time to add a new codec is if there is production code | 40 // The only acceptable time to add a new codec is if there is production code |
40 // that uses said codec in the same CL. | 41 // that uses said codec in the same CL. |
41 | 42 |
42 // Must always be last! | 43 // Must always be equal to the largest entry ever logged. |
43 kAudioCodecMax | 44 kAudioCodecMax = kCodecPCM_ALAW, |
44 }; | 45 }; |
45 | 46 |
46 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of | 47 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of |
47 // |bits_per_channel|, we should switch over since bits are generally confusing | 48 // |bits_per_channel|, we should switch over since bits are generally confusing |
48 // to work with. | 49 // to work with. |
49 class MEDIA_EXPORT AudioDecoderConfig { | 50 class MEDIA_EXPORT AudioDecoderConfig { |
50 public: | 51 public: |
51 // Constructs an uninitialized object. Clients should call Initialize() with | 52 // Constructs an uninitialized object. Clients should call Initialize() with |
52 // appropriate values before using. | 53 // appropriate values before using. |
53 AudioDecoderConfig(); | 54 AudioDecoderConfig(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 base::TimeDelta codec_delay_; | 120 base::TimeDelta codec_delay_; |
120 | 121 |
121 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 122 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
122 // generated copy constructor and assignment operator. Since the extra data is | 123 // generated copy constructor and assignment operator. Since the extra data is |
123 // typically small, the performance impact is minimal. | 124 // typically small, the performance impact is minimal. |
124 }; | 125 }; |
125 | 126 |
126 } // namespace media | 127 } // namespace media |
127 | 128 |
128 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 129 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
OLD | NEW |