| Index: chromecast/media/base/video_plane_controller.h
|
| diff --git a/chromecast/media/base/video_plane_controller.h b/chromecast/media/base/video_plane_controller.h
|
| index 7b20b4869bd7c57e496e40ff4d1b70a4a6658f13..852cdfba2c91fd5f55cfa8c0c8bc726d22590a05 100644
|
| --- a/chromecast/media/base/video_plane_controller.h
|
| +++ b/chromecast/media/base/video_plane_controller.h
|
| @@ -23,41 +23,34 @@ namespace media {
|
| // should use this over VideoPlane::SetGeometry. Reasons for this:
|
| // * provides conversion between graphics plane coordinates and screen
|
| // resolution coordinates
|
| -// * updates VideoPlane when graphics plane or screen resolution changes
|
| +// * updates VideoPlane when screen resolution changes
|
| // * handles threading correctly (posting SetGeometry to media thread).
|
| // * coalesces multiple calls in short space of time to prevent flooding the
|
| // media thread with SetGeometry calls (which are expensive on many
|
| // platforms).
|
| -// The class collects/caches the data it needs before it can start operating.
|
| -// This means SetGeometry, SetDeviceResolution, and SetGraphicsPlaneResolution
|
| -// need to be called at least once in any order before the class starts making
|
| -// calls to VideoPlane::SetGeometry. All calls to these methods beforehand just
|
| -// set/update the cached parameters.
|
| -// All calls to public methods should be from the same thread.
|
| +// All public methods should be called from the same thread that the class was
|
| +// constructed on.
|
| class VideoPlaneController {
|
| public:
|
| explicit VideoPlaneController(
|
| scoped_refptr<base::SingleThreadTaskRunner> media_task_runner);
|
| ~VideoPlaneController();
|
| - // Sets the video plane geometry (forwards to VideoPlane::SetGeometry)
|
| - // in *graphics plane coordinates*.
|
| - // * This should be called on UI thread (hopping to media thread is handled
|
| - // internally).
|
| - // If there is no change to video plane parameters from the last call to this
|
| - // method, it is a no-op.
|
| + // Sets the video plane geometry in *graphics plane coordinates*. If there is
|
| + // no change to video plane parameters from the last call to this method, it
|
| + // is a no-op.
|
| void SetGeometry(const RectF& display_rect, VideoPlane::Transform transform);
|
|
|
| - // Sets physical screen resolution. This must be called at least once when
|
| + // Sets physical screen resolution. This must be called at least once when
|
| // the final output resolution (HDMI signal or panel resolution) is known,
|
| - // then later when it changes. If there is no change to the device resolution
|
| + // then later when it changes. If there is no change to the screen resolution
|
| // from the last call to this method, it is a no-op.
|
| - void SetDeviceResolution(const Size& resolution);
|
| + void SetScreenResolution(const Size& resolution);
|
|
|
| - // Sets graphics hardware plane resolution. This must be called at least once
|
| - // when the hardware graphics plane resolution (same resolution as
|
| - // gfx::Screen) is known, then later when it changes. If there is no change to
|
| - // the graphics plane resolution from the last call to this method, it is a
|
| - // no-op.
|
| + // Sets graphics hardware plane resolution, and clears any cached video plane
|
| + // geometry parameters. This must be called at least once when the hardware
|
| + // graphics plane resolution (same resolution as gfx::Screen) is known, then
|
| + // later when it changes. If there is no change to the graphics plane
|
| + // resolution from the last call to this method, it is a no-op.
|
| void SetGraphicsPlaneResolution(const Size& resolution);
|
|
|
| // After Pause is called, no further calls to VideoPlane::SetGeometry will be
|
| @@ -68,9 +61,8 @@ class VideoPlaneController {
|
| // media thread. When this returns, the caller needs to know that absolutely
|
| // no more SetGeometry calls will be made.
|
| void Pause();
|
| - // Makes class active again. Also resets the video plane by posting a call to
|
| - // VideoPlane::SetGeometry with most recent resolution and geometry parameters
|
| - // (assuming they are all set). Safe to call multiple times.
|
| + // Makes class active again, and clears any cached video plane geometry
|
| + // parameters. Safe to call multiple times.
|
| void Resume();
|
| bool is_paused() const;
|
|
|
| @@ -85,14 +77,16 @@ class VideoPlaneController {
|
| // Checks if all data has been collected to make calls to
|
| // VideoPlane::SetGeometry.
|
| bool HaveDataForSetGeometry() const;
|
| + // Clears any cached video plane geometry parameters.
|
| + void ClearVideoPlaneGeometry();
|
|
|
| bool is_paused_;
|
|
|
| // Current resolutions
|
| - bool have_output_res_;
|
| - bool have_graphics_res_;
|
| - Size output_res_;
|
| - Size graphics_res_;
|
| + bool have_screen_res_;
|
| + bool have_graphics_plane_res_;
|
| + Size screen_res_;
|
| + Size graphics_plane_res_;
|
|
|
| // Saved video plane parameters (in graphics plane coordinates)
|
| // for use when screen resolution changes.
|
|
|