OLD | NEW |
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 |
9 namespace net { | 12 namespace chromecast { |
| 13 namespace media { |
| 14 namespace { |
10 | 15 |
11 bool DefaultIsCodecSupported(const std::string&) { | 16 bool IsCodecSupported(const std::string& codec) { |
| 17 MediaCodecSupportShlib::CodecSupport platform_support = |
| 18 MediaCodecSupportShlib::IsSupported(codec); |
| 19 if (platform_support == MediaCodecSupportShlib::kSupported) |
| 20 return true; |
| 21 else if (platform_support == MediaCodecSupportShlib::kNotSupported) |
| 22 return false; |
| 23 |
| 24 if (codec == "aac51") { |
| 25 return ::media::HdmiSinkSupportsPcmSurroundSound(); |
| 26 } |
| 27 if (codec == "ac-3" || codec == "mp4a.a5") { |
| 28 return ::media::HdmiSinkSupportsAC3(); |
| 29 } |
| 30 if (codec == "ec-3" || codec == "mp4a.a6") { |
| 31 return ::media::HdmiSinkSupportsEAC3(); |
| 32 } |
| 33 |
12 return true; | 34 return true; |
13 } | 35 } |
14 | 36 |
15 } // namespace net | 37 } // namespace |
16 | 38 |
| 39 net::IsCodecSupportedCB GetIsCodecSupportedOnChromecastCB() { |
| 40 return base::Bind(&IsCodecSupported); |
| 41 } |
| 42 |
| 43 } // namespace media |
| 44 } // namespace chromecast |
OLD | NEW |