| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 dev/ppb_video_capture_dev.idl modified Wed Oct 5 09:11:07 2011. */ | 6 /* From dev/ppb_video_capture_dev.idl modified Fri Dec 16 16:32:36 2011. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/dev/pp_video_capture_dev.h" | 11 #include "ppapi/c/dev/pp_video_capture_dev.h" |
| 12 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
| 15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
| 17 | 17 |
| 18 #define PPB_VIDEOCAPTURE_DEV_INTERFACE_0_1 "PPB_VideoCapture(Dev);0.1" | 18 #define PPB_VIDEOCAPTURE_DEV_INTERFACE_0_1 "PPB_VideoCapture(Dev);0.1" |
| 19 #define PPB_VIDEOCAPTURE_DEV_INTERFACE PPB_VIDEOCAPTURE_DEV_INTERFACE_0_1 | 19 #define PPB_VIDEOCAPTURE_DEV_INTERFACE_0_2 "PPB_VideoCapture(Dev);0.2" |
| 20 #define PPB_VIDEOCAPTURE_DEV_INTERFACE PPB_VIDEOCAPTURE_DEV_INTERFACE_0_2 |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * @file | 23 * @file |
| 23 * This file defines the <code>PPB_VideoCapture_Dev</code> interface. | 24 * This file defines the <code>PPB_VideoCapture_Dev</code> interface. |
| 24 */ | 25 */ |
| 25 | 26 |
| 26 | 27 |
| 27 /** | 28 /** |
| 28 * @addtogroup Interfaces | 29 * @addtogroup Interfaces |
| 29 * @{ | 30 * @{ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 56 struct PPB_VideoCapture_Dev { | 57 struct PPB_VideoCapture_Dev { |
| 57 /** | 58 /** |
| 58 * Creates a new VideoCapture. | 59 * Creates a new VideoCapture. |
| 59 */ | 60 */ |
| 60 PP_Resource (*Create)(PP_Instance instance); | 61 PP_Resource (*Create)(PP_Instance instance); |
| 61 /** | 62 /** |
| 62 * Returns PP_TRUE if the given resource is a VideoCapture. | 63 * Returns PP_TRUE if the given resource is a VideoCapture. |
| 63 */ | 64 */ |
| 64 PP_Bool (*IsVideoCapture)(PP_Resource video_capture); | 65 PP_Bool (*IsVideoCapture)(PP_Resource video_capture); |
| 65 /** | 66 /** |
| 66 * Starts the capture. |requested_info| is a pointer to a structure containing | 67 * Starts the capture. |device_ref| identifies a video capture device, |
| 67 * the requested resolution and frame rate. |buffer_count| is the number of | 68 * returned by <code>PPB_StreamDeviceEnumerator_Dev</code>. |requested_info| |
| 68 * buffers requested by the plugin. Note: it is only used as advisory, the | 69 * is a pointer to a structure containing the requested resolution and frame |
| 69 * browser may allocate more of fewer based on available resources. | 70 * rate. |buffer_count| is the number of buffers requested by the plugin. |
| 70 * How many buffers depends on usage. At least 2 to make sure latency doesn't | 71 * Note: it is only used as advisory, the browser may allocate more of fewer |
| 71 * cause lost frames. If the plugin expects to hold on to more than one buffer | 72 * based on available resources. How many buffers depends on usage. At least 2 |
| 72 * at a time (e.g. to do multi-frame processing, like video encoding), it | 73 * to make sure latency doesn't cause lost frames. If the plugin expects to |
| 73 * should request that many more. | 74 * hold on to more than one buffer at a time (e.g. to do multi-frame |
| 75 * processing, like video encoding), it should request that many more. |
| 74 * | 76 * |
| 75 * Returns PP_ERROR_FAILED if called when the capture was already started, or | 77 * Returns PP_ERROR_FAILED if called when the capture was already started, or |
| 76 * PP_OK on success. | 78 * PP_OK on success. |
| 77 */ | 79 */ |
| 78 int32_t (*StartCapture)( | 80 int32_t (*StartCapture)( |
| 79 PP_Resource video_capture, | 81 PP_Resource video_capture, |
| 82 PP_Resource device_ref, |
| 80 const struct PP_VideoCaptureDeviceInfo_Dev* requested_info, | 83 const struct PP_VideoCaptureDeviceInfo_Dev* requested_info, |
| 81 uint32_t buffer_count); | 84 uint32_t buffer_count); |
| 82 /** | 85 /** |
| 83 * Allows the browser to reuse a buffer that was previously sent by | 86 * Allows the browser to reuse a buffer that was previously sent by |
| 84 * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in | 87 * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in |
| 85 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. | 88 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. |
| 86 * | 89 * |
| 87 * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the | 90 * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the |
| 88 * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it | 91 * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it |
| 89 * is not currently owned by the plugin. Returns PP_OK otherwise. | 92 * is not currently owned by the plugin. Returns PP_OK otherwise. |
| 90 */ | 93 */ |
| 91 int32_t (*ReuseBuffer)(PP_Resource video_capture, uint32_t buffer); | 94 int32_t (*ReuseBuffer)(PP_Resource video_capture, uint32_t buffer); |
| 92 /** | 95 /** |
| 93 * Stops the capture. | 96 * Stops the capture. |
| 94 * | 97 * |
| 95 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on | 98 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on |
| 96 * success. | 99 * success. |
| 97 */ | 100 */ |
| 98 int32_t (*StopCapture)(PP_Resource video_capture); | 101 int32_t (*StopCapture)(PP_Resource video_capture); |
| 99 }; | 102 }; |
| 103 |
| 104 struct PPB_VideoCapture_Dev_0_1 { |
| 105 PP_Resource (*Create)(PP_Instance instance); |
| 106 PP_Bool (*IsVideoCapture)(PP_Resource video_capture); |
| 107 int32_t (*StartCapture)( |
| 108 PP_Resource video_capture, |
| 109 const struct PP_VideoCaptureDeviceInfo_Dev* requested_info, |
| 110 uint32_t buffer_count); |
| 111 int32_t (*ReuseBuffer)(PP_Resource video_capture, uint32_t buffer); |
| 112 int32_t (*StopCapture)(PP_Resource video_capture); |
| 113 }; |
| 100 /** | 114 /** |
| 101 * @} | 115 * @} |
| 102 */ | 116 */ |
| 103 | 117 |
| 104 #endif /* PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ */ | 118 #endif /* PPAPI_C_DEV_PPB_VIDEO_CAPTURE_DEV_H_ */ |
| 105 | 119 |
| OLD | NEW |