OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SAMPLE_FORMAT_H_ | 5 #ifndef MEDIA_BASE_SAMPLE_FORMAT_H_ |
6 #define MEDIA_BASE_SAMPLE_FORMAT_H_ | 6 #define MEDIA_BASE_SAMPLE_FORMAT_H_ |
7 | 7 |
8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 enum SampleFormat { | 12 enum SampleFormat { |
13 // These values are histogrammed over time; do not change their ordinal | 13 // These values are histogrammed over time; do not change their ordinal |
14 // values. When deleting a sample format replace it with a dummy value; when | 14 // values. When deleting a sample format replace it with a dummy value; when |
15 // adding a sample format, do so at the bottom before kSampleFormatMax, and | 15 // adding a sample format, do so at the bottom before kSampleFormatMax, and |
16 // update the value of kSampleFormatMax. | 16 // update the value of kSampleFormatMax. |
17 kUnknownSampleFormat = 0, | 17 kUnknownSampleFormat = 0, |
18 kSampleFormatU8, // Unsigned 8-bit w/ bias of 128. | 18 kSampleFormatU8, // Unsigned 8-bit w/ bias of 128. |
19 kSampleFormatS16, // Signed 16-bit. | 19 kSampleFormatS16, // Signed 16-bit. |
20 kSampleFormatS32, // Signed 32-bit. | 20 kSampleFormatS32, // Signed 32-bit. |
21 kSampleFormatF32, // Float 32-bit. | 21 kSampleFormatF32, // Float 32-bit. |
22 kSampleFormatPlanarS16, // Signed 16-bit planar. | 22 kSampleFormatPlanarS16, // Signed 16-bit planar. |
23 kSampleFormatPlanarF32, // Float 32-bit planar. | 23 kSampleFormatPlanarF32, // Float 32-bit planar. |
24 kSampleFormatPlanarS32, // Signed 32-bit planar. | 24 kSampleFormatPlanarS32, // Signed 32-bit planar. |
25 kSampleFormatS24, // Signed 24-bit. | 25 kSampleFormatS24, // Signed 24-bit. |
| 26 kSampleFormatRaw, // Raw compressed bitstream. |
26 | 27 |
27 // Must always be equal to largest value ever logged. | 28 // Must always be equal to largest value ever logged. |
28 kSampleFormatMax = kSampleFormatS24, | 29 kSampleFormatMax = kSampleFormatRaw, |
29 }; | 30 }; |
30 | 31 |
31 // Returns the number of bytes used per channel for the specified | 32 // Returns the number of bytes used per channel for the specified |
32 // |sample_format|. | 33 // |sample_format|. |
33 MEDIA_EXPORT int SampleFormatToBytesPerChannel(SampleFormat sample_format); | 34 MEDIA_EXPORT int SampleFormatToBytesPerChannel(SampleFormat sample_format); |
34 | 35 |
35 // Returns the name of the sample format as a string | 36 // Returns the name of the sample format as a string |
36 MEDIA_EXPORT const char* SampleFormatToString(SampleFormat sample_format); | 37 MEDIA_EXPORT const char* SampleFormatToString(SampleFormat sample_format); |
37 | 38 |
38 // Returns true if |sample_format| is planar, false otherwise. | 39 // Returns true if |sample_format| is planar, false otherwise. |
39 MEDIA_EXPORT bool IsPlanar(SampleFormat sample_format); | 40 MEDIA_EXPORT bool IsPlanar(SampleFormat sample_format); |
40 | 41 |
41 // Returns true if |sample_format| is interleaved, false otherwise. | 42 // Returns true if |sample_format| is interleaved, false otherwise. |
42 MEDIA_EXPORT bool IsInterleaved(SampleFormat sample_format); | 43 MEDIA_EXPORT bool IsInterleaved(SampleFormat sample_format); |
43 | 44 |
44 } // namespace media | 45 } // namespace media |
45 | 46 |
46 #endif // MEDIA_BASE_SAMPLE_FORMAT_H_ | 47 #endif // MEDIA_BASE_SAMPLE_FORMAT_H_ |
OLD | NEW |