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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "chromecast/media/base/media_codec_support.h" 5 #include "chromecast/media/base/media_codec_support.h"
6 6
7 // TODO(gunsch/servolk): delete this file once a solution exists upstream. 7 #include "base/bind.h"
8 #include "chromecast/media/base/media_caps.h"
9 #include "chromecast/public/media_codec_support_shlib.h"
10 #include "net/base/mime_util.h"
8 11
12 // 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.
9 namespace net { 13 namespace net {
10
11 bool DefaultIsCodecSupported(const std::string&) { 14 bool DefaultIsCodecSupported(const std::string&) {
12 return true; 15 return true;
13 } 16 }
17 }
14 18
15 } // namespace net 19 namespace chromecast {
20 namespace media {
21 namespace {
16 22
23 bool IsCodecSupported(const std::string& codec) {
24 MediaCodecSupportShlib::CodecSupport platform_support =
25 MediaCodecSupportShlib::IsSupported(codec);
26 if (platform_support == MediaCodecSupportShlib::kSupported)
27 return true;
28 else if (platform_support == MediaCodecSupportShlib::kNotSupported)
29 return false;
30
31 if (codec == "aac51") {
32 return ::media::HdmiSinkSupportsPcmSurroundSound();
33 }
34 if (codec == "ac-3" || codec == "mp4a.a5") {
35 return ::media::HdmiSinkSupportsAC3();
36 }
37 if (codec == "ec-3" || codec == "mp4a.a6") {
38 return ::media::HdmiSinkSupportsEAC3();
39 }
40
41 return net::DefaultIsCodecSupported(codec);
42 }
43
44 } // namespace
45
46 net::IsCodecSupportedCB GetIsCodecSupportedOnChromecastCB() {
47 return base::Bind(&IsCodecSupported);
48 }
49
50 } // namespace media
51 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698