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/cma/backend/media_pipeline_backend_default.h"
6 #include "chromecast/public/cast_media_shlib.h"
7 #include "chromecast/public/graphics_types.h"
8 #include "chromecast/public/media_codec_support_shlib.h"
9 #include "chromecast/public/video_plane.h"
11 namespace chromecast
{
15 class DefaultVideoPlane
: public VideoPlane
{
17 ~DefaultVideoPlane() override
{}
19 Size
GetScreenResolution() override
{ return Size(1920, 1080); }
21 void SetGeometry(const RectF
& display_rect
,
22 CoordinateType coordinate_type
,
23 Transform transform
) override
{}
25 void OnScreenResolutionChanged(const Size
& screen_res
) override
{}
28 DefaultVideoPlane
* g_video_plane
= nullptr;
32 void CastMediaShlib::Initialize(const std::vector
<std::string
>& argv
) {
33 g_video_plane
= new DefaultVideoPlane();
36 void CastMediaShlib::Finalize() {
38 g_video_plane
= nullptr;
41 VideoPlane
* CastMediaShlib::GetVideoPlane() {
45 MediaPipelineBackend
* CastMediaShlib::CreateMediaPipelineBackend(
46 const MediaPipelineDeviceParams
& params
) {
47 return new MediaPipelineBackendDefault(params
);
50 MediaCodecSupportShlib::CodecSupport
MediaCodecSupportShlib::IsSupported(
51 const std::string
& codec
) {
52 #if defined(OS_ANDROID)
53 // TODO(servolk): Find a way to reuse IsCodecSupportedOnAndroid.
55 // Theora is not supported
56 if (codec
== "theora")
59 // MPEG-2 variants of AAC are not supported on Android.
60 // MPEG2_AAC_MAIN / MPEG2_AAC_LC / MPEG2_AAC_SSR
61 if (codec
== "mp4a.66" || codec
== "mp4a.67" || codec
== "mp4a.68")
64 // VP9 is guaranteed supported but is often software-decode only.
65 // TODO(gunsch/servolk): look into querying for hardware decode support.
66 if (codec
== "vp9" || codec
== "vp9.0")
74 } // namespace chromecast