| OLD | NEW |
| 1 /* Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 /* From private/ppb_image_capture_private.idl, | 6 /* From private/ppb_image_capture_private.idl, |
| 7 * modified Wed Aug 13 17:26:13 2014. | 7 * modified Mon Feb 2 21:41:55 2015. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ | 10 #ifndef PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ | 11 #define PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ |
| 12 | 12 |
| 13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_completion_callback.h" | 14 #include "ppapi/c/pp_completion_callback.h" |
| 15 #include "ppapi/c/pp_instance.h" | 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/c/pp_macros.h" | 16 #include "ppapi/c/pp_macros.h" |
| 17 #include "ppapi/c/pp_resource.h" | 17 #include "ppapi/c/pp_resource.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 * 5. Call CaptureStillImage to capture a still image. Play the shutter sound in | 117 * 5. Call CaptureStillImage to capture a still image. Play the shutter sound in |
| 118 * the shutter callback. The image from the preview callback can be used for | 118 * the shutter callback. The image from the preview callback can be used for |
| 119 * display. JPEG image will be returned to the JPEG callback. | 119 * display. JPEG image will be returned to the JPEG callback. |
| 120 */ | 120 */ |
| 121 struct PPB_ImageCapture_Private_0_1 { | 121 struct PPB_ImageCapture_Private_0_1 { |
| 122 /** | 122 /** |
| 123 * Creates a PPB_ImageCapture_Private resource. | 123 * Creates a PPB_ImageCapture_Private resource. |
| 124 * | 124 * |
| 125 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 125 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 126 * of a module. | 126 * of a module. |
| 127 * @param[in] camera_source_id A <code>PP_Var</code> identifying a camera | |
| 128 * source. The type is string. The ID can be obtained from | |
| 129 * MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. If a | |
| 130 * MediaStreamVideoTrack is associated with the same source and the track | |
| 131 * is closed, this PPB_ImageCapture_Private object can still do image capture. | |
| 132 * @param[in] error_callback A <code>PPB_ImageCapture_Private_ErrorCallback | |
| 133 * </code> callback to indicate the image capture has failed. | |
| 134 * @param[inout] user_data An opaque pointer that will be passed to the | |
| 135 * callbacks of PPB_ImageCapture_Private. | |
| 136 * | 127 * |
| 137 * @return A <code>PP_Resource</code> corresponding to a | 128 * @return A <code>PP_Resource</code> corresponding to a |
| 138 * PPB_ImageCapture_Private resource if successful, 0 if failed. | 129 * PPB_ImageCapture_Private resource if successful, 0 if failed. |
| 139 */ | 130 */ |
| 140 PP_Resource (*Create)(PP_Instance instance, | 131 PP_Resource (*Create)(PP_Instance instance); |
| 141 struct PP_Var camera_source_id, | |
| 142 PPB_ImageCapture_Private_ErrorCallback error_callback, | |
| 143 void* user_data); | |
| 144 /** | 132 /** |
| 145 * Determines if a resource is an image capture resource. | 133 * Determines if a resource is an image capture resource. |
| 146 * | 134 * |
| 147 * @param[in] resource The <code>PP_Resource</code> to test. | 135 * @param[in] resource The <code>PP_Resource</code> to test. |
| 148 * | 136 * |
| 149 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | 137 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| 150 * resource is an image capture resource or <code>PP_FALSE</code> | 138 * resource is an image capture resource or <code>PP_FALSE</code> |
| 151 * otherwise. | 139 * otherwise. |
| 152 */ | 140 */ |
| 153 PP_Bool (*IsImageCapture)(PP_Resource resource); | 141 PP_Bool (*IsImageCapture)(PP_Resource resource); |
| 154 /** | 142 /** |
| 143 * Opens a video capture device. |
| 144 * |
| 145 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 146 * image capture resource. |
| 147 * @param[in] device_id A <code>PP_Var</code> identifying a camera device. The |
| 148 * type is string. The ID can be obtained from MediaStreamTrack.getSources() |
| 149 * or MediaStreamVideoTrack.id. If a MediaStreamVideoTrack is associated with |
| 150 * the same source and the track is closed, this PPB_ImageCapture_Private |
| 151 * object can still do image capture. |
| 152 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 153 * completion of <code>Open()</code>. |
| 154 * |
| 155 * @return An error code from <code>pp_errors.h</code>. |
| 156 */ |
| 157 int32_t (*Open)(PP_Resource image_capture, |
| 158 struct PP_Var device_id, |
| 159 struct PP_CompletionCallback callback); |
| 160 /** |
| 155 * Disconnects from the camera and cancels all pending capture requests. | 161 * Disconnects from the camera and cancels all pending capture requests. |
| 156 * After this returns, no callbacks will be called. If <code> | 162 * After this returns, no callbacks will be called. If <code> |
| 157 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this | 163 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this |
| 158 * function will be automatically called. Calling this more than once has no | 164 * function will be automatically called. Calling this more than once has no |
| 159 * effect. | 165 * effect. |
| 160 * | 166 * |
| 161 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | 167 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 162 * image capture resource. | 168 * image capture resource. |
| 163 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
| 164 * completion of <code>Close()</code>. | |
| 165 * | |
| 166 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 167 */ | 169 */ |
| 168 int32_t (*Close)(PP_Resource resource, struct PP_CompletionCallback callback); | 170 void (*Close)(PP_Resource image_capture); |
| 169 /** | 171 /** |
| 170 * Sets the configuration of the image capture. | 172 * Sets the configuration of the image capture. |
| 171 * If <code>SetConfig()</code> is not called, default settings will be used. | 173 * If <code>SetConfig()</code> is not called, default settings will be used. |
| 172 * | 174 * |
| 173 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | 175 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 174 * image capture resource. | 176 * image capture resource. |
| 175 * @param[in] config A <code>PP_ImageCaptureConfig_Private</code> object. | 177 * @param[in] config A <code>PP_ImageCaptureConfig_Private</code> object. |
| 176 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | 178 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon |
| 177 * completion of <code>SetConfig()</code>. | 179 * completion of <code>SetConfig()</code>. |
| 178 * | 180 * |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 int64_t* sequence_id); | 275 int64_t* sequence_id); |
| 274 }; | 276 }; |
| 275 | 277 |
| 276 typedef struct PPB_ImageCapture_Private_0_1 PPB_ImageCapture_Private; | 278 typedef struct PPB_ImageCapture_Private_0_1 PPB_ImageCapture_Private; |
| 277 /** | 279 /** |
| 278 * @} | 280 * @} |
| 279 */ | 281 */ |
| 280 | 282 |
| 281 #endif /* PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ */ | 283 #endif /* PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ */ |
| 282 | 284 |
| OLD | NEW |