OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright (c) 2011 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 #ifndef PPAPI_C_DEV_PPP_VIDEO_CAPTURE_DEV_H_ | |
6 #define PPAPI_C_DEV_PPP_VIDEO_CAPTURE_DEV_H_ | |
7 | |
8 #include "ppapi/c/dev/pp_video_capture_dev.h" | |
9 #include "ppapi/c/pp_instance.h" | |
10 #include "ppapi/c/pp_resource.h" | |
11 #include "ppapi/c/pp_stdint.h" | |
12 | |
13 #define PPP_VIDEO_CAPTURE_DEV_INTERFACE_0_1 "PPP_VideoCapture(Dev);0.1" | |
14 #define PPP_VIDEO_CAPTURE_DEV_INTERFACE PPP_VIDEO_CAPTURE_DEV_INTERFACE_0_1 | |
15 | |
16 /** | |
17 * Video Capture client interface. See |PPB_VideoCapture_Dev| for general theory | |
18 * of operation. | |
19 */ | |
20 struct PPP_VideoCapture_Dev { | |
darin (slow to review)
2011/08/02 18:02:59
it is necessary to have PPP_VideoCapture_Dev? Can
piman
2011/08/03 21:45:38
After discussion with Darin, we decided to go ahea
| |
21 /** | |
22 * Signals the capture device information, such as resolution and frame rate, | |
23 * and the array of buffers that the browser will use to send pixel data. | |
24 * | |
25 * |info| is a pointer to the PP_VideoCaptureDeviceInfo_Dev structure | |
26 * containing resolution and frame rate. | |
27 * |buffer_count| is the number of buffers, and |buffers| is the array of | |
28 * PPB_Buffer_Dev buffers. | |
29 * | |
30 * Note: the buffers are passed without an extra reference. The plugin is | |
31 * expected to add its own references to the buffers. | |
32 */ | |
33 void (*OnDeviceInfo)(PP_Instance instance, | |
brettw
2011/08/02 17:17:44
Do these functions really need the instance? Norma
piman
2011/08/03 00:44:41
All functions in other PPP interfaces that apply t
| |
34 PP_Resource video_capture, | |
35 const struct PP_VideoCaptureDeviceInfo_Dev* info, | |
36 uint32_t buffer_count, | |
37 const PP_Resource* buffers); | |
38 | |
39 /** | |
40 * Signals status changes on the VideoCapture. |status| is a | |
41 * one of the values from PP_VideoCaptureDeviceInfo_Dev; | |
wjia(left Chromium)
2011/08/02 16:22:28
PP_VideoCaptureStatus_Dev?
piman
2011/08/03 00:44:41
Done.
| |
42 */ | |
43 void (*OnStatus)(PP_Instance instance, | |
44 PP_Resource video_capture, | |
45 uint32_t status); | |
46 | |
47 /** | |
48 * Signals an error from the video capture system. | |
49 * | |
50 * Errors that can be generated: | |
51 * - PP_ERROR_NOMEMORY: not enough memory was available to allocate buffers. | |
52 * - PP_ERROR_FAILED: video capture could not start. | |
53 */ | |
54 void (*OnError)(PP_Instance instance, | |
55 PP_Resource video_capture, | |
56 uint32_t error_code); | |
57 | |
58 /** | |
59 * Signals that a buffer is available for consumption by the plugin. | |
60 * | |
61 * |buffer| is the index of the buffer, in the array returned by OnDeviceInfo. | |
62 */ | |
63 void (*OnBufferReady)(PP_Instance, | |
64 PP_Resource video_capture, | |
65 uint32_t buffer); | |
66 }; | |
67 | |
68 #endif /* PPAPI_C_DEV_PPP_VIDEO_CAPTURE_DEV_H_ */ | |
69 | |
OLD | NEW |