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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "media/base/audio_codecs.h" |
15 #include "media/base/channel_layout.h" | 16 #include "media/base/channel_layout.h" |
16 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
17 #include "media/base/sample_format.h" | 18 #include "media/base/sample_format.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 enum AudioCodec { | |
22 // These values are histogrammed over time; do not change their ordinal | |
23 // values. When deleting a codec replace it with a dummy value; when adding a | |
24 // codec, do so at the bottom before kAudioCodecMax, and update the value of | |
25 // kAudioCodecMax to equal the new codec. | |
26 kUnknownAudioCodec = 0, | |
27 kCodecAAC = 1, | |
28 kCodecMP3 = 2, | |
29 kCodecPCM = 3, | |
30 kCodecVorbis = 4, | |
31 kCodecFLAC = 5, | |
32 kCodecAMR_NB = 6, | |
33 kCodecAMR_WB = 7, | |
34 kCodecPCM_MULAW = 8, | |
35 kCodecGSM_MS = 9, | |
36 kCodecPCM_S16BE = 10, | |
37 kCodecPCM_S24BE = 11, | |
38 kCodecOpus = 12, | |
39 kCodecEAC3 = 13, | |
40 kCodecPCM_ALAW = 14, | |
41 kCodecALAC = 15, | |
42 kCodecAC3 = 16, | |
43 // DO NOT ADD RANDOM AUDIO CODECS! | |
44 // | |
45 // The only acceptable time to add a new codec is if there is production code | |
46 // that uses said codec in the same CL. | |
47 | |
48 // Must always be equal to the largest entry ever logged. | |
49 kAudioCodecMax = kCodecAC3, | |
50 }; | |
51 | |
52 std::string MEDIA_EXPORT GetCodecName(AudioCodec codec); | |
53 | |
54 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of | 22 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of |
55 // |bits_per_channel|, we should switch over since bits are generally confusing | 23 // |bits_per_channel|, we should switch over since bits are generally confusing |
56 // to work with. | 24 // to work with. |
57 class MEDIA_EXPORT AudioDecoderConfig { | 25 class MEDIA_EXPORT AudioDecoderConfig { |
58 public: | 26 public: |
59 // Constructs an uninitialized object. Clients should call Initialize() with | 27 // Constructs an uninitialized object. Clients should call Initialize() with |
60 // appropriate values before using. | 28 // appropriate values before using. |
61 AudioDecoderConfig(); | 29 AudioDecoderConfig(); |
62 | 30 |
63 // Constructs an initialized object. | 31 // Constructs an initialized object. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 int codec_delay_; | 99 int codec_delay_; |
132 | 100 |
133 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 101 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
134 // generated copy constructor and assignment operator. Since the extra data is | 102 // generated copy constructor and assignment operator. Since the extra data is |
135 // typically small, the performance impact is minimal. | 103 // typically small, the performance impact is minimal. |
136 }; | 104 }; |
137 | 105 |
138 } // namespace media | 106 } // namespace media |
139 | 107 |
140 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 108 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
OLD | NEW |