| OLD | NEW |
| 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 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "media/capture/video/video_capture_device.h" | 10 #include "media/capture/video/video_capture_device.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 30 | 30 |
| 31 VideoCaptureDeviceFactory(); | 31 VideoCaptureDeviceFactory(); |
| 32 virtual ~VideoCaptureDeviceFactory(); | 32 virtual ~VideoCaptureDeviceFactory(); |
| 33 | 33 |
| 34 // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong. | 34 // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong. |
| 35 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( | 35 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( |
| 36 const VideoCaptureDeviceDescriptor& device_descriptor) = 0; | 36 const VideoCaptureDeviceDescriptor& device_descriptor) = 0; |
| 37 | 37 |
| 38 // Asynchronous version of GetDeviceDescriptors calling back to |callback|. | 38 // Asynchronous version of GetDeviceDescriptors calling back to |callback|. |
| 39 // TODO(chfremer): Consider removing this if none of the implementations | |
| 40 // overrides it. See crbug.com/708233. | |
| 41 virtual void EnumerateDeviceDescriptors( | 39 virtual void EnumerateDeviceDescriptors( |
| 42 const base::Callback< | 40 const base::Callback< |
| 43 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); | 41 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); |
| 44 | 42 |
| 45 // Obtains the supported formats of a device. | 43 // Obtains the supported formats of a device. |
| 46 // This method should be called before allocating or starting a device. In | 44 // This method should be called before allocating or starting a device. In |
| 47 // case format enumeration is not supported, or there was a problem | 45 // case format enumeration is not supported, or there was a problem |
| 48 // |supported_formats| will be empty. | 46 // |supported_formats| will be empty. |
| 49 virtual void GetSupportedFormats( | 47 virtual void GetSupportedFormats( |
| 50 const VideoCaptureDeviceDescriptor& device_descriptor, | 48 const VideoCaptureDeviceDescriptor& device_descriptor, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 63 private: | 61 private: |
| 64 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( | 62 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( |
| 65 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 63 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 66 | 64 |
| 67 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); | 65 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 } // namespace media | 68 } // namespace media |
| 71 | 69 |
| 72 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 70 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| OLD | NEW |