| 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..5d8097f2a626073e24cd7778d2e2f58d41326652 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/memory/singleton.h"
|
| +
|
| namespace chromecast {
|
| namespace media {
|
|
|
| @@ -13,5 +15,40 @@ VideoPlane::VideoPlane() {
|
| VideoPlane::~VideoPlane() {
|
| }
|
|
|
| +class VideoPlaneRegistry {
|
| + public:
|
| + static VideoPlaneRegistry* GetInstance() {
|
| + return Singleton<VideoPlaneRegistry>::get();
|
| + }
|
| +
|
| + VideoPlane* GetVideoPlane();
|
| +
|
| + 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_(CreateVideoPlane()) {
|
| +}
|
| +
|
| +VideoPlaneRegistry::~VideoPlaneRegistry() {
|
| +}
|
| +
|
| +VideoPlane* VideoPlaneRegistry::GetVideoPlane() {
|
| + return video_plane_.get();
|
| +}
|
| +
|
| +VideoPlane* GetVideoPlane() {
|
| + return VideoPlaneRegistry::GetInstance()->GetVideoPlane();
|
| +}
|
| +
|
| } // namespace media
|
| } // namespace chromecast
|
|
|