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,
25 // Output video plane as coordinate type.
26 COORDINATE_TYPE_VIDEO_PLANE_RESOLUTION
= 1,
30 virtual ~VideoPlane();
32 // Gets output screen resolution.
33 virtual gfx::Size
GetScreenResolution() = 0;
35 // Updates the video plane geometry.
36 // |quad.p1()| corresponds to the top left of the original video,
37 // |quad.p2()| to the top right of the original video,
39 // Depending on the underlying hardware, the exact geometry
40 // might not be honored.
41 // |coordinate_type| indicates what coordinate type |quad| refers to.
42 virtual void SetGeometry(const gfx::QuadF
& quad
,
43 CoordinateType coordinate_type
) = 0;
45 // Should be invoked whenever screen resolution changes (e.g. when a device is
46 // plugged into a new HDMI port and a new HDMI EDID is received).
47 // VideoPlane should reposition itself according to the new screen resolution.
48 virtual void OnScreenResolutionChanged(const gfx::Size
& screen_res
) = 0;
51 DISALLOW_COPY_AND_ASSIGN(VideoPlane
);
54 // Factory to create a VideoPlane.
55 scoped_ptr
<VideoPlane
> CreateVideoPlane();
57 // Global accessor to the video plane.
58 VideoPlane
* GetVideoPlane();
61 } // namespace chromecast
63 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PLANE_H_