Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: media/base/sample_format.h

Issue 2503233003: Add enumerations for compressed (E)AC3 sample format (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 kSampleFormatBitstreamAc3, // Compressed AC3 bitstream.
DaleCurtis 2016/11/17 00:02:15 Just kSampleFormatAC3, ditto for EAC3?
AndyWu 2016/11/17 18:56:55 Done.
27 kSampleFormatBitstreamEac3, // Compressed E-AC3 bitstream.
26 28
27 // Must always be equal to largest value ever logged. 29 // Must always be equal to largest value ever logged.
28 kSampleFormatMax = kSampleFormatS24, 30 kSampleFormatMax = kSampleFormatBitstreamEac3,
29 }; 31 };
30 32
31 // Returns the number of bytes used per channel for the specified 33 // Returns the number of bytes used per channel for the specified
32 // |sample_format|. 34 // |sample_format|.
33 MEDIA_EXPORT int SampleFormatToBytesPerChannel(SampleFormat sample_format); 35 MEDIA_EXPORT int SampleFormatToBytesPerChannel(SampleFormat sample_format);
34 36
35 // Returns the name of the sample format as a string 37 // Returns the name of the sample format as a string
36 MEDIA_EXPORT const char* SampleFormatToString(SampleFormat sample_format); 38 MEDIA_EXPORT const char* SampleFormatToString(SampleFormat sample_format);
37 39
38 // Returns true if |sample_format| is planar, false otherwise. 40 // Returns true if |sample_format| is planar, false otherwise.
39 MEDIA_EXPORT bool IsPlanar(SampleFormat sample_format); 41 MEDIA_EXPORT bool IsPlanar(SampleFormat sample_format);
40 42
41 // Returns true if |sample_format| is interleaved, false otherwise. 43 // Returns true if |sample_format| is interleaved, false otherwise.
42 MEDIA_EXPORT bool IsInterleaved(SampleFormat sample_format); 44 MEDIA_EXPORT bool IsInterleaved(SampleFormat sample_format);
43 45
46 // Returns true if |sample_format| is compressed bitstream, false otherwise.
47 MEDIA_EXPORT bool IsCompressed(SampleFormat sample_format);
48
44 } // namespace media 49 } // namespace media
45 50
46 #endif // MEDIA_BASE_SAMPLE_FORMAT_H_ 51 #endif // MEDIA_BASE_SAMPLE_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698