Index: ppapi/c/dev/ppb_stream_device_enumerator_dev.h |
diff --git a/ppapi/c/dev/ppb_stream_device_enumerator_dev.h b/ppapi/c/dev/ppb_stream_device_enumerator_dev.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..01dda2c457f3e9b8b8389d19219f31faca917577 |
--- /dev/null |
+++ b/ppapi/c/dev/ppb_stream_device_enumerator_dev.h |
@@ -0,0 +1,97 @@ |
+/* 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. |
+ */ |
+ |
+/* From dev/ppb_stream_device_enumerator_dev.idl modified Fri Dec 16 16:24:26 2011. */ |
+ |
+#ifndef PPAPI_C_DEV_PPB_STREAM_DEVICE_ENUMERATOR_DEV_H_ |
+#define PPAPI_C_DEV_PPB_STREAM_DEVICE_ENUMERATOR_DEV_H_ |
+ |
+#include "ppapi/c/dev/ppb_stream_device_ref_dev.h" |
+#include "ppapi/c/pp_bool.h" |
+#include "ppapi/c/pp_completion_callback.h" |
+#include "ppapi/c/pp_instance.h" |
+#include "ppapi/c/pp_macros.h" |
+#include "ppapi/c/pp_resource.h" |
+#include "ppapi/c/pp_stdint.h" |
+ |
+#define PPB_STREAMDEVICEENUMERATOR_DEV_INTERFACE_0_1 \ |
+ "PPB_StreamDeviceEnumerator(Dev);0.1" |
+#define PPB_STREAMDEVICEENUMERATOR_DEV_INTERFACE \ |
+ PPB_STREAMDEVICEENUMERATOR_DEV_INTERFACE_0_1 |
+ |
+/** |
+ * @file |
+ * This file defines the <code>PPB_StreamDeviceEnumerator_Dev</code> interface. |
+ */ |
+ |
+ |
+/** |
+ * @addtogroup Interfaces |
+ * @{ |
+ */ |
+struct 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)(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)(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)(PP_Resource enumerator, |
+ PP_StreamType_Dev stream_type, |
+ struct 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)(PP_Resource enumerator); |
+ /** |
+ * 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)(PP_Resource enumerator, uint32_t index); |
+}; |
+/** |
+ * @} |
+ */ |
+ |
+#endif /* PPAPI_C_DEV_PPB_STREAM_DEVICE_ENUMERATOR_DEV_H_ */ |
+ |