| 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 Thu Feb 5 22:47:43 2015. | 7 * modified Fri Feb 6 15:40:49 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 22 matching lines...) Expand all Loading... |
| 40 * 3. Call GetCameraCapabilities() to get a | 40 * 3. Call GetCameraCapabilities() to get a |
| 41 * <code>PPB_CameraCapabilities_Private</code> object, which can be used to | 41 * <code>PPB_CameraCapabilities_Private</code> object, which can be used to |
| 42 * query camera capabilities. | 42 * query camera capabilities. |
| 43 */ | 43 */ |
| 44 struct PPB_ImageCapture_Private_0_1 { | 44 struct PPB_ImageCapture_Private_0_1 { |
| 45 /** | 45 /** |
| 46 * Creates a PPB_ImageCapture_Private resource. | 46 * Creates a PPB_ImageCapture_Private resource. |
| 47 * | 47 * |
| 48 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 48 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 49 * of a module. | 49 * of a module. |
| 50 * @param[in] camera_source_id A <code>PP_Var</code> identifying a camera | |
| 51 * source. The type is string. The ID can be obtained from | |
| 52 * MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. If a | |
| 53 * MediaStreamVideoTrack is associated with the same source and the track | |
| 54 * is closed, this PPB_ImageCapture_Private object can still do image capture. | |
| 55 * @param[in] error_callback A <code>PPB_ImageCapture_Private_ErrorCallback | |
| 56 * </code> callback to indicate the image capture has failed. | |
| 57 * @param[inout] user_data An opaque pointer that will be passed to the | |
| 58 * callbacks of PPB_ImageCapture_Private. | |
| 59 * | 50 * |
| 60 * @return A <code>PP_Resource</code> corresponding to a | 51 * @return A <code>PP_Resource</code> corresponding to a |
| 61 * PPB_ImageCapture_Private resource if successful, 0 if failed. | 52 * PPB_ImageCapture_Private resource if successful, 0 if failed. |
| 62 */ | 53 */ |
| 63 PP_Resource (*Create)(PP_Instance instance, | 54 PP_Resource (*Create)(PP_Instance instance); |
| 64 struct PP_Var camera_source_id, | |
| 65 void* user_data); | |
| 66 /** | 55 /** |
| 67 * Determines if a resource is an image capture resource. | 56 * Determines if a resource is an image capture resource. |
| 68 * | 57 * |
| 69 * @param[in] resource The <code>PP_Resource</code> to test. | 58 * @param[in] resource The <code>PP_Resource</code> to test. |
| 70 * | 59 * |
| 71 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | 60 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| 72 * resource is an image capture resource or <code>PP_FALSE</code> | 61 * resource is an image capture resource or <code>PP_FALSE</code> |
| 73 * otherwise. | 62 * otherwise. |
| 74 */ | 63 */ |
| 75 PP_Bool (*IsImageCapture)(PP_Resource resource); | 64 PP_Bool (*IsImageCapture)(PP_Resource resource); |
| 76 /** | 65 /** |
| 66 * Opens a video capture device. |
| 67 * |
| 68 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 69 * image capture 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 image_capture, |
| 79 struct PP_Var device_id, |
| 80 struct PP_CompletionCallback callback); |
| 81 /** |
| 77 * Disconnects from the camera and cancels all pending capture requests. | 82 * Disconnects from the camera and cancels all pending capture requests. |
| 78 * After this returns, no callbacks will be called. If <code> | 83 * After this returns, no callbacks will be called. If <code> |
| 79 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this | 84 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this |
| 80 * function will be automatically called. Calling this more than once has no | 85 * function will be automatically called. Calling this more than once has no |
| 81 * effect. | 86 * effect. |
| 82 * | 87 * |
| 83 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | 88 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 84 * image capture resource. | 89 * image capture resource. |
| 85 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
| 86 * completion of <code>Close()</code>. | |
| 87 * | |
| 88 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 89 */ | 90 */ |
| 90 int32_t (*Close)(PP_Resource resource, struct PP_CompletionCallback callback); | 91 void (*Close)(PP_Resource image_capture); |
| 91 /** | 92 /** |
| 92 * Gets the camera capabilities. | 93 * Gets the camera capabilities. |
| 93 * | 94 * |
| 94 * The camera capabilities do not change for a given camera source. | 95 * The camera capabilities do not change for a given camera source. |
| 95 * | 96 * |
| 96 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | 97 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an |
| 97 * image capture resource. | 98 * image capture resource. |
| 98 * @param[out] capabilities A <code>PPB_CameraCapabilities_Private</code> for | 99 * @param[out] capabilities A <code>PPB_CameraCapabilities_Private</code> for |
| 99 * storing the image capture capabilities on success. Otherwise, the value | 100 * storing the image capture capabilities on success. Otherwise, the value |
| 100 * will not be changed. | 101 * will not be changed. |
| 101 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | 102 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon |
| 102 * completion of <code>GetCameraCapabilities()</code>. | 103 * completion of <code>GetCameraCapabilities()</code>. |
| 103 * | 104 * |
| 104 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | 105 * @return An int32_t containing a result code from <code>pp_errors.h</code>. |
| 105 */ | 106 */ |
| 106 int32_t (*GetCameraCapabilities)(PP_Resource image_capture, | 107 int32_t (*GetCameraCapabilities)(PP_Resource image_capture, |
| 107 PP_Resource* capabilities, | 108 PP_Resource* capabilities, |
| 108 struct PP_CompletionCallback callback); | 109 struct PP_CompletionCallback callback); |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 typedef struct PPB_ImageCapture_Private_0_1 PPB_ImageCapture_Private; | 112 typedef struct PPB_ImageCapture_Private_0_1 PPB_ImageCapture_Private; |
| 112 /** | 113 /** |
| 113 * @} | 114 * @} |
| 114 */ | 115 */ |
| 115 | 116 |
| 116 #endif /* PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ */ | 117 #endif /* PPAPI_C_PRIVATE_PPB_IMAGE_CAPTURE_PRIVATE_H_ */ |
| 117 | 118 |
| OLD | NEW |