Chromium Code Reviews| 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_StreamDeviceEnumerator_Dev</code> interface. | |
|
viettrungluu
2011/12/17 01:37:03
Ditto -- nothing stream-specific.
yzshen1
2011/12/19 19:11:55
Done.
| |
| 8 */ | |
| 9 label Chrome { | |
| 10 M18 = 0.1 | |
| 11 }; | |
| 12 | |
| 13 interface PPB_StreamDeviceEnumerator_Dev { | |
| 14 /** | |
| 15 * This function creates a stream 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 stream 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 stream device enumerator resource, otherwise | |
| 33 * <code>PP_FALSE</code>. | |
| 34 */ | |
| 35 PP_Bool IsStreamDeviceEnumerator([in] PP_Resource resource); | |
| 36 | |
| 37 /** | |
| 38 * Enumerates devices of the speicified stream type. | |
| 39 * | |
| 40 * @param[in] enumerator The stream device enumerator resource. | |
| 41 * @param[in] stream_type A <code>PP_StreamType_Dev</code> value describing | |
| 42 * what kind of devices is queried. | |
| 43 * @param[in] callback A <code>CompletionCallback</code> to be called when | |
| 44 * the operation is finished. | |
| 45 */ | |
| 46 int32_t Enumerate( | |
| 47 [in] PP_Resource enumerator, | |
| 48 [in] PP_StreamType_Dev stream_type, | |
| 49 [in] PP_CompletionCallback callback); | |
| 50 | |
| 51 /** | |
| 52 * Gets the number of devices found. It should be called after | |
| 53 * <code>Enumerate</code> completes successfully. | |
| 54 * | |
| 55 * @return The number of devices. If it is called before | |
| 56 * <code>Enumerate</code> is called or while it is being processed, it returns | |
| 57 * 0. | |
| 58 */ | |
| 59 uint32_t GetDeviceNumber([in] PP_Resource enumerator); | |
|
viettrungluu
2011/12/17 01:37:03
I wonder if this is overkill, and we shouldn't jus
yzshen1
2011/12/19 19:11:55
I think this may be easier for plugins. For exampl
| |
| 60 | |
| 61 /** | |
| 62 * Gets a reference to a device. It should be called after | |
| 63 * <code>Enumerate</code> completes successfully. | |
| 64 * | |
| 65 * @param[in] enumerator The stream device enumerator resource. | |
| 66 * @param[in] index An integer indicating the position in the list of devices | |
| 67 * found. | |
| 68 * | |
| 69 * @return A <code>PP_Resource</code> indentifying the device. | |
| 70 * <code>PPB_AudioInput_Dev</code> and <code>PPB_VideoCapture_Dev</code> can | |
| 71 * use this reference to open the device. Returns 0 if the index is out of | |
| 72 * range. | |
| 73 */ | |
| 74 PP_Resource GetDevice( | |
| 75 [in] PP_Resource enumerator, | |
| 76 [in] uint32_t index); | |
| 77 }; | |
| OLD | NEW |