OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From dev/ppb_device_enumerator_dev.idl modified Mon Dec 19 10:44:17 2011. */ |
| 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_DEVICE_ENUMERATOR_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_DEVICE_ENUMERATOR_DEV_H_ |
| 10 |
| 11 #include "ppapi/c/dev/ppb_device_ref_dev.h" |
| 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_completion_callback.h" |
| 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_macros.h" |
| 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_stdint.h" |
| 18 |
| 19 #define PPB_DEVICEENUMERATOR_DEV_INTERFACE_0_1 "PPB_DeviceEnumerator(Dev);0.1" |
| 20 #define PPB_DEVICEENUMERATOR_DEV_INTERFACE \ |
| 21 PPB_DEVICEENUMERATOR_DEV_INTERFACE_0_1 |
| 22 |
| 23 /** |
| 24 * @file |
| 25 * This file defines the <code>PPB_DeviceEnumerator_Dev</code> interface. |
| 26 */ |
| 27 |
| 28 |
| 29 /** |
| 30 * @addtogroup Interfaces |
| 31 * @{ |
| 32 */ |
| 33 struct PPB_DeviceEnumerator_Dev { |
| 34 /** |
| 35 * This function creates a device enumerator resource. |
| 36 * |
| 37 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 38 * of a module. |
| 39 * |
| 40 * @return A <code>PP_Resource</code> containing the enumerator if successful |
| 41 * or 0 if it could not be created. |
| 42 */ |
| 43 PP_Resource (*Create)(PP_Instance instance); |
| 44 /** |
| 45 * Determines if the provided resource is a device enumerator. |
| 46 * |
| 47 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic |
| 48 * resource. |
| 49 * |
| 50 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given |
| 51 * resource is a device enumerator resource, otherwise <code>PP_FALSE</code>. |
| 52 */ |
| 53 PP_Bool (*IsDeviceEnumerator)(PP_Resource resource); |
| 54 /** |
| 55 * Enumerates devices of the speicified type. |
| 56 * |
| 57 * @param[in] enumerator The device enumerator resource. |
| 58 * @param[in] device_type A <code>PP_DeviceType_Dev</code> value describing |
| 59 * what kind of devices is queried. |
| 60 * @param[in] callback A <code>CompletionCallback</code> to be called when |
| 61 * the operation is finished. |
| 62 */ |
| 63 int32_t (*Enumerate)(PP_Resource enumerator, |
| 64 PP_DeviceType_Dev device_type, |
| 65 struct PP_CompletionCallback callback); |
| 66 /** |
| 67 * Gets the number of devices found. It should be called after |
| 68 * <code>Enumerate</code> completes successfully. |
| 69 * |
| 70 * @param[in] enumerator The device enumerator resource. |
| 71 * |
| 72 * @return The number of devices. If it is called before |
| 73 * <code>Enumerate</code> is called or while it is being processed, it returns |
| 74 * 0. |
| 75 */ |
| 76 uint32_t (*GetDeviceNumber)(PP_Resource enumerator); |
| 77 /** |
| 78 * Gets a reference to a device. It should be called after |
| 79 * <code>Enumerate</code> completes successfully. |
| 80 * |
| 81 * @param[in] enumerator The device enumerator resource. |
| 82 * @param[in] index An integer indicating the position in the list of devices |
| 83 * found. |
| 84 * |
| 85 * @return A <code>PP_Resource</code> indentifying the device. |
| 86 * <code>PPB_AudioInput_Dev</code> and <code>PPB_VideoCapture_Dev</code> can |
| 87 * use this reference to open the device. Returns 0 if the index is out of |
| 88 * range. |
| 89 */ |
| 90 PP_Resource (*GetDevice)(PP_Resource enumerator, uint32_t index); |
| 91 }; |
| 92 /** |
| 93 * @} |
| 94 */ |
| 95 |
| 96 #endif /* PPAPI_C_DEV_PPB_DEVICE_ENUMERATOR_DEV_H_ */ |
| 97 |
OLD | NEW |