Chromium Code Reviews| Index: ppapi/api/ppb_video_frame.idl |
| diff --git a/ppapi/api/ppb_video_frame.idl b/ppapi/api/ppb_video_frame.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..772a1dc8f168ecdff1f04318d392fe3983d53945 |
| --- /dev/null |
| +++ b/ppapi/api/ppb_video_frame.idl |
| @@ -0,0 +1,121 @@ |
| +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/** |
| + * Defines the <code>PPB_VideoFrame</code> interface. |
| + */ |
| +label Chrome { |
| + [channel=dev] M34 = 0.1 |
| +}; |
| + |
| +enum PP_VideoFrame_Format { |
| + /** |
| + * Unknown format value. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_UNKNOWN = 0, |
| + |
| + /** |
| + * 12bpp YVU planar 1x1 Y, 2x2 VU samples. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_YV12 = 1, |
| + |
| + /** |
| + * 16bpp YVU planar 1x1 Y, 2x1 VU samples. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_YV16 = 2, |
| + |
| + /** |
| + * 12bpp YVU planar 1x1 Y, 2x2 VU samples. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_I420 = 3, |
| + |
| + /** |
| + * 20bpp YVU planar 1x1 Y, 2x2 VU, 1x1 A samples. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_YV12A = 4, |
| + |
| + /** |
| + * JPEG color range version of YV12. |
| + */ |
| + PP_VIDEOFRAME_FORMAT_YV12J = 5 |
| +}; |
| + |
| +interface PPB_VideoFrame { |
| + /** |
| + * Determines if a resource is a VideoFrame resource. |
| + * |
| + * @param[in] resource The <code>PP_Resource</code> to test. |
| + * |
| + * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| + * resource is a VideoFrame resource or <code>PP_FALSE</code> otherwise. |
| + */ |
| + PP_Bool IsVideoFrame([in] PP_Resource resource); |
| + |
| + /** |
| + * Gets timestamp of the video frame. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * |
| + * @return A <code>PP_TimeDelta</code> containing timestamp of the video |
| + * frame. Given in seconds since the start of the containing video stream. |
| + */ |
| + PP_TimeDelta GetTimestamp([in] PP_Resource frame); |
| + |
| + /** |
| + * Sets the timestamp of the video frame. Given in seconds since the |
| + * start of the containing video stream. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp |
| + * of the video frame. Given in seconds since the start of the containing |
| + * video stream. |
| + */ |
| + void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp); |
| + |
| + /** |
| + * Gets format of the video frame. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * |
| + * @return A <code>PP_VideoFrame_Format</code> containing the format of the |
| + * video frame. |
| + */ |
| + PP_VideoFrame_Format GetFormat([in] PP_Resource frame); |
| + |
| + /** |
| + * Gets size of the video frame. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * @param[out] size A <code>PP_Size</code> |
|
yzshen1
2013/12/26 17:52:22
nit: Add trailing '.', please.
Peng
2013/12/26 18:33:41
Done.
|
| + * |
| + * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if gets size |
|
yzshen1
2013/12/26 17:52:22
nit: maybe we could consider
"A <code>PP_Bool</cod
Peng
2013/12/26 18:33:41
Done.
|
| + * successfully, otherwise <code>PP_FALSE</code> is returned. |
|
yzshen1
2013/12/26 17:52:22
extra space before 'is'.
Peng
2013/12/26 18:33:41
Done.
|
| + */ |
| + PP_Bool GetSize([in] PP_Resource frame, [out] PP_Size size); |
| + |
| + /** |
| + * Gets data buffer for video frame pixels. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * |
| + * @return A pointer to the beginning of data buffer. |
| + */ |
| + mem_t GetDataBuffer([in] PP_Resource frame); |
| + |
| + /** |
| + * Gets size of data buffer. |
| + * |
| + * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame |
| + * resource. |
| + * |
| + * @return The size of the data buffer. |
| + */ |
| + uint32_t GetDataBufferSize([in] PP_Resource frame); |
| +}; |