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

Unified Diff: chromecast/media/base/media_codec_support.cc

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test + android fixes Created 5 years, 5 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
Index: chromecast/media/base/media_codec_support.cc
diff --git a/chromecast/media/base/media_codec_support.cc b/chromecast/media/base/media_codec_support.cc
index b04a077961e31c0d6274e43feb7e844bb7410fad..57ae5a8974a0083db5efe39bb3bfd3cca691f7fc 100644
--- a/chromecast/media/base/media_codec_support.cc
+++ b/chromecast/media/base/media_codec_support.cc
@@ -4,13 +4,48 @@
#include "chromecast/media/base/media_codec_support.h"
-// TODO(gunsch/servolk): delete this file once a solution exists upstream.
+#include "base/bind.h"
+#include "chromecast/media/base/media_caps.h"
+#include "chromecast/public/media_codec_support_shlib.h"
+#include "net/base/mime_util.h"
+// TODO(gunsch/servolk): delete this definition once a solution exists upstream.
gunsch 2015/07/27 17:14:49 You might be able to resolve this TODO now. Intern
servolk 2015/07/27 21:25:47 It's true, internal implementations won't call thi
halliwell 2015/07/28 02:19:35 I could remove this TODO by just returning true lo
gunsch 2015/07/29 17:04:19 Yeah, go ahead and delete it. We shouldn't be defi
halliwell 2015/07/29 19:58:19 Ok, removed.
namespace net {
-
bool DefaultIsCodecSupported(const std::string&) {
return true;
}
+}
+
+namespace chromecast {
+namespace media {
+namespace {
+
+bool IsCodecSupported(const std::string& codec) {
+ MediaCodecSupportShlib::CodecSupport platform_support =
+ MediaCodecSupportShlib::IsSupported(codec);
+ if (platform_support == MediaCodecSupportShlib::kSupported)
+ return true;
+ else if (platform_support == MediaCodecSupportShlib::kNotSupported)
+ return false;
+
+ if (codec == "aac51") {
+ return ::media::HdmiSinkSupportsPcmSurroundSound();
+ }
+ if (codec == "ac-3" || codec == "mp4a.a5") {
+ return ::media::HdmiSinkSupportsAC3();
+ }
+ if (codec == "ec-3" || codec == "mp4a.a6") {
+ return ::media::HdmiSinkSupportsEAC3();
+ }
-} // namespace net
+ return net::DefaultIsCodecSupported(codec);
+}
+
+} // namespace
+
+net::IsCodecSupportedCB GetIsCodecSupportedOnChromecastCB() {
+ return base::Bind(&IsCodecSupported);
+}
+} // namespace media
+} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698