1 /* Copyright (c) 2012 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.
7 * This file defines the <code>PPB_DeviceRef_Dev</code> interface.
17 * Defines the callback type to receive device change notifications for
18 * <code>PPB_AudioInput_Dev.MonitorDeviceChange()</code> and
19 * <code>PPB_VideoCapture_Dev.MonitorDeviceChange()</code>.
21 * @param[inout] user_data The opaque pointer that the caller passed into
22 * <code>MonitorDeviceChange()</code>.
23 * @param[in] device_count How many devices in the array.
24 * @param[in] devices An array of <code>PPB_DeviceRef_Dev</code>. Please note
25 * that the ref count of the elements is not increased on behalf of the plugin.
27 typedef void PP_MonitorDeviceChangeCallback
(
28 [inout
] mem_t user_data
,
29 [in] uint32_t device_count
,
30 [in, size_is(device_count
)] PP_Resource
[] devices
);
36 enum PP_DeviceType_Dev
{
37 PP_DEVICETYPE_DEV_INVALID
= 0,
38 PP_DEVICETYPE_DEV_AUDIOCAPTURE
= 1,
39 PP_DEVICETYPE_DEV_VIDEOCAPTURE
= 2
42 interface PPB_DeviceRef_Dev
{
44 * Determines if the provided resource is a device reference.
46 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic
49 * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given
50 * resource is a device reference, otherwise <code>PP_FALSE</code>.
52 PP_Bool IsDeviceRef
([in] PP_Resource resource
);
55 * Gets the device type.
57 * @param[in] device_ref A <code>PP_Resource</code> corresponding to a device
60 * @return A <code>PP_DeviceType_Dev</code> value.
62 [on_failure
=PP_DEVICETYPE_DEV_INVALID
]
63 PP_DeviceType_Dev GetType
([in] PP_Resource device_ref
);
66 * Gets the device name.
68 * @param[in] device_ref A <code>PP_Resource</code> corresponding to a device
71 * @return A <code>PP_Var</code> of type <code>PP_VARTYPE_STRING</code>
72 * containing the name of the device if successful; a <code>PP_Var</code> of
73 * type <code>PP_VARTYPE_UNDEFINED</code> if failed.
75 PP_Var GetName
([in] PP_Resource device_ref
);