Pepper_47_C_interfaces
ppb_camera_device_private.h
Go to the documentation of this file.
1 /* Copyright 2014 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 private/ppb_camera_device_private.idl,
7  * modified Thu Oct 20 13:57:04 2016.
8  */
9 
10 #ifndef PPAPI_C_PRIVATE_PPB_CAMERA_DEVICE_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_CAMERA_DEVICE_PRIVATE_H_
12 
13 #include "ppapi/c/pp_bool.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
20 
21 #define PPB_CAMERADEVICE_PRIVATE_INTERFACE_0_1 "PPB_CameraDevice_Private;0.1"
22 #define PPB_CAMERADEVICE_PRIVATE_INTERFACE \
23  PPB_CAMERADEVICE_PRIVATE_INTERFACE_0_1
24 
25 /**
26  * @file
27  * Defines the <code>PPB_CameraDevice_Private</code> interface. Used for
28  * manipulating a camera device.
29  */
30 
31 
32 /**
33  * @addtogroup Interfaces
34  * @{
35  */
36 /**
37  * To query camera capabilities:
38  * 1. Get a PPB_CameraDevice_Private object by Create().
39  * 2. Open() camera device with track id of MediaStream video track.
40  * 3. Call GetCameraCapabilities() to get a
41  * <code>PPB_CameraCapabilities_Private</code> object, which can be used to
42  * query camera capabilities.
43  */
45  /**
46  * Creates a PPB_CameraDevice_Private resource.
47  *
48  * @param[in] instance A <code>PP_Instance</code> identifying one instance
49  * of a module.
50  *
51  * @return A <code>PP_Resource</code> corresponding to a
52  * PPB_CameraDevice_Private resource if successful, 0 if failed.
53  */
55  /**
56  * Determines if a resource is a camera device resource.
57  *
58  * @param[in] resource The <code>PP_Resource</code> to test.
59  *
60  * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
61  * resource is a camera device resource or <code>PP_FALSE</code>
62  * otherwise.
63  */
65  /**
66  * Opens a camera device.
67  *
68  * @param[in] camera_device A <code>PP_Resource</code> corresponding to a
69  * camera device resource.
70  * @param[in] device_id A <code>PP_Var</code> identifying a camera device. The
71  * type is string. The ID can be obtained from MediaStreamTrack.getSources()
72  * or MediaStreamVideoTrack.id.
73  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
74  * completion of <code>Open()</code>.
75  *
76  * @return An error code from <code>pp_errors.h</code>.
77  */
78  int32_t (*Open)(PP_Resource camera_device,
79  struct PP_Var device_id,
80  struct PP_CompletionCallback callback);
81  /**
82  * Disconnects from the camera and cancels all pending requests.
83  * After this returns, no callbacks will be called. If <code>
84  * PPB_CameraDevice_Private</code> is destroyed and is not closed yet, this
85  * function will be automatically called. Calling this more than once has no
86  * effect.
87  *
88  * @param[in] camera_device A <code>PP_Resource</code> corresponding to a
89  * camera device resource.
90  */
91  void (*Close)(PP_Resource camera_device);
92  /**
93  * Gets the camera capabilities.
94  *
95  * The camera capabilities do not change for a given camera source.
96  *
97  * @param[in] camera_device A <code>PP_Resource</code> corresponding to a
98  * camera device resource.
99  * @param[out] capabilities A <code>PPB_CameraCapabilities_Private</code> for
100  * storing the camera capabilities on success. Otherwise, the value will not
101  * be changed.
102  * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
103  * completion of <code>GetCameraCapabilities()</code>.
104  *
105  * @return An int32_t containing a result code from <code>pp_errors.h</code>.
106  */
107  int32_t (*GetCameraCapabilities)(PP_Resource camera_device,
108  PP_Resource* capabilities,
109  struct PP_CompletionCallback callback);
110 };
111 
113 /**
114  * @}
115  */
116 
117 #endif /* PPAPI_C_PRIVATE_PPB_CAMERA_DEVICE_PRIVATE_H_ */
118 
void(* Close)(PP_Resource camera_device)
int32_t PP_Resource
Definition: pp_resource.h:40
PP_Resource(* Create)(PP_Instance instance)
int32_t(* GetCameraCapabilities)(PP_Resource camera_device, PP_Resource *capabilities, struct PP_CompletionCallback callback)
int32_t(* Open)(PP_Resource camera_device, struct PP_Var device_id, struct PP_CompletionCallback callback)
Definition: pp_var.h:166
PP_Bool(* IsCameraDevice)(PP_Resource resource)
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30