Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: ppapi/c/ppb_media_stream_video_track.h

Issue 107083004: [PPAPI] API definition for video media stream artifacts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Update Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_media_stream_video_track.idl modified Fri Dec 20 15:21:19 2013. */
7
8 #ifndef PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_
9 #define PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
17
18 #define PPB_MEDIASTREAMVIDEOTRACK_INTERFACE_0_1 \
19 "PPB_MediaStreamVideoTrack;0.1" /* dev */
20 /**
21 * @file
22 * Defines the <code>PPB_MediaStreamVideoTrack</code> interface. Used for
23 * receiving video frames from a MediaStream video track in the browser.
24 * This interface is still in development (Dev API status) and may change.
25 */
26
27
28 /**
29 * @addtogroup Interfaces
30 * @{
31 */
32 /**
33 */
34 struct PPB_MediaStreamVideoTrack_0_1 { /* dev */
35 /**
36 * Determines if a resource is a MediaStream video track resource.
37 *
38 * @param[in] resource The <code>PP_Resource</code> to test.
39 *
40 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
41 * resource is a Mediastream video track resource or <code>PP_FALSE</code>
42 * otherwise.
43 */
44 PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource);
45 /**
46 * Configures underlaying frame buffers for incoming frames.
47 * If the application doesn't want to drop frames, then the
48 * |frame_buffer_size| should be chosen such that inter-frame processing time
49 * variability won't overrun the input buffer. If the buffer is overfilled,
50 * then frames will be dropped. The application can detect this by examining
51 * the timestamp on returned frames. If |Configure()| is not used, default
52 * settings will be used.
53 *
54 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
55 * resource.
56 * @param[in] frame_buffer_size The maximum number of video frames to hold in
57 * input buffer.
58 *
59 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
60 */
61 int32_t (*Configure)(PP_Resource video_track, uint32_t frame_buffer_size);
62 /**
63 * Returns the track ID of the underlying MediaStream video track.
64 *
65 * @param[in] video_track The <code>PP_Resource</code> to check.
66 *
67 * @return A <code>PP_Var</code> containing the MediaStream track ID as
68 * a string.
69 */
70 struct PP_Var (*GetId)(PP_Resource video_track);
71 /**
72 * Checks whether the underlying MediaStream track has ended.
73 * Calls to GetFrame while the track has ended are safe to make and will
74 * complete, but will fail.
75 *
76 * @param[in] video_track The <code>PP_Resource</code> to check.
77 *
78 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
79 * MediaStream track has ended or <code>PP_FALSE</code> otherwise.
80 */
81 PP_Bool (*HasEnded)(PP_Resource video_track);
82 /**
83 * Gets the next video frame from the MediaStream track.
84 * If internal processing is slower than the incoming frame rate, new frames
85 * will be dropped from the incoming stream. Once the input buffer is full,
86 * frames will be dropped until |ReuseFrame()| is called to free a spot for
87 * another frame to be buffered. If the caller holds a frame got from previous
88 * call of |GetFrame()|, an error will be returned. The caller should recycle
89 * previous frame, before getting next frame.
90 *
91 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
92 * resource.
93 * @param[out] frame A <code>PP_Resource</code> corresponding to a VideoFrame
94 * resource.
95 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
96 * completion of GetFrame().
97 *
98 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
99 * Returns PP_ERROR_NOMEMORY if |frame_buffer_size| frames buffer was not
100 * allocated successfully.
101 */
102 int32_t (*GetFrame)(PP_Resource video_track,
103 PP_Resource* frame,
104 struct PP_CompletionCallback callback);
105 /**
106 * Recycles a frame got from |GetFrame()|, so the track can reuse
107 * the underlaying buffer of this frame. And the frame will become invalidate.
108 * The caller should release all references it holds to |frame|, and not use
109 * it anymore.
110 *
111 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
112 * resource.
113 * @param[in] video_frame A <code>PP_Resource</code> corresponding to a
114 * VideoFrame resource got from |GetFrame()|
115 *
116 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
117 * Retruns PP_ERROR_BADARGUMENT if frame isn't a vaild video frame got from
118 * |GetFrame()|.
119 */
120 int32_t (*ReuseFrame)(PP_Resource video_track, PP_Resource frame);
121 /**
122 * Closes the MediaStream video track, and disconnects it from video source.
123 * And then not new frames will be recevied. After calling |Close()|, the
124 * video track should not be used anymore.
125 *
126 * @param[in] video_track A <code>PP_Resource</code> corresponding to a
127 * MediaStream video track resource.
128 */
129 void (*Close)(PP_Resource video_track);
130 };
131 /**
132 * @}
133 */
134
135 #endif /* PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ */
136
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698