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

Unified Diff: media/base/sample_format.cc

Issue 1468153003: Define AudioBuffer and VideoFrame for mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch statement Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/sample_format.h ('k') | media/mojo/interfaces/decryptor.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/sample_format.cc
diff --git a/media/base/sample_format.cc b/media/base/sample_format.cc
index 464fc1b6f578e0f4187f40365d18f4ef8922a20b..dd0bc1d0195fd9f12428f00f43b2ec92a325327f 100644
--- a/media/base/sample_format.cc
+++ b/media/base/sample_format.cc
@@ -51,4 +51,40 @@ const char* SampleFormatToString(SampleFormat sample_format) {
return "";
}
+bool IsPlanar(SampleFormat sample_format) {
+ switch (sample_format) {
+ case kSampleFormatPlanarS16:
+ case kSampleFormatPlanarF32:
+ case kSampleFormatPlanarS32:
+ return true;
+ case kUnknownSampleFormat:
+ case kSampleFormatU8:
+ case kSampleFormatS16:
+ case kSampleFormatS32:
+ case kSampleFormatF32:
+ return false;
+ }
+
+ NOTREACHED() << "Invalid sample format provided: " << sample_format;
+ return false;
+}
+
+bool IsInterleaved(SampleFormat sample_format) {
+ switch (sample_format) {
+ case kSampleFormatU8:
+ case kSampleFormatS16:
+ case kSampleFormatS32:
+ case kSampleFormatF32:
+ return true;
+ case kUnknownSampleFormat:
+ case kSampleFormatPlanarS16:
+ case kSampleFormatPlanarF32:
+ case kSampleFormatPlanarS32:
+ return false;
+ }
+
+ NOTREACHED() << "Invalid sample format provided: " << sample_format;
+ return false;
+}
+
} // namespace media
« no previous file with comments | « media/base/sample_format.h ('k') | media/mojo/interfaces/decryptor.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698