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
3 * found in the LICENSE file.
6 /* From ppb_video_frame.idl modified Tue Feb 11 14:41:52 2014. */
8 #ifndef PPAPI_C_PPB_VIDEO_FRAME_H_
9 #define PPAPI_C_PPB_VIDEO_FRAME_H_
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"
18 #define PPB_VIDEOFRAME_INTERFACE_0_1 "PPB_VideoFrame;0.1" /* dev */
21 * Defines the <code>PPB_VideoFrame</code> interface.
31 * Unknown format value.
33 PP_VIDEOFRAME_FORMAT_UNKNOWN
= 0,
35 * 12bpp YVU planar 1x1 Y, 2x2 VU samples.
37 PP_VIDEOFRAME_FORMAT_YV12
= 1,
39 * 12bpp YUV planar 1x1 Y, 2x2 UV samples.
41 PP_VIDEOFRAME_FORMAT_I420
= 2,
45 PP_VIDEOFRAME_FORMAT_BGRA
= 3,
49 PP_VIDEOFRAME_FORMAT_LAST
= PP_VIDEOFRAME_FORMAT_BGRA
50 } PP_VideoFrame_Format
;
56 * @addtogroup Interfaces
59 struct PPB_VideoFrame_0_1
{ /* dev */
61 * Determines if a resource is a VideoFrame resource.
63 * @param[in] resource The <code>PP_Resource</code> to test.
65 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
66 * resource is a VideoFrame resource or <code>PP_FALSE</code> otherwise.
68 PP_Bool (*IsVideoFrame
)(PP_Resource resource
);
70 * Gets the timestamp of the video frame.
72 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
75 * @return A <code>PP_TimeDelta</code> containing the timestamp of the video
76 * frame. Given in seconds since the start of the containing video stream.
78 PP_TimeDelta (*GetTimestamp
)(PP_Resource frame
);
80 * Sets the timestamp of the video frame. Given in seconds since the
81 * start of the containing video stream.
83 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
85 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
86 * of the video frame. Given in seconds since the start of the containing
89 void (*SetTimestamp
)(PP_Resource frame
, PP_TimeDelta timestamp
);
91 * Gets the format of the video frame.
93 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
96 * @return A <code>PP_VideoFrame_Format</code> containing the format of the
99 PP_VideoFrame_Format (*GetFormat
)(PP_Resource frame
);
101 * Gets the size of the video frame.
103 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
105 * @param[out] size A <code>PP_Size</code>.
107 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> on success or
108 * <code>PP_FALSE</code> on failure.
110 PP_Bool (*GetSize
)(PP_Resource frame
, struct PP_Size
* size
);
112 * Gets the data buffer for video frame pixels.
114 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
117 * @return A pointer to the beginning of the data buffer.
119 void* (*GetDataBuffer
)(PP_Resource frame
);
121 * Gets the size of data buffer.
123 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
126 * @return The size of the data buffer.
128 uint32_t (*GetDataBufferSize
)(PP_Resource frame
);
134 #endif /* PPAPI_C_PPB_VIDEO_FRAME_H_ */