Introduce proximity_auth component.
[chromium-blink-merge.git] / ppapi / api / ppb_video_frame.idl
blob57378925aa8c9fc90b0fb227535aebfe9292ffc4
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.
4 */
6 /**
7 * Defines the <code>PPB_VideoFrame</code> interface.
8 */
10 [generate_thunk]
12 label Chrome {
13 [channel=dev] M34 = 0.1,
14 M35 = 0.1
17 enum PP_VideoFrame_Format {
18 /**
19 * Unknown format value.
21 PP_VIDEOFRAME_FORMAT_UNKNOWN = 0,
23 /**
24 * 12bpp YVU planar 1x1 Y, 2x2 VU samples.
26 PP_VIDEOFRAME_FORMAT_YV12 = 1,
28 /**
29 * 12bpp YUV planar 1x1 Y, 2x2 UV samples.
31 PP_VIDEOFRAME_FORMAT_I420 = 2,
33 /**
34 * 32bpp BGRA.
36 PP_VIDEOFRAME_FORMAT_BGRA = 3,
38 /**
39 * The last format.
41 PP_VIDEOFRAME_FORMAT_LAST = PP_VIDEOFRAME_FORMAT_BGRA
44 [version=0.1]
45 interface PPB_VideoFrame {
46 /**
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);
56 /**
57 * Gets the timestamp of the video frame.
59 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
60 * resource.
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.
65 [on_failure=0.0]
66 PP_TimeDelta GetTimestamp([in] PP_Resource frame);
68 /**
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
73 * resource.
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
76 * video stream.
78 void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp);
80 /**
81 * Gets the format of the video frame.
83 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
84 * resource.
86 * @return A <code>PP_VideoFrame_Format</code> containing the format of the
87 * video frame.
89 [on_failure=PP_VIDEOFRAME_FORMAT_UNKNOWN]
90 PP_VideoFrame_Format GetFormat([in] PP_Resource frame);
92 /**
93 * Gets the size of the video frame.
95 * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
96 * resource.
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
108 * resource.
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
118 * resource.
120 * @return The size of the data buffer.
122 uint32_t GetDataBufferSize([in] PP_Resource frame);