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

Unified Diff: media/capture/video/video_capture_device_factory.h

Issue 2169013002: Change class VideoCaptureDevice::Name to struct VideoCaptureDeviceDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring of VideoCaptureDeviceFactory interface Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/video/video_capture_device_factory.h
diff --git a/media/capture/video/video_capture_device_factory.h b/media/capture/video/video_capture_device_factory.h
index de16133078b4076e50cba4125c98be7aaebf33ab..a7b05507681fe75ad4e00018311f522754fda5a7 100644
--- a/media/capture/video/video_capture_device_factory.h
+++ b/media/capture/video/video_capture_device_factory.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "media/capture/video/video_capture_device.h"
+#include "media/capture/video/video_capture_device_info.h"
namespace media {
@@ -25,25 +26,29 @@ class CAPTURE_EXPORT VideoCaptureDeviceFactory {
// Creates a VideoCaptureDevice object. Returns NULL if something goes wrong.
virtual std::unique_ptr<VideoCaptureDevice> Create(
- const VideoCaptureDevice::Name& device_name) = 0;
+ const VideoCaptureDeviceDescriptor& device_descriptor) = 0;
- // Asynchronous version of GetDeviceNames calling back to |callback|.
- virtual void EnumerateDeviceNames(
+ // Asynchronous version of GetDeviceDescriptors calling back to |callback|.
+ virtual void EnumerateDeviceDescriptors(
const base::Callback<
- void(std::unique_ptr<media::VideoCaptureDevice::Names>)>& callback);
+ void(std::unique_ptr<VideoCaptureDeviceDescriptors>)>& callback);
- // Gets the supported formats of a particular device attached to the system.
+ // Obtains extended information about a device. This includes the supported
+ // formats.
// This method should be called before allocating or starting a device. In
// case format enumeration is not supported, or there was a problem, the
// formats array will be empty.
emircan 2016/07/25 22:56:40 Please update the comment.
chfremer 2016/07/26 16:56:35 Done.
- virtual void GetDeviceSupportedFormats(
- const VideoCaptureDevice::Name& device,
- VideoCaptureFormats* supported_formats) = 0;
+ virtual void GetDeviceInfo(
+ const VideoCaptureDeviceDescriptor& device_descriptor,
+ VideoCaptureDeviceInfo* device_info) = 0;
emircan 2016/07/25 22:56:40 VideoCaptureDeviceInfo* const device_info
chfremer 2016/07/26 16:56:35 Discussed offline. I don't see much value in maki
protected:
- // Gets the names of all video capture devices connected to this computer.
- // Used by the default implementation of EnumerateDeviceNames().
- virtual void GetDeviceNames(VideoCaptureDevice::Names* device_names) = 0;
+ // Gets descriptors of all video capture devices connected to this computer.
+ // Used by the default implementation of EnumerateDevices().
+ // Note: The same physical device may appear more than once if it is
+ // accessible through different APIs.
+ virtual void GetDeviceDescriptors(
+ VideoCaptureDeviceDescriptors* device_descriptors) = 0;
emircan 2016/07/25 22:56:40 VideoCaptureDeviceDescriptors* const device_descri
chfremer 2016/07/26 16:56:35 Acknowledged.
base::ThreadChecker thread_checker_;

Powered by Google App Engine
This is Rietveld 408576698