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

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 Thu Dec 19 17:32:55 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 "PPB_MediaStreamVideoTrack;0.1"
19 #define PPB_MEDIASTREAMVIDEOTRACK_INTERFACE \
20 PPB_MEDIASTREAMVIDEOTRACK_INTERFACE_0_1
21
22 /**
23 * @file
24 * Defines the <code>PPB_MediaStreamVideoTrack</code> interface. Used for
25 * receiving video frames from a MediaStream video track in the browser.
26 * This interface is still in development (Dev API status) and may change.
27 */
28
29
30 /**
31 * @addtogroup Interfaces
32 * @{
33 */
34 /**
35 */
36 struct PPB_MediaStreamVideoTrack_0_1 {
37 /**
38 * Determines if a resource is a MediaStream video track resource.
39 *
40 * @param[in] resource The <code>PP_Resource</code> to test.
41 *
42 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
43 * resource is a Mediastream video track resource or <code>PP_FALSE</code>
44 * otherwise.
45 */
46 PP_Bool (*IsMediaStreamVideoTrack)(PP_Resource resource);
47 /**
48 * Configure underlayer frame buffers for incoming frames. The provided
49 * |frame_buffer_size| is provided in terms of the number of frames to use for
50 * incoming frames. Should not be less than 1. If the application doesn't want
51 * to drop frames, then the |frame_buffer_size| should be chosen such that
52 * inter-frame processing time variability won't overrun the ring buffer.
53 * If the buffer is overfilled, then frames will be dropped. The application
54 * can detect this by examining the timestamp on returned frames.
55 * If |Configure()| is not used, default settings will be used.
56 */
57 int32_t (*Configure)(PP_Resource resource, uint32_t frame_buffer_size);
58 /**
59 * Returns the track ID of the underlying MediaStream video track.
60 *
61 * @param[in] resource The <code>PP_Resource</code> to check.
62 *
63 * @return A <code>PP_Var</code> containing the MediaStream track ID as
64 * a string.
65 */
66 struct PP_Var (*GetId)(PP_Resource resource);
67 /**
68 * Checks whether the underlying MediaStream track has ended.
69 * Calls to GetFrame while the track has ended are safe to make and will
70 * complete, but will fail.
71 *
72 * @param[in] resource The <code>PP_Resource</code> to check.
73 *
74 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
75 * MediaStream track has ended or <code>PP_FALSE</code> otherwise.
76 */
77 PP_Bool (*HasEnded)(PP_Resource resource);
78 /**
79 * Gets the next video frame from the MediaStream track.
80 * If internal processing is slower than the incoming frame rate, new frames
81 * will be dropped from the incoming stream. Once the input buffer is full,
82 * frames will be dropped until |ReuseFrame()| is called to free a spot for
83 * another frame to be buffered.
84 *
85 * @param[in] resource A <code>PP_Resource</code> corresponding to a video
86 * resource.
87 * @param[out] frame A <code>PP_Resource</code> corresponding to a VideoFrame
88 * resource.
89 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
90 * completion of GetFrame().
91 *
92 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
93 * Returns PP_ERROR_BADRESOURCE if resource isn't a valid video source.
94 * Returns PP_ERROR_NOMEMORY if |frame_buffer_size| frames buffer was not
95 * allocated successfully.
96 * Returns PP_ERROR_FAILED if the source is not open, or if some other
97 * browser error occurs.
98 */
99 int32_t (*GetFrame)(PP_Resource resource,
100 PP_Resource* frame,
101 struct PP_CompletionCallback callback);
102 /**
103 * Release a frame got from |GetFrame()|, so the track can reuse it for
104 * new frames.Gets the next video frame from the MediaStream track.
105 *
106 * @param[in] resource A <code>PP_Resource</code> corresponding to a video
107 * resource.
108 * @param[in] frame A <code>PP_Resource</code> corresponding to a VideoFrame
109 * resource got from |GetFrame()|
110 *
111 * @return An int32_t containing a result code from <code>pp_errors.h</code>.
112 * Returns PP_ERROR_BADRESOURCE if resource isn't a valid video source.
113 * Retruns PP_ERROR_BADARGUMENT if frame isn't a vaild video frame got from
114 * |GetFrame()|.
115 * Returns PP_ERROR_FAILED if the source is not open, or if some other
116 * browser error occurs.
117 */
118 int32_t (*ReuseFrame)(PP_Resource resource, PP_Resource frame);
119 /**
120 * Closes the MediaStream video track.
121 *
122 * @param[in] source A <code>PP_Resource</code> corresponding to a
123 * MediaStream video track resource.
124 */
125 void (*Close)(PP_Resource source);
126 };
127
128 typedef struct PPB_MediaStreamVideoTrack_0_1 PPB_MediaStreamVideoTrack;
129 /**
130 * @}
131 */
132
133 #endif /* PPAPI_C_PPB_MEDIA_STREAM_VIDEO_TRACK_H_ */
134
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698