Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: ppapi/api/private/ppb_image_capture_private.idl

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address WuCheng's comments in Patch Set 9/10 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** 6 /**
7 * Defines the <code>PPB_ImageCapture_Private</code> interface. Used for 7 * Defines the <code>PPB_ImageCapture_Private</code> interface. Used for
8 * acquiring a single still image from a camera source. 8 * acquiring a single still image from a camera source.
9 */ 9 */
10 10
11 [generate_thunk] 11 [generate_thunk]
12 12
13 label Chrome { 13 label Chrome {
14 M39 = 0.1 14 M42 = 0.1
dmichael (off chromium) 2015/02/03 19:21:29 Maybe best to just leave this file alone if we're
dmichael (off chromium) 2015/02/03 19:33:17 Nevermind
15 }; 15 };
16 16
17 /** 17 /**
18 * Callback function for <code>PPB_ImageCapture_Private.CaptureStillImage 18 * Callback function for <code>PPB_ImageCapture_Private.CaptureStillImage
19 * </code> to indicate the image has been captured from the sensor. This is a 19 * </code> to indicate the image has been captured from the sensor. This is a
20 * good opportunity to play a shutter sound or give other feedback of camera 20 * good opportunity to play a shutter sound or give other feedback of camera
21 * operation. This will occur after the image was captured, but before the 21 * operation. This will occur after the image was captured, but before the
22 * actual data is available. 22 * actual data is available.
23 * 23 *
24 * Parameters: 24 * Parameters:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * 5. Call CaptureStillImage to capture a still image. Play the shutter sound in 95 * 5. Call CaptureStillImage to capture a still image. Play the shutter sound in
96 * the shutter callback. The image from the preview callback can be used for 96 * the shutter callback. The image from the preview callback can be used for
97 * display. JPEG image will be returned to the JPEG callback. 97 * display. JPEG image will be returned to the JPEG callback.
98 */ 98 */
99 interface PPB_ImageCapture_Private { 99 interface PPB_ImageCapture_Private {
100 /** 100 /**
101 * Creates a PPB_ImageCapture_Private resource. 101 * Creates a PPB_ImageCapture_Private resource.
102 * 102 *
103 * @param[in] instance A <code>PP_Instance</code> identifying one instance 103 * @param[in] instance A <code>PP_Instance</code> identifying one instance
104 * of a module. 104 * of a module.
105 * @param[in] camera_source_id A <code>PP_Var</code> identifying a camera
106 * source. The type is string. The ID can be obtained from
107 * MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. If a
108 * MediaStreamVideoTrack is associated with the same source and the track
109 * is closed, this PPB_ImageCapture_Private object can still do image capture.
110 * @param[in] error_callback A <code>PPB_ImageCapture_Private_ErrorCallback
111 * </code> callback to indicate the image capture has failed.
112 * @param[inout] user_data An opaque pointer that will be passed to the
113 * callbacks of PPB_ImageCapture_Private.
114 * 105 *
115 * @return A <code>PP_Resource</code> corresponding to a 106 * @return A <code>PP_Resource</code> corresponding to a
116 * PPB_ImageCapture_Private resource if successful, 0 if failed. 107 * PPB_ImageCapture_Private resource if successful, 0 if failed.
117 */ 108 */
118 PP_Resource Create([in] PP_Instance instance, 109 PP_Resource Create([in] PP_Instance instance);
119 [in] PP_Var camera_source_id,
120 [in] PPB_ImageCapture_Private_ErrorCallback error_callback,
121 [inout] mem_t user_data);
122 110
123 /** 111 /**
124 * Determines if a resource is an image capture resource. 112 * Determines if a resource is an image capture resource.
125 * 113 *
126 * @param[in] resource The <code>PP_Resource</code> to test. 114 * @param[in] resource The <code>PP_Resource</code> to test.
127 * 115 *
128 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given 116 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
129 * resource is an image capture resource or <code>PP_FALSE</code> 117 * resource is an image capture resource or <code>PP_FALSE</code>
130 * otherwise. 118 * otherwise.
131 */ 119 */
132 PP_Bool IsImageCapture([in] PP_Resource resource); 120 PP_Bool IsImageCapture([in] PP_Resource resource);
133 121
134 /** 122 /**
123 * Opens a video capture device.
124 *
125 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
126 * image capture resource.
127 * @param[in] device_id A <code>PP_Var</code> identifying a camera device. The
128 * type is string. The ID can be obtained from MediaStreamTrack.getSources()
129 * or MediaStreamVideoTrack.id. If a MediaStreamVideoTrack is associated with
130 * the same source and the track is closed, this PPB_ImageCapture_Private
131 * object can still do image capture.
132 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
133 * completion of <code>Open()</code>.
134 *
135 * @return An error code from <code>pp_errors.h</code>.
136 */
137 int32_t Open(
138 [in] PP_Resource image_capture,
139 [in] PP_Var device_id,
140 [in] PP_CompletionCallback callback);
141
142 /**
135 * Disconnects from the camera and cancels all pending capture requests. 143 * Disconnects from the camera and cancels all pending capture requests.
136 * After this returns, no callbacks will be called. If <code> 144 * After this returns, no callbacks will be called. If <code>
137 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this 145 * PPB_ImageCapture_Private</code> is destroyed and is not closed yet, this
138 * function will be automatically called. Calling this more than once has no 146 * function will be automatically called. Calling this more than once has no
139 * effect. 147 * effect.
140 * 148 *
141 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an 149 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
142 * image capture resource. 150 * image capture resource.
143 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
144 * completion of <code>Close()</code>.
145 *
146 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
147 */ 151 */
148 int32_t Close([in] PP_Resource resource, 152 void Close([in] PP_Resource image_capture);
149 [in] PP_CompletionCallback callback);
150 153
151 /** 154 /**
152 * Sets the configuration of the image capture. 155 * Sets the configuration of the image capture.
153 * If <code>SetConfig()</code> is not called, default settings will be used. 156 * If <code>SetConfig()</code> is not called, default settings will be used.
154 * 157 *
155 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an 158 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
156 * image capture resource. 159 * image capture resource.
157 * @param[in] config A <code>PP_ImageCaptureConfig_Private</code> object. 160 * @param[in] config A <code>PP_ImageCaptureConfig_Private</code> object.
158 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon 161 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
159 * completion of <code>SetConfig()</code>. 162 * completion of <code>SetConfig()</code>.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 * PP_OK means the callbacks will be triggered. Other values mean the 253 * PP_OK means the callbacks will be triggered. Other values mean the
251 * callbacks will not be triggered. 254 * callbacks will not be triggered.
252 */ 255 */
253 int32_t CaptureStillImage( 256 int32_t CaptureStillImage(
254 [in] PP_Resource image_capture, 257 [in] PP_Resource image_capture,
255 [in] PPB_ImageCapture_Private_ShutterCallback shutter_callback, 258 [in] PPB_ImageCapture_Private_ShutterCallback shutter_callback,
256 [in] PPB_ImageCapture_Private_PreviewCallback preview_callback, 259 [in] PPB_ImageCapture_Private_PreviewCallback preview_callback,
257 [in] PPB_ImageCapture_Private_JpegCallback jpeg_callback, 260 [in] PPB_ImageCapture_Private_JpegCallback jpeg_callback,
258 [out] int64_t sequence_id); 261 [out] int64_t sequence_id);
259 }; 262 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698