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</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] M39 = 0.1 | |
15 }; | |
16 | |
17 [version=0.1] | |
18 interface PPB_ImageCapture { | |
19 /** | |
20 * Creates a PPB_ImageCapture resource. | |
21 * | |
22 * @param[in] media_stream_video_track A <code>PP_Resource</code> identifying | |
23 * one MediaStream video track. | |
24 * | |
Justin Chuang
2014/07/21 17:34:56
What happens if the video track is Close()-ed?
wuchengli
2014/07/29 03:24:49
Now I think video track and image capture should b
Owen Lin
2014/07/29 03:34:43
I think we need stream on to take a photo. It need
| |
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); | |
dmichael (off chromium)
2014/07/16 23:10:54
I'm a little unsure about this. I like that it nea
wuchengli
2014/07/17 14:05:47
I followed the design in Mediastream Image Capture
wuchengli
2014/07/29 03:24:49
I've changed the constructor argument to source ID
| |
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 image capture. | |
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 <code>PP_ImageCaptureConfig</code> 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>. | |
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 the configuration of the image capture. | |
62 * | |
63 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
64 * image capture resource. | |
65 * @param[out] config A <code>PP_ImageCaptureConfig</code> for storing the | |
66 * current image capture config on success. Otherwise, the values will not be | |
67 * changed. | |
68 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
69 * completion of <code>GetConfig()</code>. | |
70 * | |
71 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
72 */ | |
73 int32_t GetConfig([in] PP_Resource image_capture, | |
74 [out] PP_Resource config, | |
75 [in] PP_CompletionCallback callback); | |
76 | |
77 /** | |
78 * Gets the image capture capabilities of the camera. | |
79 * | |
80 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
81 * image capture resource. | |
82 * @param[out] capabilities A <code>PP_ImageCaptureCapabilities</code> for | |
83 * storing the image capture capabilities on success. Otherwise, the value | |
84 * will not be changed. | |
85 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | |
86 * completion of <code>GetCapabilities()</code>. | |
87 * | |
88 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
89 */ | |
90 int32_t GetCapabilities([in] PP_Resource image_capture, | |
91 [out] PP_Resource capabilities, | |
92 [in] PP_CompletionCallback callback); | |
93 | |
94 /** | |
95 * Takes a photo from the camera. | |
96 * | |
Justin Chuang
2014/07/21 17:34:56
Add comments that it may mute()/unmute() the paire
wuchengli
2014/07/29 03:24:50
Done.
| |
97 * @param[in] image_capture A <code>PP_Resource</code> corresponding to an | |
98 * image capture resource. | |
99 * @param[out] postview_frame A <code>PP_Resource</code> corresponding to a | |
100 * VideoFrame resource used to store the postview. The client can use this to | |
101 * show the captured photo. The format and the size are decided by the | |
102 * associated MediaStream video track. | |
103 * @param[out] photo A <code>PP_Resource</code> corresponding to a VideoFrame | |
104 * resource used to store the encoded picture. The default format is JPEG. | |
Justin Chuang
2014/07/21 17:34:56
I suspect that we need to add a new PP_Resource.
wuchengli
2014/07/29 03:24:49
PPB_ImageData applies to only ARGB so we should no
| |
105 * @param[in] callback A <code>PP_CompletionCallback</code> to be called when | |
106 * the picture has been taken and the camera can be moved without making the | |
107 * picture blurry. The client can play a shutter sound if needed. | |
108 * @param[in] postview_callback A <code>PP_CompletionCallback</code> to be | |
109 * called to store a postview video frame in <code>postview_frame</code> | |
110 * @param[in] photo_callback A <code>PP_CompletionCallback</code> to be | |
111 * called upon completion of TakePhoto(). <code>photo</code> will contain the | |
112 * encoded picture. | |
Justin Chuang
2014/07/21 17:34:56
A general question: do we want to do something lik
wuchengli
2014/07/29 03:24:49
We may need it in the future. When I was on Androi
| |
113 * | |
114 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
115 */ | |
116 int32_t TakePhoto([in] PP_Resource image_capture, | |
117 [out] PP_Resource postview_frame, | |
118 [out] PP_Resource photo, | |
119 [in] PP_CompletionCallback shutter_callback, | |
120 [in] PP_CompletionCallback postview_callback, | |
121 [in] PP_CompletionCallback photo_callback); | |
dmichael (off chromium)
2014/07/16 23:10:54
We can't use multiple completion callbacks for 1 f
wuchengli
2014/07/17 14:05:47
You are right. I read the documentation of complet
wuchengli
2014/07/29 03:24:49
I moved the callbacks to PPP_ImageCapture_Private.
| |
122 }; | |
OLD | NEW |