[MacViews] Show comboboxes with a native NSMenu
[chromium-blink-merge.git] / chromecast / media / base / cast_media_default.cc
blob0861ef7a76baa6f204f2c36d52379562505cbe9e
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 {
12 namespace media {
13 namespace {
15 class DefaultVideoPlane : public VideoPlane {
16 public:
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;
30 } // namespace
32 void CastMediaShlib::Initialize(const std::vector<std::string>& argv) {
33 g_video_plane = new DefaultVideoPlane();
36 void CastMediaShlib::Finalize() {
37 delete g_video_plane;
38 g_video_plane = nullptr;
41 VideoPlane* CastMediaShlib::GetVideoPlane() {
42 return g_video_plane;
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")
57 return kNotSupported;
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")
62 return kNotSupported;
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")
67 return kNotSupported;
68 #endif
70 return kDefault;
73 } // namespace media
74 } // namespace chromecast