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

Side by Side Diff: ppapi/api/ppb_media_stream_video_track.idl

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 /**
7 * Defines the <code>PPB_MediaStreamVideoTrack</code> interface. Used for
8 * receiving video frames from a MediaStream video track in the browser.
9 * This interface is still in development (Dev API status) and may change.
10 */
11 label Chrome {
12 [channel=dev] M33 = 0.1
yzshen1 2013/12/20 23:37:43 M34? :) Time flies.
Peng 2013/12/23 02:41:49 Done.
13 };
14
15 /**
16 */
17 interface PPB_MediaStreamVideoTrack {
18 /**
19 * Determines if a resource is a MediaStream video track resource.
20 *
21 * @param[in] resource The <code>PP_Resource</code> to test.
22 *
23 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
24 * resource is a Mediastream video track resource or <code>PP_FALSE</code>
25 * otherwise.
26 */
27 PP_Bool IsMediaStreamVideoTrack([in] PP_Resource resource);
28
29 /**
30 * Configures underlaying frame buffers for incoming frames.
31 * If the application doesn't want to drop frames, then the
32 * |frame_buffer_size| should be chosen such that inter-frame processing time
33 * variability won't overrun the input buffer. If the buffer is overfilled,
yzshen1 2013/12/20 23:37:43 nit: extra space before 'input'.
Peng 2013/12/23 02:41:49 Done.
34 * then frames will be dropped. The application can detect this by examining
35 * the timestamp on returned frames. If |Configure()| is not used, default
36 * settings will be used.
bbudge 2013/12/20 23:58:13 Could you make it clearer that this is the number
Peng 2013/12/23 02:41:49 Done.
37 *
38 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
39 * resource.
40 * @param[in] frame_buffer_size The maximum number of video frames to hold in
41 * input buffer.
42 *
43 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
44 */
45 int32_t Configure([in] PP_Resource video_track,
46 [in] uint32_t frame_buffer_size);
47
48 /**
49 * Returns the track ID of the underlying MediaStream video track.
50 *
51 * @param[in] video_track The <code>PP_Resource</code> to check.
52 *
53 * @return A <code>PP_Var</code> containing the MediaStream track ID as
54 * a string.
55 */
56 PP_Var GetId([in] PP_Resource video_track);
57
58 /**
59 * Checks whether the underlying MediaStream track has ended.
60 * Calls to GetFrame while the track has ended are safe to make and will
61 * complete, but will fail.
62 *
63 * @param[in] video_track The <code>PP_Resource</code> to check.
64 *
65 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
66 * MediaStream track has ended or <code>PP_FALSE</code> otherwise.
67 */
68 PP_Bool HasEnded([in] PP_Resource video_track);
69
70 /**
71 * Gets the next video frame from the MediaStream track.
72 * If internal processing is slower than the incoming frame rate, new frames
73 * will be dropped from the incoming stream. Once the input buffer is full,
74 * frames will be dropped until |ReuseFrame()| is called to free a spot for
75 * another frame to be buffered. If the caller holds a frame got from previous
yzshen1 2013/12/20 23:37:43 *the* previous call
Peng 2013/12/23 02:41:49 Done.
76 * call of |GetFrame()|, an error will be returned. The caller should recycle
yzshen1 2013/12/20 23:37:43 what error will be returned in this case?
Peng 2013/12/23 02:41:49 Done.
77 * previous frame, before getting next frame.
yzshen1 2013/12/20 23:37:43 *the* previous frame. *the* next frame.
Peng 2013/12/23 02:41:49 Done.
78 *
79 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
80 * resource.
81 * @param[out] frame A <code>PP_Resource</code> corresponding to a VideoFrame
82 * resource.
83 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
84 * completion of GetFrame().
85 *
86 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
87 * Returns PP_ERROR_NOMEMORY if |frame_buffer_size| frames buffer was not
88 * allocated successfully.
89 */
90 int32_t GetFrame([in] PP_Resource video_track,
91 [out] PP_Resource frame,
92 [in] PP_CompletionCallback callback);
93
94 /**
95 * Recycles a frame got from |GetFrame()|, so the track can reuse
bbudge 2013/12/20 23:58:13 s/got/gotten but really 'returned by' might be les
Peng 2013/12/23 02:41:49 Done.
96 * the underlaying buffer of this frame. And the frame will become invalidate.
yzshen1 2013/12/20 23:37:43 invalidate -> invalid
Peng 2013/12/23 02:41:49 Done.
97 * The caller should release all references it holds to |frame|, and not use
98 * it anymore.
99 *
100 * @param[in] video_track A <code>PP_Resource</code> corresponding to a video
101 * resource.
102 * @param[in] video_frame A <code>PP_Resource</code> corresponding to a
yzshen1 2013/12/20 23:37:43 the parameter name is |frame|.
Peng 2013/12/23 02:41:49 Done.
103 * VideoFrame resource got from |GetFrame()|
104 *
105 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
106 * Retruns PP_ERROR_BADARGUMENT if frame isn't a vaild video frame got from
bbudge 2013/12/20 23:58:13 see comment above.
Peng 2013/12/23 02:41:49 Done.
107 * |GetFrame()|.
108 */
109 int32_t ReuseFrame([in] PP_Resource video_track,
110 [in] PP_Resource frame);
111
112 /**
113 * Closes the MediaStream video track, and disconnects it from video source.
114 * And then not new frames will be recevied. After calling |Close()|, the
yzshen1 2013/12/20 23:37:43 not -> no.
Peng 2013/12/23 02:41:49 Done.
115 * video track should not be used anymore.
bbudge 2013/12/20 23:58:13 How about this? * Closes the MediaStream video tr
Peng 2013/12/23 02:41:49 Done.
116 *
117 * @param[in] video_track A <code>PP_Resource</code> corresponding to a
118 * MediaStream video track resource.
119 */
120 void Close([in] PP_Resource video_track);
121 };
122
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698