OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 * This file defines the <code>PPB_VideoCapture_Dev</code> interface. | 7 * This file defines the <code>PPB_VideoCapture_Dev</code> interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M14 = 0.1, | |
11 M19 = 0.2 | 10 M19 = 0.2 |
12 }; | 11 }; |
13 | 12 |
14 /** | 13 /** |
15 * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev. | 14 * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev. |
16 * | 15 * |
17 * Theory of operation: | 16 * Theory of operation: |
18 * 1- Create a VideoCapture resource using Create. | 17 * 1- Create a VideoCapture resource using Create. |
19 * 2- Find available video capture devices using EnumerateDevices. | 18 * 2- Find available video capture devices using EnumerateDevices. |
20 * 3- Open a video capture device. In addition to a device reference (0 can be | 19 * 3- Open a video capture device. In addition to a device reference (0 can be |
(...skipping 26 matching lines...) Expand all Loading... | |
47 PP_Resource Create( | 46 PP_Resource Create( |
48 [in] PP_Instance instance); | 47 [in] PP_Instance instance); |
49 | 48 |
50 /** | 49 /** |
51 * Returns PP_TRUE if the given resource is a VideoCapture. | 50 * Returns PP_TRUE if the given resource is a VideoCapture. |
52 */ | 51 */ |
53 PP_Bool IsVideoCapture( | 52 PP_Bool IsVideoCapture( |
54 [in] PP_Resource video_capture); | 53 [in] PP_Resource video_capture); |
55 | 54 |
56 /** | 55 /** |
57 * Starts the capture. |requested_info| is a pointer to a structure containing | |
58 * the requested resolution and frame rate. |buffer_count| is the number of | |
59 * buffers requested by the plugin. Note: it is only used as advisory, the | |
60 * browser may allocate more or fewer based on available resources. | |
61 * How many buffers depends on usage. At least 2 to make sure latency doesn't | |
62 * cause lost frames. If the plugin expects to hold on to more than one buffer | |
63 * at a time (e.g. to do multi-frame processing, like video encoding), it | |
64 * should request that many more. | |
65 * | |
66 * Returns PP_ERROR_FAILED if called when the capture was already started, or | |
67 * PP_OK on success. | |
68 */ | |
69 [version=0.1] | |
70 int32_t StartCapture( | |
71 [in] PP_Resource video_capture, | |
72 [in] PP_VideoCaptureDeviceInfo_Dev requested_info, | |
73 [in] uint32_t buffer_count); | |
74 | |
75 /** | |
76 * Enumerates video capture devices. Once the operation is completed | 56 * Enumerates video capture devices. Once the operation is completed |
77 * successfully, |devices| will be set to a PPB_ResourceArray_Dev resource, | 57 * successfully, |devices| will be set to a PPB_ResourceArray_Dev resource, |
78 * which holds a list of PPB_DeviceRef_Dev resources. | 58 * which holds a list of PPB_DeviceRef_Dev resources. |
79 * | 59 * |
80 * Please note that: | 60 * Please note that: |
81 * - this method ignores the previous value pointed to by |devices| (won't | 61 * - this method ignores the previous value pointed to by |devices| (won't |
82 * release reference even if it is not 0); | 62 * release reference even if it is not 0); |
83 * - |devices| must be valid until |callback| is called, if the method | 63 * - |devices| must be valid until |callback| is called, if the method |
84 * returns PP_OK_COMPLETIONPENDING; | 64 * returns PP_OK_COMPLETIONPENDING; |
85 * - the ref count of the returned |devices| has already been increased by 1 | 65 * - the ref count of the returned |devices| has already been increased by 1 |
86 * for the caller. | 66 * for the caller. |
87 */ | 67 */ |
88 [version=0.2] | 68 [version=0.2] |
yzshen1
2012/11/06 06:51:40
There is no need to keep this line. (And same for
victorhsieh
2012/11/08 09:20:18
Done.
| |
89 int32_t EnumerateDevices( | 69 int32_t EnumerateDevices( |
90 [in] PP_Resource video_capture, | 70 [in] PP_Resource video_capture, |
91 [out] PP_Resource devices, | 71 [out] PP_Resource devices, |
92 [in] PP_CompletionCallback callback); | 72 [in] PP_CompletionCallback callback); |
93 | 73 |
94 /** | 74 /** |
95 * Opens a video capture device. |device_ref| identifies a video capture | 75 * Opens a video capture device. |device_ref| identifies a video capture |
96 * device. It could be one of the resource in the array returned by | 76 * device. It could be one of the resource in the array returned by |
97 * |EnumerateDevices()|, or 0 which means the default device. | 77 * |EnumerateDevices()|, or 0 which means the default device. |
98 * |requested_info| is a pointer to a structure containing the requested | 78 * |requested_info| is a pointer to a structure containing the requested |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 /** | 127 /** |
148 * Closes the video capture device, and stops capturing if necessary. It is | 128 * Closes the video capture device, and stops capturing if necessary. It is |
149 * not valid to call |Open()| again after a call to this method. | 129 * not valid to call |Open()| again after a call to this method. |
150 * If a video capture resource is destroyed while a device is still open, then | 130 * If a video capture resource is destroyed while a device is still open, then |
151 * it will be implicitly closed, so you are not required to call this method. | 131 * it will be implicitly closed, so you are not required to call this method. |
152 */ | 132 */ |
153 [version=0.2] | 133 [version=0.2] |
154 void Close( | 134 void Close( |
155 [in] PP_Resource video_capture); | 135 [in] PP_Resource video_capture); |
156 }; | 136 }; |
OLD | NEW |