cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chromecast / media / base / media_codec_support.cc
blob1d82f9ca21787c66d11cbdd5e0f32d7df358e28a
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
3 // found in the LICENSE file.
5 #include "chromecast/media/base/media_codec_support.h"
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"
12 namespace chromecast {
13 namespace media {
14 namespace {
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;
24 if (codec == "aac51") {
25 return ::media::HdmiSinkSupportsPcmSurroundSound();
27 if (codec == "ac-3" || codec == "mp4a.a5") {
28 return ::media::HdmiSinkSupportsAC3();
30 if (codec == "ec-3" || codec == "mp4a.a6") {
31 return ::media::HdmiSinkSupportsEAC3();
34 return true;
37 } // namespace
39 net::IsCodecSupportedCB GetIsCodecSupportedOnChromecastCB() {
40 return base::Bind(&IsCodecSupported);
43 } // namespace media
44 } // namespace chromecast