Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: chromecast/media/base/video_plane_controller.cc

Issue 1824723003: [chromecast] Pass media task runner to VideoPlaneController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fixed android build Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/base/video_plane_controller.cc
diff --git a/chromecast/media/base/video_plane_controller.cc b/chromecast/media/base/video_plane_controller.cc
index e6496f42186e93e637134afe7aec850bc32fa518..3d63f9b2bea78ccce5142cc519e366789084119a 100644
--- a/chromecast/media/base/video_plane_controller.cc
+++ b/chromecast/media/base/video_plane_controller.cc
@@ -14,7 +14,6 @@
#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
-#include "chromecast/media/base/media_message_loop.h"
#include "chromecast/public/cast_media_shlib.h"
namespace chromecast {
@@ -140,10 +139,21 @@ class VideoPlaneController::RateLimitedSetVideoPlaneGeometry
DISALLOW_COPY_AND_ASSIGN(RateLimitedSetVideoPlaneGeometry);
};
-// static
-VideoPlaneController* VideoPlaneController::GetInstance() {
- return base::Singleton<VideoPlaneController>::get();
-}
+VideoPlaneController::VideoPlaneController(
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner)
+ : is_paused_(false),
+ have_output_res_(false),
+ have_graphics_res_(false),
+ output_res_(0, 0),
+ graphics_res_(0, 0),
+ have_video_plane_geometry_(false),
+ video_plane_display_rect_(0, 0),
+ video_plane_transform_(VideoPlane::TRANSFORM_NONE),
+ media_task_runner_(media_task_runner),
+ video_plane_wrapper_(
+ new RateLimitedSetVideoPlaneGeometry(media_task_runner_)) {}
+
+VideoPlaneController::~VideoPlaneController() {}
// TODO(esum): SetGeometry, SetDeviceResolution, and SetGraphicsPlaneResolution
// follow the same pattern (copy/paste). Currently it's not worth modularizing
@@ -224,21 +234,6 @@ bool VideoPlaneController::is_paused() const {
return is_paused_;
}
-VideoPlaneController::VideoPlaneController()
- : is_paused_(false),
- have_output_res_(false),
- have_graphics_res_(false),
- output_res_(0, 0),
- graphics_res_(0, 0),
- have_video_plane_geometry_(false),
- video_plane_display_rect_(0, 0),
- video_plane_transform_(VideoPlane::TRANSFORM_NONE),
- media_task_runner_(MediaMessageLoop::GetTaskRunner()),
- video_plane_wrapper_(
- new RateLimitedSetVideoPlaneGeometry(media_task_runner_)) {}
-
-VideoPlaneController::~VideoPlaneController() {}
-
void VideoPlaneController::MaybeRunSetGeometry() {
DCHECK(thread_checker_.CalledOnValidThread());
if (is_paused_) {
« no previous file with comments | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698