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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/media/cma/backend/video_plane.h" 5 #include "chromecast/media/cma/backend/video_plane.h"
6 6
7 #include "base/logging.h"
8
7 namespace chromecast { 9 namespace chromecast {
8 namespace media { 10 namespace media {
9 11
10 VideoPlane::VideoPlane() { 12 VideoPlane::VideoPlane() {
11 } 13 }
12 14
13 VideoPlane::~VideoPlane() { 15 VideoPlane::~VideoPlane() {
14 } 16 }
15 17
18 class VideoPlaneRegistry {
19 public:
20 static VideoPlaneRegistry* GetInstance() {
21 return Singleton<VideoPlaneRegistry>::get();
22 }
23
24 VideoPlane* GetVideoPlane(int plane_id);
25
26 private:
27 friend struct DefaultSingletonTraits<VideoPlaneRegistry>;
28 friend class Singleton<VideoPlaneRegistry>;
29
30 VideoPlaneRegistry();
31 virtual ~VideoPlaneRegistry();
32
33 scoped_ptr<VideoPlane> video_plane_;
34
35 DISALLOW_COPY_AND_ASSIGN(VideoPlaneRegistry);
36 };
37
38 VideoPlaneRegistry::VideoPlaneRegistry() :
39 video_plane_(VideoPlaneFactory::CreatePlatformVideoPlane()) {
40 }
41
42 VideoPlaneRegistry::~VideoPlaneRegistry() {
43 }
44
45 VideoPlane* VideoPlaneRegistry::GetVideoPlane(int plane_id) {
46 // Only one video plane is supported at the moment
47 DCHECK_EQ(plane_id, 0);
48 return video_plane_.get();
49 }
50
51 VideoPlane* GetVideoPlane() {
52 // 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.
53 return VideoPlaneRegistry::GetInstance()->GetVideoPlane(0);
54 }
55
16 } // namespace media 56 } // namespace media
17 } // namespace chromecast 57 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698