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 |