Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // VideoCaptureDevice is the abstract base class for realizing video capture | 5 // VideoCaptureDevice is the abstract base class for realizing video capture |
| 6 // device support in Chromium. It provides the interface for OS dependent | 6 // device support in Chromium. It provides the interface for OS dependent |
| 7 // implementations. | 7 // implementations. |
| 8 // The class is created and functions are invoked on a thread owned by | 8 // The class is created and functions are invoked on a thread owned by |
| 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS | 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS |
| 10 // specific implementation. | 10 // specific implementation. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 virtual void OnFrameInfoChanged(const VideoCaptureCapability& info) {}; | 183 virtual void OnFrameInfoChanged(const VideoCaptureCapability& info) {}; |
| 184 }; | 184 }; |
| 185 // Creates a VideoCaptureDevice object. | 185 // Creates a VideoCaptureDevice object. |
| 186 // Return NULL if the hardware is not available. | 186 // Return NULL if the hardware is not available. |
| 187 static VideoCaptureDevice* Create(const Name& device_name); | 187 static VideoCaptureDevice* Create(const Name& device_name); |
| 188 virtual ~VideoCaptureDevice(); | 188 virtual ~VideoCaptureDevice(); |
| 189 | 189 |
| 190 // Gets the names of all video capture devices connected to this computer. | 190 // Gets the names of all video capture devices connected to this computer. |
| 191 static void GetDeviceNames(Names* device_names); | 191 static void GetDeviceNames(Names* device_names); |
| 192 | 192 |
| 193 // Gets the capabilities of a particular device attached to the system. This | |
| 194 // method should be called before allocating or starting a device. In case | |
| 195 // format enumeration is not supported, or there was a problem, the formats | |
| 196 // array will be empty. | |
| 197 static void GetDeviceSupportedFormats(const Name& device, | |
| 198 VideoCaptureFormats* const formats); | |
|
perkj_chrome
2013/10/13 12:12:49
remove const - please see GetDeviceNAmes.
mcasas
2013/10/14 08:24:46
Done.
| |
| 199 | |
| 193 // Prepare the camera for use. After this function has been called no other | 200 // Prepare the camera for use. After this function has been called no other |
| 194 // applications can use the camera. On completion Client::OnFrameInfo() | 201 // applications can use the camera. On completion Client::OnFrameInfo() |
| 195 // is called informing of the resulting resolution and frame rate. | 202 // is called informing of the resulting resolution and frame rate. |
| 196 // StopAndDeAllocate() must be called before the object is deleted. | 203 // StopAndDeAllocate() must be called before the object is deleted. |
| 197 virtual void AllocateAndStart( | 204 virtual void AllocateAndStart( |
| 198 const VideoCaptureCapability& capture_format, | 205 const VideoCaptureCapability& capture_format, |
| 199 scoped_ptr<Client> client) = 0; | 206 scoped_ptr<Client> client) = 0; |
| 200 | 207 |
| 201 // Deallocates the camera, possibly asynchronously. | 208 // Deallocates the camera, possibly asynchronously. |
| 202 // | 209 // |
| 203 // This call requires the device to do the following things, eventually: put | 210 // This call requires the device to do the following things, eventually: put |
| 204 // camera hardware into a state where other applications could use it, free | 211 // camera hardware into a state where other applications could use it, free |
| 205 // the memory associated with capture, and delete the |client| pointer passed | 212 // the memory associated with capture, and delete the |client| pointer passed |
| 206 // into AllocateAndStart. | 213 // into AllocateAndStart. |
| 207 // | 214 // |
| 208 // If deallocation is done asynchronously, then the device implementation must | 215 // If deallocation is done asynchronously, then the device implementation must |
| 209 // ensure that a subsequent AllocateAndStart() operation targeting the same ID | 216 // ensure that a subsequent AllocateAndStart() operation targeting the same ID |
| 210 // would be sequenced through the same task runner, so that deallocation | 217 // would be sequenced through the same task runner, so that deallocation |
| 211 // happens first. | 218 // happens first. |
| 212 virtual void StopAndDeAllocate() = 0; | 219 virtual void StopAndDeAllocate() = 0; |
| 213 }; | 220 }; |
| 214 | 221 |
| 215 } // namespace media | 222 } // namespace media |
| 216 | 223 |
| 217 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 224 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |