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

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller.h

Issue 270263008: Add a ChromeOS implementation of VideoCaptureDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // VideoCaptureController is the glue between a VideoCaptureDevice and all 5 // VideoCaptureController is the glue between a VideoCaptureDevice and all
6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of
7 // one (and only one) VideoCaptureDevice; both are owned by the 7 // one (and only one) VideoCaptureDevice; both are owned by the
8 // VideoCaptureManager. 8 // VideoCaptureManager.
9 // 9 //
10 // The VideoCaptureController is responsible for: 10 // The VideoCaptureController is responsible for:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "base/memory/ref_counted.h" 53 #include "base/memory/ref_counted.h"
54 #include "base/memory/scoped_ptr.h" 54 #include "base/memory/scoped_ptr.h"
55 #include "base/memory/weak_ptr.h" 55 #include "base/memory/weak_ptr.h"
56 #include "base/process/process.h" 56 #include "base/process/process.h"
57 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" 57 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h"
58 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" 58 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h"
59 #include "content/common/content_export.h" 59 #include "content/common/content_export.h"
60 #include "content/common/media/video_capture.h" 60 #include "content/common/media/video_capture.h"
61 #include "media/video/capture/video_capture_device.h" 61 #include "media/video/capture/video_capture_device.h"
62 #include "media/video/capture/video_capture_types.h" 62 #include "media/video/capture/video_capture_types.h"
63 #include "ui/gfx/display.h"
63 64
64 namespace content { 65 namespace content {
65 class VideoCaptureBufferPool; 66 class VideoCaptureBufferPool;
66 67
67 class CONTENT_EXPORT VideoCaptureController { 68 class CONTENT_EXPORT VideoCaptureController {
68 public: 69 public:
69 VideoCaptureController(); 70 VideoCaptureController();
70 virtual ~VideoCaptureController(); 71 virtual ~VideoCaptureController();
71 72
73 void SetDisplayRotation(gfx::Display::Rotation rotation) {
vrk (LEFT CHROMIUM) 2014/05/08 21:43:34 nit: this should be set_display_rotation.
Zachary Kuznia 2014/05/08 21:51:22 Done.
74 display_rotation_ = rotation;
75 }
76 gfx::Display::Rotation display_rotation() const { return display_rotation_; }
77
72 base::WeakPtr<VideoCaptureController> GetWeakPtr(); 78 base::WeakPtr<VideoCaptureController> GetWeakPtr();
73 79
74 // Return a new VideoCaptureDeviceClient to forward capture events to this 80 // Return a new VideoCaptureDeviceClient to forward capture events to this
75 // instance. 81 // instance.
76 scoped_ptr<media::VideoCaptureDevice::Client> NewDeviceClient(); 82 scoped_ptr<media::VideoCaptureDevice::Client> NewDeviceClient();
77 83
78 // Start video capturing and try to use the resolution specified in |params|. 84 // Start video capturing and try to use the resolution specified in |params|.
79 // Buffers will be shared to the client as necessary. The client will continue 85 // Buffers will be shared to the client as necessary. The client will continue
80 // to receive frames from the device until RemoveClient() is called. 86 // to receive frames from the device until RemoveClient() is called.
81 void AddClient(const VideoCaptureControllerID& id, 87 void AddClient(const VideoCaptureControllerID& id,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; 146 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
141 147
142 // All clients served by this controller. 148 // All clients served by this controller.
143 ControllerClients controller_clients_; 149 ControllerClients controller_clients_;
144 150
145 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing 151 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing
146 // state which stops the flow of data to clients. 152 // state which stops the flow of data to clients.
147 VideoCaptureState state_; 153 VideoCaptureState state_;
148 154
149 media::VideoCaptureFormat video_capture_format_; 155 media::VideoCaptureFormat video_capture_format_;
156 gfx::Display::Rotation display_rotation_;
150 157
151 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; 158 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_;
152 159
153 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); 160 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController);
154 }; 161 };
155 162
156 } // namespace content 163 } // namespace content
157 164
158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ 165 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698