summaryrefslogtreecommitdiff
path: root/media/base/sample_format.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-06-19 11:58:07 +0100
committerTorne (Richard Coles) <torne@google.com>2013-06-19 11:58:07 +0100
commit7d4cd473f85ac64c3747c96c277f9e506a0d2246 (patch)
treef5fecd524f5ac22cd38bcc6713b81f666730d5a1 /media/base/sample_format.h
parent84f2b2352908c30e40ae12ffe850dd8470f6c048 (diff)
downloadchromium_org-7d4cd473f85ac64c3747c96c277f9e506a0d2246.tar.gz
Merge from Chromium at DEPS revision r207203
This commit was generated by merge_to_master.py. Change-Id: I5fbb6854d092096c4d39edc2865a48be1b53c418
Diffstat (limited to 'media/base/sample_format.h')
-rw-r--r--media/base/sample_format.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/media/base/sample_format.h b/media/base/sample_format.h
new file mode 100644
index 0000000000..bcaa5b2785
--- /dev/null
+++ b/media/base/sample_format.h
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_SAMPLE_FORMAT_H
+#define MEDIA_BASE_SAMPLE_FORMAT_H
+
+#include "media/base/media_export.h"
+
+namespace media {
+
+enum SampleFormat {
+ // These values are histogrammed over time; do not change their ordinal
+ // values. When deleting a sample format replace it with a dummy value; when
+ // adding a sample format, do so at the bottom before kSampleFormatMax.
+ kUnknownSampleFormat = 0,
+ kSampleFormatU8, // Unsigned 8-bit w/ bias of 128.
+ kSampleFormatS16, // Signed 16-bit.
+ kSampleFormatS32, // Signed 32-bit.
+ kSampleFormatF32, // Float 32-bit.
+ kSampleFormatPlanarS16, // Signed 16-bit planar.
+ kSampleFormatPlanarF32, // Float 32-bit planar.
+
+ // Must always be last!
+ kSampleFormatMax
+};
+
+// Returns the number of bytes used per channel for the specified
+// |sample_format|.
+MEDIA_EXPORT int SampleFormatToBytesPerChannel(SampleFormat sample_format);
+
+} // namespace media
+
+#endif // MEDIA_BASE_SAMPLE_FORMAT_H