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. |
39 virtual void EnumerateDeviceDescriptors( | 41 virtual void EnumerateDeviceDescriptors( |
40 const base::Callback< | 42 const base::Callback< |
41 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); | 43 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); |
42 | 44 |
43 // Obtains the supported formats of a device. | 45 // Obtains the supported formats of a device. |
44 // This method should be called before allocating or starting a device. In | 46 // This method should be called before allocating or starting a device. In |
45 // case format enumeration is not supported, or there was a problem | 47 // case format enumeration is not supported, or there was a problem |
46 // |supported_formats| will be empty. | 48 // |supported_formats| will be empty. |
47 virtual void GetSupportedFormats( | 49 virtual void GetSupportedFormats( |
48 const VideoCaptureDeviceDescriptor& device_descriptor, | 50 const VideoCaptureDeviceDescriptor& device_descriptor, |
(...skipping 12 matching lines...) Expand all Loading... |
61 private: | 63 private: |
62 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( | 64 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( |
63 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 65 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
64 | 66 |
65 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); | 67 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); |
66 }; | 68 }; |
67 | 69 |
68 } // namespace media | 70 } // namespace media |
69 | 71 |
70 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 72 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
OLD | NEW |