1 // Copyright 2014 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 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PLANE_H_
6 #define CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PLANE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
16 namespace chromecast
{
22 // Graphics plane as coordinate type.
23 COORDINATE_TYPE_GRAPHICS_PLANE
= 0,
24 // Output display screen as coordinate type.
25 COORDINATE_TYPE_SCREEN_RESOLUTION
= 1,
29 virtual ~VideoPlane();
31 // Gets output screen resolution.
32 virtual gfx::Size
GetScreenResolution() = 0;
34 // Updates the video plane geometry.
35 // |quad.p1()| corresponds to the top left of the original video,
36 // |quad.p2()| to the top right of the original video,
38 // Depending on the underlying hardware, the exact geometry
39 // might not be honored.
40 // |coordinate_type| indicates what coordinate type |quad| refers to.
41 virtual void SetGeometry(const gfx::QuadF
& quad
,
42 CoordinateType coordinate_type
) = 0;
44 // Should be invoked whenever screen resolution changes (e.g. when a device is
45 // plugged into a new HDMI port and a new HDMI EDID is received).
46 // VideoPlane should reposition itself according to the new screen resolution.
47 virtual void OnScreenResolutionChanged(const gfx::Size
& screen_res
) = 0;
50 DISALLOW_COPY_AND_ASSIGN(VideoPlane
);
53 // Factory to create a VideoPlane.
54 scoped_ptr
<VideoPlane
> CreateVideoPlane();
56 // Global accessor to the video plane.
57 VideoPlane
* GetVideoPlane();
60 } // namespace chromecast
62 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PLANE_H_