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"
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
{
16 bool IsCodecSupported(const std::string
& codec
) {
17 MediaCodecSupportShlib::CodecSupport platform_support
=
18 MediaCodecSupportShlib::IsSupported(codec
);
19 if (platform_support
== MediaCodecSupportShlib::kSupported
)
21 else if (platform_support
== MediaCodecSupportShlib::kNotSupported
)
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();
39 net::IsCodecSupportedCB
GetIsCodecSupportedOnChromecastCB() {
40 return base::Bind(&IsCodecSupported
);
44 } // namespace chromecast