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

Unified Diff: ppapi/c/dev/ppb_device_enumerator_dev.h

Issue 8981009: New Pepper interfaces for audio/video capture device enumeration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes in response to Trung's suggestions. 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
« no previous file with comments | « ppapi/c/dev/ppb_audio_input_dev.h ('k') | ppapi/c/dev/ppb_device_ref_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/dev/ppb_device_enumerator_dev.h
diff --git a/ppapi/c/dev/ppb_device_enumerator_dev.h b/ppapi/c/dev/ppb_device_enumerator_dev.h
new file mode 100644
index 0000000000000000000000000000000000000000..6efeced2aa158303109b4b85e156477cda2395b9
--- /dev/null
+++ b/ppapi/c/dev/ppb_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_device_enumerator_dev.idl modified Mon Dec 19 10:44:17 2011. */
+
+#ifndef PPAPI_C_DEV_PPB_DEVICE_ENUMERATOR_DEV_H_
+#define PPAPI_C_DEV_PPB_DEVICE_ENUMERATOR_DEV_H_
+
+#include "ppapi/c/dev/ppb_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_DEVICEENUMERATOR_DEV_INTERFACE_0_1 "PPB_DeviceEnumerator(Dev);0.1"
+#define PPB_DEVICEENUMERATOR_DEV_INTERFACE \
+ PPB_DEVICEENUMERATOR_DEV_INTERFACE_0_1
+
+/**
+ * @file
+ * This file defines the <code>PPB_DeviceEnumerator_Dev</code> interface.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+struct PPB_DeviceEnumerator_Dev {
+ /**
+ * This function creates a 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 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 device enumerator resource, otherwise <code>PP_FALSE</code>.
+ */
+ PP_Bool (*IsDeviceEnumerator)(PP_Resource resource);
+ /**
+ * Enumerates devices of the speicified type.
+ *
+ * @param[in] enumerator The device enumerator resource.
+ * @param[in] device_type A <code>PP_DeviceType_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_DeviceType_Dev device_type,
+ struct PP_CompletionCallback callback);
+ /**
+ * Gets the number of devices found. It should be called after
+ * <code>Enumerate</code> completes successfully.
+ *
+ * @param[in] enumerator The device enumerator resource.
+ *
+ * @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 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_DEVICE_ENUMERATOR_DEV_H_ */
+
« no previous file with comments | « ppapi/c/dev/ppb_audio_input_dev.h ('k') | ppapi/c/dev/ppb_device_ref_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698