ServiceWorker: Consolidate version manipulation functions in SWProviderContext
[chromium-blink-merge.git] / chromecast / media / cma / backend / video_plane.h
blob6c98d29c59fd8109514750fc2859b16a166a7858
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"
11 namespace gfx {
12 class QuadF;
13 class Size;
16 namespace chromecast {
17 namespace media {
19 class VideoPlane {
20 public:
21 enum CoordinateType {
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,
29 VideoPlane();
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,
38 // and so on.
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;
50 private:
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();
60 } // namespace media
61 } // namespace chromecast
63 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_PLANE_H_