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

Unified Diff: chromecast/media/cma/backend/video_plane.cc

Issue 809173002: Chromecast: Add a way to notify video plane about resolution changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: chromecast/media/cma/backend/video_plane.cc
diff --git a/chromecast/media/cma/backend/video_plane.cc b/chromecast/media/cma/backend/video_plane.cc
index 192fab8735cd788c776ae17c121fd301746efb33..c6ce469bd0f1d2e12b4f4a18065858d9cd4cf0f2 100644
--- a/chromecast/media/cma/backend/video_plane.cc
+++ b/chromecast/media/cma/backend/video_plane.cc
@@ -4,6 +4,8 @@
#include "chromecast/media/cma/backend/video_plane.h"
+#include "base/logging.h"
+
namespace chromecast {
namespace media {
@@ -13,5 +15,43 @@ VideoPlane::VideoPlane() {
VideoPlane::~VideoPlane() {
}
+class VideoPlaneRegistry {
+ public:
+ static VideoPlaneRegistry* GetInstance() {
+ return Singleton<VideoPlaneRegistry>::get();
+ }
+
+ VideoPlane* GetVideoPlane(int plane_id);
+
+ private:
+ friend struct DefaultSingletonTraits<VideoPlaneRegistry>;
+ friend class Singleton<VideoPlaneRegistry>;
+
+ VideoPlaneRegistry();
+ virtual ~VideoPlaneRegistry();
+
+ scoped_ptr<VideoPlane> video_plane_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoPlaneRegistry);
+};
+
+VideoPlaneRegistry::VideoPlaneRegistry() :
+ video_plane_(VideoPlaneFactory::CreatePlatformVideoPlane()) {
+}
+
+VideoPlaneRegistry::~VideoPlaneRegistry() {
+}
+
+VideoPlane* VideoPlaneRegistry::GetVideoPlane(int plane_id) {
+ // Only one video plane is supported at the moment
+ DCHECK_EQ(plane_id, 0);
+ return video_plane_.get();
+}
+
+VideoPlane* GetVideoPlane() {
+ // Only one video plane is supported at the moment
gunsch 2014/12/17 22:45:51 if you're defining this entire class inline, why n
servolk 2014/12/18 00:17:37 Done.
+ return VideoPlaneRegistry::GetInstance()->GetVideoPlane(0);
+}
+
} // namespace media
} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698