| 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 27 matching lines...) Expand all Loading... |
| 38 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); | 38 void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback); |
| 39 | 39 |
| 40 // Obtains the supported formats of a device. | 40 // Obtains the supported formats of a device. |
| 41 // This method should be called before allocating or starting a device. In | 41 // This method should be called before allocating or starting a device. In |
| 42 // case format enumeration is not supported, or there was a problem | 42 // case format enumeration is not supported, or there was a problem |
| 43 // |supported_formats| will be empty. | 43 // |supported_formats| will be empty. |
| 44 virtual void GetSupportedFormats( | 44 virtual void GetSupportedFormats( |
| 45 const VideoCaptureDeviceDescriptor& device_descriptor, | 45 const VideoCaptureDeviceDescriptor& device_descriptor, |
| 46 VideoCaptureFormats* supported_formats) = 0; | 46 VideoCaptureFormats* supported_formats) = 0; |
| 47 | 47 |
| 48 protected: | |
| 49 // Gets descriptors of all video capture devices connected. | 48 // Gets descriptors of all video capture devices connected. |
| 50 // Used by the default implementation of EnumerateDevices(). | 49 // Used by the default implementation of EnumerateDevices(). |
| 51 // Note: The same physical device may appear more than once if it is | 50 // Note: The same physical device may appear more than once if it is |
| 52 // accessible through different APIs. | 51 // accessible through different APIs. |
| 53 virtual void GetDeviceDescriptors( | 52 virtual void GetDeviceDescriptors( |
| 54 VideoCaptureDeviceDescriptors* device_descriptors) = 0; | 53 VideoCaptureDeviceDescriptors* device_descriptors) = 0; |
| 55 | 54 |
| 55 protected: |
| 56 base::ThreadChecker thread_checker_; | 56 base::ThreadChecker thread_checker_; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( | 59 static VideoCaptureDeviceFactory* CreateVideoCaptureDeviceFactory( |
| 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); | 62 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactory); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace media | 65 } // namespace media |
| 66 | 66 |
| 67 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ | 67 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_ |
| OLD | NEW |