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

Side by Side Diff: ppapi/api/ppb_image_capture.idl

Issue 391323002: Pepper: add Image Capture interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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</code> interface. Used for taking
8 * a picture from the source of a MediaStream video track.
9 */
10
11 [generate_thunk]
12
13 label Chrome {
14 [channel=dev] M38 = 0.1
15 };
16
17 [version=0.1]
18 interface PPB_ImageCapture {
19 /**
20 * Creates a PPB_ImageCapture resource.
21 *
22 * @param[in] resoutce A <code>PP_Resource</code> identifying one
23 * MediaStream video track.
24 *
25 * @return A <code>PP_Resource</code> corresponding to a
26 * PPB_ImageCapture resource if successful, 0 if failed.
27 */
28 PP_Resource Create([in] PP_Resource media_stream_video_track);
29
30 /**
31 * Determines if a resource is an image capture resource.
32 *
33 * @param[in] resource The <code>PP_Resource</code> to test.
34 *
35 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
36 * resource is an image capture resource or <code>PP_FALSE</code>
37 * otherwise.
38 */
39 PP_Bool IsImageCapture([in] PP_Resource resource);
40
41 /**
42 * Sets the configuration of the photos and the camera device.
Owen Lin 2014/07/16 08:20:45 [optional] "Sets the configuration of the camera d
43 * If <code>SetConfig()</code> is not called, default settings will be used.
44 *
45 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
46 * image capture resource.
47 * @param[in] config A PP_ImageCaptureConfig object.
48 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
49 * completion of <code>SetConfig()</code>.
50 *
51 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
52 * Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of
53 * <code>SetConfig()</code> or <code>TakePhoto()</code>.
Owen Lin 2014/07/16 08:20:44 What's the definition of the pending call to TakeP
54 * If an error is returned, all configuration will not be changed.
55 */
56 int32_t SetConfig([in] PP_Resource image_capture,
57 [in] PP_Resource config,
58 [in] PP_CompletionCallback callback);
59
60 /**
61 * Gets attribute values for given attribute names.
Owen Lin 2014/07/16 08:20:45 Where are the attribute values and attribute names
62 *
63 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
64 * image capture resource.
65 * @param[out] value A PP_ImageCaptureConfig for storing the current image
66 * capture config on success. Otherwise, the value will not be changed.
67 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
68 * completion of <code>GetConfig()</code>.
69 *
70 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
71 */
72 int32_t GetConfig([in] PP_Resource image_capture,
73 [out] PP_Resource config,
74 [in] PP_CompletionCallback callback);
75
76 /**
77 * Gets the capabilities of the capture device.
78 *
79 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
80 * image capture resource.
81 * @param[out] value A PP_CameraCapabilities for storing the camera
82 * capabilities on success. Otherwise, the value will not be changed.
83 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
84 * completion of <code>GetConfig()</code>.
85 *
86 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
87 */
88 int32_t GetCapabilities([in] PP_Resource image_capture,
89 [out] PP_Resource capabilities,
90 [in] PP_CompletionCallback callback);
91
92 /**
93 * Takes a photo from the capture device.
94 *
95 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
96 * image capture resource.
97 * @param[out] postview A <code>PP_Resource</code> corresponding to a
98 * VideoFrame resource used to store the postview.
Owen Lin 2014/07/16 08:20:44 Did you consider to make it a ImageData? Client ca
99 * @param[out] photo A <code>PP_Resource</code> corresponding to a VideoFrame
100 * resource used to store the encoded picture. The default format is JPEG.
101 * @param[in] callback A <code>PP_CompletionCallback</code> to be called when
Owen Lin 2014/07/16 08:20:44 s/callback/shutter_callback/
102 * the picture is taken and the camera can be moved without making the picture
103 * blurry. The client can play a shutter sound if needed.
104 * @param[in] callback A <code>PP_CompletionCallback</code> to be called to
Owen Lin 2014/07/16 08:20:44 s/callback/postview_callback/. Can you move most o
105 * return a postview video frame. The client can use this to show the captured
106 * photo. The format and the size are decided by the MediaStream video track.
107 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
Owen Lin 2014/07/16 08:20:44 photo_callback
108 * completion of TakePhoto(). <code>photo</code> will contain the encoded
109 * picture.
110 *
111 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
112 */
113 int32_t TakePhoto([in] PP_Resource image_capture,
114 [out] PP_Resource postview,
115 [out] PP_Resource photo,
116 [in] PP_CompletionCallback shutter_callback,
117 [in] PP_CompletionCallback postview_callback,
118 [in] PP_CompletionCallback picture_callback);
Owen Lin 2014/07/16 08:20:45 why not using the name "photo_callback".
119 };
120
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698