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

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: Addressed emircan's comments 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..7cf13f242ff2754119c2d8c00c4239a573d3fe65 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 {
@@ -15,6 +16,10 @@ namespace media {
// devices in the different platforms. VCDFs are created by MediaStreamManager
// on IO thread and plugged into VideoCaptureManager, who owns and operates them
// in Device Thread (a.k.a. Audio Thread).
+// Typical operation is to first call EnumerateDeviceDescriptors() to obtain
+// information about available devices. The obtained descriptors can then be
+// used to either get extended information about a device usng GetDeviceInfo(),
mcasas 2016/07/26 23:52:04 nit: s/usng/using/
chfremer 2016/07/27 23:10:18 Done.
+// or to create an instance of VideoCaptureDevice for the device using Create().
class CAPTURE_EXPORT VideoCaptureDeviceFactory {
public:
static std::unique_ptr<VideoCaptureDeviceFactory> CreateFactory(
@@ -25,25 +30,28 @@ 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.
- // 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.
- virtual void GetDeviceSupportedFormats(
- const VideoCaptureDevice::Name& device,
- VideoCaptureFormats* supported_formats) = 0;
+ // 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
+ // |device_info.supported_formats| will be empty.
+ virtual void GetDeviceInfo(
+ const VideoCaptureDeviceDescriptor& device_descriptor,
+ VideoCaptureDeviceInfo* device_info) = 0;
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.
mcasas 2016/07/26 23:52:04 Heh, maybe remove "to this computer"?
chfremer 2016/07/27 23:10:18 Done.
+ // 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;
base::ThreadChecker thread_checker_;

Powered by Google App Engine
This is Rietveld 408576698