OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2013 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 |
| 6 /* From ppb_video_frame.idl modified Fri Dec 20 15:24:29 2013. */ |
| 7 |
| 8 #ifndef PPAPI_C_PPB_VIDEO_FRAME_H_ |
| 9 #define PPAPI_C_PPB_VIDEO_FRAME_H_ |
| 10 |
| 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "ppapi/c/pp_size.h" |
| 15 #include "ppapi/c/pp_stdint.h" |
| 16 #include "ppapi/c/pp_time.h" |
| 17 |
| 18 #define PPB_VIDEOFRAME_INTERFACE_0_1 "PPB_VideoFrame;0.1" /* dev */ |
| 19 /** |
| 20 * @file |
| 21 * Defines the <code>PPB_VideoFrame</code> interface. |
| 22 */ |
| 23 |
| 24 |
| 25 /** |
| 26 * @addtogroup Enums |
| 27 * @{ |
| 28 */ |
| 29 typedef enum { |
| 30 /** |
| 31 * Unknown format value. |
| 32 */ |
| 33 PP_VIDEOFRAME_FORMAT_UNKNOWN = 0, |
| 34 /** |
| 35 * 12bpp YVU planar 1x1 Y, 2x2 VU samples. |
| 36 */ |
| 37 PP_VIDEOFRAME_FORMAT_YV12 = 1, |
| 38 /** |
| 39 * 16bpp YVU planar 1x1 Y, 2x1 VU samples. |
| 40 */ |
| 41 PP_VIDEOFRAME_FORMAT_YV16 = 2, |
| 42 /** |
| 43 * 12bpp YVU planar 1x1 Y, 2x2 VU samples. |
| 44 */ |
| 45 PP_VIDEOFRAME_FORMAT_I420 = 3, |
| 46 /** |
| 47 * 20bpp YVU planar 1x1 Y, 2x2 VU, 1x1 A samples. |
| 48 */ |
| 49 PP_VIDEOFRAME_FORMAT_YV12A = 4, |
| 50 /** |
| 51 * JPEG color range version of YV12. |
| 52 */ |
| 53 PP_VIDEOFRAME_FORMAT_YV12J = 5 |
| 54 } PP_VideoFrame_Format; |
| 55 /** |
| 56 * @} |
| 57 */ |
| 58 |
| 59 /** |
| 60 * @addtogroup Interfaces |
| 61 * @{ |
| 62 */ |
| 63 struct PPB_VideoFrame_0_1 { /* dev */ |
| 64 /** |
| 65 * Determines if a resource is a VideoFrame resource. |
| 66 * |
| 67 * @param[in] resource The <code>PP_Resource</code> to test. |
| 68 * |
| 69 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| 70 * resource is a VideoFrame resource or <code>PP_FALSE</code> otherwise. |
| 71 */ |
| 72 PP_Bool (*IsVideoFrame)(PP_Resource resource); |
| 73 /** |
| 74 * Gets timestamp of the video frame. |
| 75 * |
| 76 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 77 * resource. |
| 78 * |
| 79 * @return A <code>PP_TimeDelta</code> containing timestamp of the video |
| 80 * frame. Given in seconds since the start of the containing video stream. |
| 81 */ |
| 82 PP_TimeDelta (*GetTimestamp)(PP_Resource frame); |
| 83 /** |
| 84 * Sets the timestamp of the video frame. Given in seconds since the |
| 85 * start of the containing video stream. |
| 86 * |
| 87 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 88 * resource. |
| 89 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp |
| 90 * of the video frame. Given in seconds since the start of the containing |
| 91 * video stream. |
| 92 */ |
| 93 void (*SetTimestamp)(PP_Resource frame, PP_TimeDelta timestamp); |
| 94 /** |
| 95 * Gets format of the video frame. |
| 96 * |
| 97 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 98 * resource. |
| 99 * |
| 100 * @return A <code>PP_VideoFrame_Format</code> containing the format of the |
| 101 * video frame. |
| 102 */ |
| 103 PP_VideoFrame_Format (*GetFormat)(PP_Resource frame); |
| 104 /** |
| 105 * Gets size of the video frame. |
| 106 * |
| 107 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 108 * resource. |
| 109 * |
| 110 * @return A <code>PP_Size<code> containing the size of the video frame. |
| 111 */ |
| 112 struct PP_Size* (*GetSize)(PP_Resource frame, struct PP_Size* size); |
| 113 /** |
| 114 * Gets data buffer for video frame pixels. |
| 115 * |
| 116 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 117 * resource. |
| 118 * |
| 119 * @return A pointer to the beginning of data buffer. |
| 120 */ |
| 121 void* (*GetDataBuffer)(PP_Resource frame); |
| 122 /** |
| 123 * Gets size of data buffer. |
| 124 * |
| 125 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| 126 * resource. |
| 127 * |
| 128 * @return The size of the data buffer. |
| 129 */ |
| 130 uint32_t (*GetDataBufferSize)(PP_Resource frame); |
| 131 }; |
| 132 /** |
| 133 * @} |
| 134 */ |
| 135 |
| 136 #endif /* PPAPI_C_PPB_VIDEO_FRAME_H_ */ |
| 137 |
OLD | NEW |