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_stream_device_enumerator_dev.idl modified Fri Dec 16 16:24:26 20
11. */ |
| 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_STREAM_DEVICE_ENUMERATOR_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_STREAM_DEVICE_ENUMERATOR_DEV_H_ |
| 10 |
| 11 #include "ppapi/c/dev/ppb_stream_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_STREAMDEVICEENUMERATOR_DEV_INTERFACE_0_1 \ |
| 20 "PPB_StreamDeviceEnumerator(Dev);0.1" |
| 21 #define PPB_STREAMDEVICEENUMERATOR_DEV_INTERFACE \ |
| 22 PPB_STREAMDEVICEENUMERATOR_DEV_INTERFACE_0_1 |
| 23 |
| 24 /** |
| 25 * @file |
| 26 * This file defines the <code>PPB_StreamDeviceEnumerator_Dev</code> interface. |
| 27 */ |
| 28 |
| 29 |
| 30 /** |
| 31 * @addtogroup Interfaces |
| 32 * @{ |
| 33 */ |
| 34 struct PPB_StreamDeviceEnumerator_Dev { |
| 35 /** |
| 36 * This function creates a stream device enumerator resource. |
| 37 * |
| 38 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 39 * of a module. |
| 40 * |
| 41 * @return A <code>PP_Resource</code> containing the enumerator if successful |
| 42 * or 0 if it could not be created. |
| 43 */ |
| 44 PP_Resource (*Create)(PP_Instance instance); |
| 45 /** |
| 46 * Determines if the provided resource is a stream device enumerator. |
| 47 * |
| 48 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic |
| 49 * resource. |
| 50 * |
| 51 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given |
| 52 * resource is a stream device enumerator resource, otherwise |
| 53 * <code>PP_FALSE</code>. |
| 54 */ |
| 55 PP_Bool (*IsStreamDeviceEnumerator)(PP_Resource resource); |
| 56 /** |
| 57 * Enumerates devices of the speicified stream type. |
| 58 * |
| 59 * @param[in] enumerator The stream device enumerator resource. |
| 60 * @param[in] stream_type A <code>PP_StreamType_Dev</code> value describing |
| 61 * what kind of devices is queried. |
| 62 * @param[in] callback A <code>CompletionCallback</code> to be called when |
| 63 * the operation is finished. |
| 64 */ |
| 65 int32_t (*Enumerate)(PP_Resource enumerator, |
| 66 PP_StreamType_Dev stream_type, |
| 67 struct PP_CompletionCallback callback); |
| 68 /** |
| 69 * Gets the number of devices found. It should be called after |
| 70 * <code>Enumerate</code> completes successfully. |
| 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 stream 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_STREAM_DEVICE_ENUMERATOR_DEV_H_ */ |
| 97 |
OLD | NEW |