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.
7 * Defines the <code>PPB_VideoFrame</code> interface.
13 [channel
=dev
] M34
= 0.1,
17 enum PP_VideoFrame_Format
{
19 * Unknown format value.
21 PP_VIDEOFRAME_FORMAT_UNKNOWN
= 0,
24 * 12bpp YVU planar 1x1 Y, 2x2 VU samples.
26 PP_VIDEOFRAME_FORMAT_YV12
= 1,
29 * 12bpp YUV planar 1x1 Y, 2x2 UV samples.
31 PP_VIDEOFRAME_FORMAT_I420
= 2,
36 PP_VIDEOFRAME_FORMAT_BGRA
= 3,
41 PP_VIDEOFRAME_FORMAT_LAST
= PP_VIDEOFRAME_FORMAT_BGRA
45 interface PPB_VideoFrame
{
47 * Determines if a resource is a VideoFrame resource.
49 * @param[in] resource The <code>PP_Resource</code> to test.
51 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
52 * resource is a VideoFrame resource or <code>PP_FALSE</code> otherwise.
54 PP_Bool IsVideoFrame
([in] PP_Resource resource
);
57 * Gets the timestamp of the video frame.
59 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
62 * @return A <code>PP_TimeDelta</code> containing the timestamp of the video
63 * frame. Given in seconds since the start of the containing video stream.
66 PP_TimeDelta GetTimestamp
([in] PP_Resource frame
);
69 * Sets the timestamp of the video frame. Given in seconds since the
70 * start of the containing video stream.
72 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
74 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
75 * of the video frame. Given in seconds since the start of the containing
78 void SetTimestamp
([in] PP_Resource frame
, [in] PP_TimeDelta timestamp
);
81 * Gets the format of the video frame.
83 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
86 * @return A <code>PP_VideoFrame_Format</code> containing the format of the
89 [on_failure
=PP_VIDEOFRAME_FORMAT_UNKNOWN
]
90 PP_VideoFrame_Format GetFormat
([in] PP_Resource frame
);
93 * Gets the size of the video frame.
95 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
97 * @param[out] size A <code>PP_Size</code>.
99 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> on success or
100 * <code>PP_FALSE</code> on failure.
102 PP_Bool GetSize
([in] PP_Resource frame
, [out] PP_Size size
);
105 * Gets the data buffer for video frame pixels.
107 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
110 * @return A pointer to the beginning of the data buffer.
112 mem_t GetDataBuffer
([in] PP_Resource frame
);
115 * Gets the size of data buffer.
117 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
120 * @return The size of the data buffer.
122 uint32_t GetDataBufferSize
([in] PP_Resource frame
);