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 /** |
| 7 * This file defines the <code>PPB_DeviceEnumerator_Dev</code> interface. |
| 8 */ |
| 9 label Chrome { |
| 10 M18 = 0.1 |
| 11 }; |
| 12 |
| 13 interface PPB_DeviceEnumerator_Dev { |
| 14 /** |
| 15 * This function creates a device enumerator resource. |
| 16 * |
| 17 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 18 * of a module. |
| 19 * |
| 20 * @return A <code>PP_Resource</code> containing the enumerator if successful |
| 21 * or 0 if it could not be created. |
| 22 */ |
| 23 PP_Resource Create([in] PP_Instance instance); |
| 24 |
| 25 /** |
| 26 * Determines if the provided resource is a device enumerator. |
| 27 * |
| 28 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic |
| 29 * resource. |
| 30 * |
| 31 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given |
| 32 * resource is a device enumerator resource, otherwise <code>PP_FALSE</code>. |
| 33 */ |
| 34 PP_Bool IsDeviceEnumerator([in] PP_Resource resource); |
| 35 |
| 36 /** |
| 37 * Enumerates devices of the speicified type. |
| 38 * |
| 39 * @param[in] enumerator The device enumerator resource. |
| 40 * @param[in] device_type A <code>PP_DeviceType_Dev</code> value describing |
| 41 * what kind of devices is queried. |
| 42 * @param[in] callback A <code>CompletionCallback</code> to be called when |
| 43 * the operation is finished. |
| 44 */ |
| 45 int32_t Enumerate( |
| 46 [in] PP_Resource enumerator, |
| 47 [in] PP_DeviceType_Dev device_type, |
| 48 [in] PP_CompletionCallback callback); |
| 49 |
| 50 /** |
| 51 * Gets the number of devices found. It should be called after |
| 52 * <code>Enumerate</code> completes successfully. |
| 53 * |
| 54 * @param[in] enumerator The device enumerator resource. |
| 55 * |
| 56 * @return The number of devices. If it is called before |
| 57 * <code>Enumerate</code> is called or while it is being processed, it returns |
| 58 * 0. |
| 59 */ |
| 60 uint32_t GetDeviceNumber([in] PP_Resource enumerator); |
| 61 |
| 62 /** |
| 63 * Gets a reference to a device. It should be called after |
| 64 * <code>Enumerate</code> completes successfully. |
| 65 * |
| 66 * @param[in] enumerator The device enumerator resource. |
| 67 * @param[in] index An integer indicating the position in the list of devices |
| 68 * found. |
| 69 * |
| 70 * @return A <code>PP_Resource</code> indentifying the device. |
| 71 * <code>PPB_AudioInput_Dev</code> and <code>PPB_VideoCapture_Dev</code> can |
| 72 * use this reference to open the device. Returns 0 if the index is out of |
| 73 * range. |
| 74 */ |
| 75 PP_Resource GetDevice( |
| 76 [in] PP_Resource enumerator, |
| 77 [in] uint32_t index); |
| 78 }; |
OLD | NEW |