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 /* From ppb_media_stream_video_track.idl modified Thu Jan 23 14:09:56 2014. */ | 6 /* From ppb_media_stream_video_track.idl modified Wed Feb 19 11:06:48 2014. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ | 8 #ifndef PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ |
9 #define PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ | 9 #define PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
(...skipping 21 matching lines...) Expand all Loading... |
38 * Attribute list terminator. | 38 * Attribute list terminator. |
39 */ | 39 */ |
40 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, | 40 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE = 0, |
41 /** | 41 /** |
42 * The maximum number of frames to hold in the input buffer. | 42 * The maximum number of frames to hold in the input buffer. |
43 * Note: this is only used as advisory; the browser may allocate more or fewer | 43 * Note: this is only used as advisory; the browser may allocate more or fewer |
44 * based on available resources. How many frames to buffer depends on usage - | 44 * based on available resources. How many frames to buffer depends on usage - |
45 * request at least 2 to make sure latency doesn't cause lost frames. If | 45 * request at least 2 to make sure latency doesn't cause lost frames. If |
46 * the plugin expects to hold on to more than one frame at a time (e.g. to do | 46 * the plugin expects to hold on to more than one frame at a time (e.g. to do |
47 * multi-frame processing), it should request that many more. | 47 * multi-frame processing), it should request that many more. |
| 48 * If this attribute is not specified or value 0 is specified for this |
| 49 * attribute, the default value will be used. |
48 */ | 50 */ |
49 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, | 51 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES = 1, |
50 /** | 52 /** |
51 * The width of video frames in pixels. It should be a multiple of 4. | 53 * The width of video frames in pixels. It should be a multiple of 4. |
| 54 * If the specified size is different from the video source (webcam), |
| 55 * frames will be scaled to specified size. |
| 56 * If this attribute is not specified or value 0 is specified, the original |
| 57 * frame size of the video track will be used. |
52 * | 58 * |
53 * Maximum value: 4096 (4K resolution). | 59 * Maximum value: 4096 (4K resolution). |
54 */ | 60 */ |
55 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, | 61 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_WIDTH = 2, |
56 /** | 62 /** |
57 * The height of video frames in pixels. It should be a multiple of 4. | 63 * The height of video frames in pixels. It should be a multiple of 4. |
| 64 * If the specified size is different from the video source (webcam), |
| 65 * frames will be scaled to specified size. |
| 66 * If this attribute is not specified or value 0 is specified, the original |
| 67 * frame size of the video track will be used. |
58 * | 68 * |
59 * Maximum value: 4096 (4K resolution). | 69 * Maximum value: 4096 (4K resolution). |
60 */ | 70 */ |
61 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, | 71 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_HEIGHT = 3, |
62 /** | 72 /** |
63 * The format of video frames. The attribute value is | 73 * The format of video frames. The attribute value is |
64 * a <code>PP_VideoFrame_Format</code>. | 74 * a <code>PP_VideoFrame_Format</code>. If the specified format is different |
| 75 * from the video source (webcam), frames will be converted to specified |
| 76 * format. |
| 77 * If this attribute is not specified or value |
| 78 * <code>PP_VIDEOFRAME_FORMAT_UNKNOWN</code> is specified, the orignal frame |
| 79 * format of the video track will be used. |
65 */ | 80 */ |
66 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 | 81 PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT = 4 |
67 } PP_MediaStreamVideoTrack_Attrib; | 82 } PP_MediaStreamVideoTrack_Attrib; |
68 /** | 83 /** |
69 * @} | 84 * @} |
70 */ | 85 */ |
71 | 86 |
72 /** | 87 /** |
73 * @addtogroup Interfaces | 88 * @addtogroup Interfaces |
74 * @{ | 89 * @{ |
75 */ | 90 */ |
76 struct PPB_MediaStreamVideoTrack_0_1 { /* dev */ | 91 struct PPB_MediaStreamVideoTrack_0_1 { /* dev */ |
77 /** | 92 /** |
78 * Determines if a resource is a MediaStream video track resource. | 93 * Determines if a resource is a MediaStream video track resource. |
79 * | 94 * |
80 * @param[in] resource The <code>PP_Resource</code> to test. | 95 * @param[in] resource The <code>PP_Resource</code> to test. |
81 * | 96 * |
82 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | 97 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
83 * resource is a Mediastream video track resource or <code>PP_FALSE</code> | 98 * resource is a Mediastream video track resource or <code>PP_FALSE</code> |
84 * otherwise. | 99 * otherwise. |
85 */ | 100 */ |
86 PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource); | 101 PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource); |
87 /** | 102 /** |
88 * Configures underlying frame buffers for incoming frames. | 103 * Configures underlying frame buffers for incoming frames. |
89 * If the application doesn't want to drop frames, then the | 104 * If the application doesn't want to drop frames, then the |
90 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES</code> should be | 105 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES</code> should be |
91 * chosen such that inter-frame processing time variability won't overrun the | 106 * chosen such that inter-frame processing time variability won't overrun the |
92 * input buffer. If the buffer is overfilled, then frames will be dropped. | 107 * input buffer. If the buffer is overfilled, then frames will be dropped. |
93 * The application can detect this by examining the timestamp on returned | 108 * The application can detect this by examining the timestamp on returned |
94 * frames. If <code>Configure()</code> is not called, default settings will be | 109 * frames. If some attributes are not specified, default values will be used |
95 * used. | 110 * for those unspecified attributes. If <code>Configure()</code> is not |
| 111 * called, default settings will be used. |
96 * Example usage from plugin code: | 112 * Example usage from plugin code: |
97 * @code | 113 * @code |
98 * int32_t attribs[] = { | 114 * int32_t attribs[] = { |
99 * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, | 115 * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES, 4, |
100 * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; | 116 * PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE}; |
101 * track_if->Configure(track, attribs, callback); | 117 * track_if->Configure(track, attribs, callback); |
102 * @endcode | 118 * @endcode |
103 * | 119 * |
104 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video | 120 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video |
105 * resource. | 121 * resource. |
106 * @param[in] attrib_list A list of attribute name-value pairs in which each | 122 * @param[in] attrib_list A list of attribute name-value pairs in which each |
107 * attribute is immediately followed by the corresponding desired value. | 123 * attribute is immediately followed by the corresponding desired value. |
108 * The list is terminated by | 124 * The list is terminated by |
109 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. | 125 * <code>PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE</code>. |
110 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon | 126 * @param[in] callback <code>PP_CompletionCallback</code> to be called upon |
111 * completion of <code>Configure()</code>. | 127 * completion of <code>Configure()</code>. |
112 * | 128 * |
113 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | 129 * @return An int32_t containing a result code from <code>pp_errors.h</code>. |
| 130 * Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of |
| 131 * <code>Configure()</code> or <code>GetFrame()</code>, or the plugin |
| 132 * holds some frames which are not recycled with <code>RecycleFrame()</code>. |
| 133 * If an error is returned, all attributes and the underlying buffer will not |
| 134 * be changed. |
114 */ | 135 */ |
115 int32_t (*Configure)(PP_Resource video_track, | 136 int32_t (*Configure)(PP_Resource video_track, |
116 const int32_t attrib_list[], | 137 const int32_t attrib_list[], |
117 struct PP_CompletionCallback callback); | 138 struct PP_CompletionCallback callback); |
118 /** | 139 /** |
119 * Gets attribute value for a given attribute name. | 140 * Gets attribute value for a given attribute name. |
120 * | 141 * |
121 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video | 142 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video |
122 * resource. | 143 * resource. |
123 * @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for | 144 * @param[in] attrib A <code>PP_MediaStreamVideoTrack_Attrib</code> for |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 * MediaStream video track resource. | 218 * MediaStream video track resource. |
198 */ | 219 */ |
199 void (*Close)(PP_Resource video_track); | 220 void (*Close)(PP_Resource video_track); |
200 }; | 221 }; |
201 /** | 222 /** |
202 * @} | 223 * @} |
203 */ | 224 */ |
204 | 225 |
205 #endif /* PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ */ | 226 #endif /* PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ */ |
206 | 227 |
OLD | NEW |