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 /** | 6 /** |
7 * Defines the <code>PPB_MediaStreamVideoTrack</code> interface. Used for | 7 * Defines the <code>PPB_MediaStreamVideoTrack</code> interface. Used for |
8 * receiving video frames from a MediaStream video track in the browser. | 8 * receiving video frames from a MediaStream video track in the browser. |
9 * This interface is still in development (Dev API status) and may change. | 9 * This interface is still in development (Dev API status) and may change. |
10 */ | 10 */ |
(...skipping 14 matching lines...) Expand all Loading... | |
25 */ | 25 */ |
26 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, | 26 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, |
27 | 27 |
28 /** | 28 /** |
29 * The maximum number of frames to hold in the input buffer. | 29 * The maximum number of frames to hold in the input buffer. |
30 * Note: this is only used as advisory; the browser may allocate more or fewer | 30 * Note: this is only used as advisory; the browser may allocate more or fewer |
31 * based on available resources. How many frames to buffer depends on usage - | 31 * based on available resources. How many frames to buffer depends on usage - |
32 * request at least 2 to make sure latency doesn't cause lost frames. If | 32 * request at least 2 to make sure latency doesn't cause lost frames. If |
33 * the plugin expects to hold on to more than one frame at a time (e.g. to do | 33 * the plugin expects to hold on to more than one frame at a time (e.g. to do |
34 * multi-frame processing), it should request that many more. | 34 * multi-frame processing), it should request that many more. |
35 * If 0 is specified, the default value will be used. | |
yzshen1
2014/02/18 18:11:40
(Have you considered this?) An alternative is to r
Peng
2014/02/18 22:30:09
I considered it. I think your suggestion and curre
| |
35 */ | 36 */ |
36 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, | 37 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, |
37 | 38 |
38 /** | 39 /** |
39 * The width of video frames in pixels. It should be a multiple of 4. | 40 * The width of video frames in pixels. It should be a multiple of 4. |
41 * If the specified size is different with the video source (webcam), | |
yzshen1
2014/02/18 18:11:40
nit: "different from"?
Peng
2014/02/18 22:30:09
Done.
| |
42 * frames will be scaled to specified size. If 0 is specified, the original | |
43 * frame size of the video track will be used. | |
40 * | 44 * |
41 * Maximum value: 4096 (4K resolution). | 45 * Maximum value: 4096 (4K resolution). |
42 */ | 46 */ |
43 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, | 47 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, |
44 | 48 |
45 /** | 49 /** |
46 * The height of video frames in pixels. It should be a multiple of 4. | 50 * The height of video frames in pixels. It should be a multiple of 4. |
51 * If the specified size is different with the video source (webcam), | |
yzshen1
2014/02/18 18:11:40
ditto
Peng
2014/02/18 22:30:09
Done.
| |
52 * frames will be scaled to specified size. If 0 is specified, the original | |
53 * frame size of the video track will be used. | |
47 * | 54 * |
48 * Maximum value: 4096 (4K resolution). | 55 * Maximum value: 4096 (4K resolution). |
49 */ | 56 */ |
50 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, | 57 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, |
51 | 58 |
52 /** | 59 /** |
53 * The format of video frames. The attribute value is | 60 * The format of video frames. The attribute value is |
54 * a <code>PP_VideoFrame_Format</code>. | 61 * a <code>PP_VideoFrame_Format</code>. If the specified format is different |
62 * with the video source (webcam), frames will be converted to specified | |
63 * format. If <code>PP_VIDEOFRAME_FORMAT_UNKNOWN</code> is specified, the | |
64 * orignal frame format of the video track will be used. | |
55 */ | 65 */ |
56 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 | 66 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 |
57 }; | 67 }; |
58 | 68 |
59 interface PPB_MediaStreamVideoTrack { | 69 interface PPB_MediaStreamVideoTrack { |
60 /** | 70 /** |
61 * Determines if a resource is a MediaStream video track resource. | 71 * Determines if a resource is a MediaStream video track resource. |
62 * | 72 * |
63 * @param[in] resource The <code>PP_Resource</code> to test. | 73 * @param[in] resource The <code>PP_Resource</code> to test. |
64 * | 74 * |
(...skipping 23 matching lines...) Expand all Loading... | |
88 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video | 98 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video |
89 * resource. | 99 * resource. |
90 * @param[in] attrib_list A list of attribute name-value pairs in which each | 100 * @param[in] attrib_list A list of attribute name-value pairs in which each |
91 * attribute is immediately followed by the corresponding desired value. | 101 * attribute is immediately followed by the corresponding desired value. |
92 * The list is terminated by | 102 * The list is terminated by |
93 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. | 103 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. |
94 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | 104 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon |
95 * completion of <code>Configure()</code>. | 105 * completion of <code>Configure()</code>. |
96 * | 106 * |
97 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | 107 * @return An int32_t containing a result code from <code>pp_errors.h</code>. |
108 * Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of | |
109 * <code>Configure()</code> or <code>GetFrame()</code>, or the plugin | |
110 * holds some frames which are not recycled with <code>RecycleFrame()</code>. | |
98 */ | 111 */ |
99 int32_t Configure([in] PP_Resource video_track, | 112 int32_t Configure([in] PP_Resource video_track, |
100 [in] int32_t[] attrib_list, | 113 [in] int32_t[] attrib_list, |
101 [in] PP_CompletionCallback callback); | 114 [in] PP_CompletionCallback callback); |
102 | 115 |
103 /** | 116 /** |
104 * Gets attribute value for a given attribute name. | 117 * Gets attribute value for a given attribute name. |
105 * | 118 * |
106 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video | 119 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video |
107 * resource. | 120 * resource. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 /** | 197 /** |
185 * Closes the MediaStream video track and disconnects it from video source. | 198 * Closes the MediaStream video track and disconnects it from video source. |
186 * After calling <code>Close()</code>, no new frames will be received. | 199 * After calling <code>Close()</code>, no new frames will be received. |
187 * | 200 * |
188 * @param[in] video_track A <code>PP_Resource</code> corresponding to a | 201 * @param[in] video_track A <code>PP_Resource</code> corresponding to a |
189 * MediaStream video track resource. | 202 * MediaStream video track resource. |
190 */ | 203 */ |
191 void Close([in] PP_Resource video_track); | 204 void Close([in] PP_Resource video_track); |
192 }; | 205 }; |
193 | 206 |
OLD | NEW |