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

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 Sun Dec 22 09:16:34 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 * |max_buffered_frames| should be chosen such that inter-frame
49 * processing time variability won't overrun the input buffer. If the buffer
50 * is overfilled, then frames will be dropped. The application can detect
51 * this by examining the timestamp on returned frames. If |Configure()| is not
52 * used, default settings will be used.
53 *
54 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
55 * resource.
56 * @param[in] max_buffered_frames The maximum number of video frames to
57 * hold in 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 max_buffered_frames);
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 |RecycleFrame()| is called to free a spot for
87 * another frame to be buffered. If the caller holds a frame returned by
88 * the previous call of |GetFrame()|, <code>PP_ERROR_INGROGRESS</code> will
89 * be returned. The caller should recycle the previous frame, before getting
90 * the next frame.
91 *
92 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
93 * resource.
94 * @param[out] frame A <code>PP_Resource</code> corresponding to a VideoFrame
95 * resource.
96 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
97 * completion of GetFrame().
98 *
99 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
100 * Returns PP_ERROR_NOMEMORY if |frame_buffer_size| frames buffer was not
101 * allocated successfully.
102 */
103 int32_t (*GetFrame)(PP_Resource video_track,
104 PP_Resource* frame,
105 struct PP_CompletionCallback callback);
106 /**
107 * Recycles a frame returned by |GetFrame()|, so the track can reuse
108 * the underlaying buffer of this frame. And the frame will become invalid.
109 * The caller should release all references it holds to |frame|, and not use
110 * it anymore.
111 *
112 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
113 * resource.
114 * @param[in] frame A <code>PP_Resource</code> corresponding to a VideoFrame
115 * resource returned by |GetFrame()|.
116 *
117 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
118 */
119 int32_t (*RecycleFrame)(PP_Resource video_track, PP_Resource frame);
120 /**
121 * Closes the MediaStream video track, and disconnects it from video source.
122 * After calling |Close()|, no new frames will be received.
123 *
124 * @param[in] video_track A <code>PP_Resource</code> corresponding to a
125 * MediaStream video track resource.
126 *
127 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
128 */
129 int32_t (*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