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

Unified Diff: ppapi/api/dev/ppb_stream_device_enumerator_dev.idl

Issue 8981009: New Pepper interfaces for audio/video capture device enumeration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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: ppapi/api/dev/ppb_stream_device_enumerator_dev.idl
diff --git a/ppapi/api/dev/ppb_stream_device_enumerator_dev.idl b/ppapi/api/dev/ppb_stream_device_enumerator_dev.idl
new file mode 100755
index 0000000000000000000000000000000000000000..f6369d8e882e931686bcaa4d84cbe1d07ffab7d1
--- /dev/null
+++ b/ppapi/api/dev/ppb_stream_device_enumerator_dev.idl
@@ -0,0 +1,77 @@
+/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * This file defines the <code>PPB_StreamDeviceEnumerator_Dev</code> interface.
viettrungluu 2011/12/17 01:37:03 Ditto -- nothing stream-specific.
yzshen1 2011/12/19 19:11:55 Done.
+ */
+label Chrome {
+ M18 = 0.1
+};
+
+interface PPB_StreamDeviceEnumerator_Dev {
+ /**
+ * This function creates a stream device enumerator resource.
+ *
+ * @param[in] instance A <code>PP_Instance</code> identifying one instance
+ * of a module.
+ *
+ * @return A <code>PP_Resource</code> containing the enumerator if successful
+ * or 0 if it could not be created.
+ */
+ PP_Resource Create([in] PP_Instance instance);
+
+ /**
+ * Determines if the provided resource is a stream device enumerator.
+ *
+ * @param[in] resource A <code>PP_Resource</code> corresponding to a generic
+ * resource.
+ *
+ * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given
+ * resource is a stream device enumerator resource, otherwise
+ * <code>PP_FALSE</code>.
+ */
+ PP_Bool IsStreamDeviceEnumerator([in] PP_Resource resource);
+
+ /**
+ * Enumerates devices of the speicified stream type.
+ *
+ * @param[in] enumerator The stream device enumerator resource.
+ * @param[in] stream_type A <code>PP_StreamType_Dev</code> value describing
+ * what kind of devices is queried.
+ * @param[in] callback A <code>CompletionCallback</code> to be called when
+ * the operation is finished.
+ */
+ int32_t Enumerate(
+ [in] PP_Resource enumerator,
+ [in] PP_StreamType_Dev stream_type,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Gets the number of devices found. It should be called after
+ * <code>Enumerate</code> completes successfully.
+ *
+ * @return The number of devices. If it is called before
+ * <code>Enumerate</code> is called or while it is being processed, it returns
+ * 0.
+ */
+ uint32_t GetDeviceNumber([in] PP_Resource enumerator);
viettrungluu 2011/12/17 01:37:03 I wonder if this is overkill, and we shouldn't jus
yzshen1 2011/12/19 19:11:55 I think this may be easier for plugins. For exampl
+
+ /**
+ * Gets a reference to a device. It should be called after
+ * <code>Enumerate</code> completes successfully.
+ *
+ * @param[in] enumerator The stream device enumerator resource.
+ * @param[in] index An integer indicating the position in the list of devices
+ * found.
+ *
+ * @return A <code>PP_Resource</code> indentifying the device.
+ * <code>PPB_AudioInput_Dev</code> and <code>PPB_VideoCapture_Dev</code> can
+ * use this reference to open the device. Returns 0 if the index is out of
+ * range.
+ */
+ PP_Resource GetDevice(
+ [in] PP_Resource enumerator,
+ [in] uint32_t index);
+};

Powered by Google App Engine
This is Rietveld 408576698