1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromecast/media/cma/backend/video_plane.h"
7 #include "base/memory/singleton.h"
12 VideoPlane::VideoPlane() {
15 VideoPlane::~VideoPlane() {
18 class VideoPlaneRegistry
{
20 static VideoPlaneRegistry
* GetInstance() {
21 return Singleton
<VideoPlaneRegistry
>::get();
24 VideoPlane
* GetVideoPlane();
27 friend struct DefaultSingletonTraits
<VideoPlaneRegistry
>;
28 friend class Singleton
<VideoPlaneRegistry
>;
31 virtual ~VideoPlaneRegistry();
33 scoped_ptr
<VideoPlane
> video_plane_
;
35 DISALLOW_COPY_AND_ASSIGN(VideoPlaneRegistry
);
38 VideoPlaneRegistry::VideoPlaneRegistry() :
39 video_plane_(CreateVideoPlane()) {
42 VideoPlaneRegistry::~VideoPlaneRegistry() {
45 VideoPlane
* VideoPlaneRegistry::GetVideoPlane() {
46 return video_plane_
.get();
49 VideoPlane
* GetVideoPlane() {
50 return VideoPlaneRegistry::GetInstance()->GetVideoPlane();
54 } // namespace chromecast