Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 /** | |
| 7 * Defines the <code>PPB_ImageCapture_Private</code> interface. Used for taking | |
| 8 * a picture from a camera source. | |
| 9 */ | |
| 10 | |
| 11 [generate_thunk] | |
| 12 | |
| 13 label Chrome { | |
| 14 M39 = 0.1 | |
| 15 }; | |
| 16 | |
| 17 /** | |
| 18 * See PPP_ImageCapture_Private for the notifications the camera may send the | |
| 19 * plugin. | |
| 20 */ | |
| 21 interface PPB_ImageCapture_Private { | |
| 22 /** | |
| 23 * Creates a PPB_ImageCapture_Private resource. | |
| 24 * | |
| 25 * @param[in] camera_source_id A <code>PP_Var</code> identifying a camera | |
| 26 * source. The type is string. The ID can be obtained from | |
| 27 * MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. If a | |
| 28 * MediaStreamVideoTrack is associated with the same source and the track | |
| 29 * is closed, it will not affect this PPB_ImageCapture_Private object. | |
|
Pawel Osciak
2014/08/03 08:34:38
What does it mean it will not affect? If we close
wuchengli
2014/08/06 08:14:58
Yes. I updated the comments.
| |
| 30 * | |
| 31 * @return A <code>PP_Resource</code> corresponding to a | |
| 32 * PPB_ImageCapture_Private resource if successful, 0 if failed. | |
|
Justin Chuang
2014/08/03 09:45:45
Seems all other PPAPI has a [in] PP_Instance insta
Justin Chuang
2014/08/03 10:46:45
Can see PPB_AudioConfig as an example. Its CreateX
wuchengli
2014/08/06 08:14:58
You are right. Added PP_Instance.
| |
| 33 */ | |
| 34 PP_Resource Create([in] PP_Var camera_source_id); | |
| 35 | |
| 36 /** | |
| 37 * Determines if a resource is an image capture resource. | |
| 38 * | |
| 39 * @param[in] resource The <code>PP_Resource</code> to test. | |
| 40 * | |
| 41 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | |
| 42 * resource is an image capture resource or <code>PP_FALSE</code> | |
| 43 * otherwise. | |
| 44 */ | |
| 45 PP_Bool IsImageCapture([in] PP_Resource resource); | |
| 46 | |
| 47 /** | |
| 48 * Sets the configuration of the image capture. | |
| 49 * If <code>SetConfig()</code> is not called, default settings will be used. | |
| 50 * | |
| 51 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
| 52 * image capture resource. | |
| 53 * @param[in] config A <code>PP_ImageCaptureConfig</code> object. | |
| 54 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
| 55 * completion of <code>SetConfig()</code>. | |
| 56 * | |
| 57 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 58 * Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of | |
| 59 * <code>SetConfig()</code> or <code>TakePhoto()</code>. | |
| 60 * If an error is returned, all configuration will not be changed. | |
| 61 */ | |
| 62 int32_t SetConfig([in] PP_Resource image_capture, | |
| 63 [in] PP_Resource config, | |
| 64 [in] PP_CompletionCallback callback); | |
| 65 | |
| 66 /** | |
| 67 * Gets the configuration of the image capture. | |
| 68 * | |
| 69 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
| 70 * image capture resource. | |
| 71 * @param[out] config A <code>PP_ImageCaptureConfig</code> for storing the | |
| 72 * current image capture config on success. Otherwise, the values will not be | |
| 73 * changed. | |
| 74 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
| 75 * completion of <code>GetConfig()</code>. | |
| 76 * | |
| 77 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 78 */ | |
| 79 int32_t GetConfig([in] PP_Resource image_capture, | |
| 80 [out] PP_Resource config, | |
| 81 [in] PP_CompletionCallback callback); | |
| 82 | |
| 83 /** | |
| 84 * Gets the image capture capabilities of the camera. | |
| 85 * | |
| 86 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
| 87 * image capture resource. | |
| 88 * @param[out] capabilities A <code>PPB_CameraCapabilities</code> for | |
| 89 * storing the image capture capabilities on success. Otherwise, the value | |
| 90 * will not be changed. | |
| 91 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
| 92 * completion of <code>GetCapabilities()</code>. | |
| 93 * | |
| 94 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 95 */ | |
| 96 int32_t GetCapabilities([in] PP_Resource image_capture, | |
| 97 [out] PP_Resource capabilities, | |
| 98 [in] PP_CompletionCallback callback); | |
| 99 | |
| 100 /** | |
| 101 * Takes a Jpeg photo from the camera. | |
| 102 * | |
| 103 * Triggers an asynchronous image capture. The camera will initiate a series | |
| 104 * of callbacks to the application as the image capture progresses. The | |
| 105 * callbacks in order are PPP_ImageCapture_Private.OnShutter, | |
| 106 * OnPostviewPicture, and OnJpegPictureReady. The shutter callback occurs | |
| 107 * after the image is captured. This can be used to trigger a sound to let | |
| 108 * the user know that image has been captured. The postview callback occurs | |
| 109 * when a scaled, fully processed postview image is available. The jpeg | |
| 110 * callback occurs when the compressed image is available. | |
| 111 * | |
| 112 * The camera may need to stop and re-start the streaming during image | |
| 113 * capture. If some MediaStreamVideoTrack are associated with the camera | |
| 114 * source, they will receive mute and unmute events. | |
| 115 * | |
| 116 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
| 117 * image capture resource. | |
| 118 * @param[inout] sequence_id The sequence ID is a unique monotonically | |
| 119 * increasing value starting from 0, incremented every time a new request like | |
| 120 * image capture or autofocus is submitted. | |
|
Pawel Osciak
2014/08/03 08:34:38
Why is it inout? Can implementation change it? If
wuchengli
2014/08/06 08:14:58
Fixed. This should be out.
| |
| 121 * | |
| 122 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
| 123 * PP_OK means the callbacks will be triggered. Other values mean the | |
| 124 * callbacks will not be triggered. | |
| 125 */ | |
| 126 int32_t TakePhoto([in] PP_Resource image_capture, | |
| 127 [inout] int64_t sequence_id); | |
|
Justin Chuang
2014/08/03 11:12:47
Need a Close() method here.
| |
| 128 }; | |
| OLD | NEW |