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

Unified Diff: media/base/decode_capabilities.cc

Issue 2783963002: Add IsSupportedAudioConfig in MediaClient (Closed)
Patch Set: CR feedback Created 3 years, 9 months 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/decode_capabilities.h ('k') | media/base/key_systems_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decode_capabilities.cc
diff --git a/media/base/decode_capabilities.cc b/media/base/decode_capabilities.cc
index 48bc2ef0f3ae0f26a17ea3331749c0770861f5a1..64c32ba1b4e506f373c6ef6d126e173fa885eba3 100644
--- a/media/base/decode_capabilities.cc
+++ b/media/base/decode_capabilities.cc
@@ -102,6 +102,40 @@ bool IsColorSpaceSupported(const media::VideoColorSpace& color_space) {
return true;
}
+bool IsSupportedAudioConfig(const AudioConfig& config) {
+ switch (config.codec) {
+ case media::kCodecAAC:
+ case media::kCodecFLAC:
+ case media::kCodecMP3:
+ case media::kCodecOpus:
+ case media::kCodecPCM:
+ case media::kCodecPCM_MULAW:
+ case media::kCodecPCM_S16BE:
+ case media::kCodecPCM_S24BE:
+ case media::kCodecPCM_ALAW:
+ case media::kCodecVorbis:
+ return true;
+
+ case media::kCodecAMR_NB:
+ case media::kCodecAMR_WB:
+ case media::kCodecGSM_MS:
+#if defined(OS_CHROMEOS)
+ return true;
+#else
+ return false;
+#endif
+
+ case media::kCodecEAC3:
+ case media::kCodecALAC:
+ case media::kCodecAC3:
+ case media::kUnknownAudioCodec:
+ return false;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
// TODO(chcunningham): Query decoders for codec profile support. Add platform
// specific logic for Android (move from MimeUtilIntenral).
bool IsSupportedVideoConfig(const VideoConfig& config) {
@@ -128,4 +162,4 @@ bool IsSupportedVideoConfig(const VideoConfig& config) {
return false;
}
-} // namespace media
+} // namespace media
« no previous file with comments | « media/base/decode_capabilities.h ('k') | media/base/key_systems_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698