OLD | NEW |
---|---|
(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. | |
dmichael (off chromium)
2013/12/20 17:42:52
What's the plan for pushing frames to a track? Wil
Peng
2013/12/20 18:49:17
For pushing frames, we will have a separate one.
H
Peng
2013/12/27 21:24:14
As I discussed with Yuzhu. I am going to land this
| |
9 * This interface is still in development (Dev API status) and may change. | |
10 */ | |
11 label Chrome { | |
12 M33 = 0.1 | |
yzshen1
2013/12/20 17:52:26
I think we can now use the [channel=dev] tag, beca
Peng
2013/12/20 20:55:31
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); | |
dmichael (off chromium)
2013/12/20 17:42:52
style/consistency nit: please put a space between
Peng
2013/12/20 20:55:31
Done.
| |
28 | |
29 /** | |
30 * Configure underlayer frame buffers for incoming frames. The provided | |
dmichael (off chromium)
2013/12/20 17:42:52
underlayer->underlying?
yzshen1
2013/12/20 17:52:26
- Configure*s*
- underlayer -> underlying?
Peng
2013/12/20 20:55:31
Done.
Peng
2013/12/20 20:55:31
Done.
| |
31 * |frame_buffer_size| is provided in terms of the number of frames to use for | |
yzshen1
2013/12/20 17:52:26
Other methods use @param[in] @return tag, please m
Peng
2013/12/20 20:55:31
Done.
| |
32 * incoming frames. Should not be less than 1. If the application doesn't want | |
33 * to drop frames, then the |frame_buffer_size| should be chosen such that | |
34 * inter-frame processing time variability won't overrun the ring buffer. | |
yzshen1
2013/12/20 17:52:26
Nit: no need to mention 'ring' buffer. That is an
Peng
2013/12/20 20:55:31
Done.
| |
35 * If the buffer is overfilled, then frames will be dropped. The application | |
36 * can detect this by examining the timestamp on returned frames. | |
37 * If |Configure()| is not used, default settings will be used. | |
38 */ | |
39 int32_t Configure([in]PP_Resource resource, [in]uint32_t frame_buffer_size); | |
dmichael (off chromium)
2013/12/20 17:42:52
Here and in methods other than "IsMediaStreamVideo
Peng
2013/12/20 20:55:31
Done.
| |
40 | |
41 /** | |
42 * Returns the track ID of the underlying MediaStream video track. | |
43 * | |
44 * @param[in] resource The <code>PP_Resource</code> to check. | |
45 * | |
46 * @return A <code>PP_Var</code> containing the MediaStream track ID as | |
47 * a string. | |
48 */ | |
49 PP_Var GetId([in]PP_Resource resource); | |
yzshen1
2013/12/20 17:52:26
Except the IsMediaStreamVideoTrack() method, pleas
Peng
2013/12/20 20:55:31
Can I use video_track? media_stream_video_track is
yzshen1
2013/12/20 23:37:43
Sounds good.
| |
50 | |
51 /** | |
52 * Checks whether the underlying MediaStream track has ended. | |
53 * Calls to GetFrame while the track has ended are safe to make and will | |
54 * complete, but will fail. | |
55 * | |
56 * @param[in] resource The <code>PP_Resource</code> to check. | |
57 * | |
58 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | |
59 * MediaStream track has ended or <code>PP_FALSE</code> otherwise. | |
60 */ | |
61 PP_Bool HasEnded([in]PP_Resource resource); | |
62 | |
63 /** | |
64 * Gets the next video frame from the MediaStream track. | |
65 * If internal processing is slower than the incoming frame rate, new frames | |
66 * will be dropped from the incoming stream. Once the input buffer is full, | |
67 * frames will be dropped until |ReuseFrame()| is called to free a spot for | |
68 * another frame to be buffered. | |
yzshen1
2013/12/20 17:52:26
It seems nice to also comment that once the input
Peng
2013/12/20 20:55:31
To make think easy. I plan to return error, if the
yzshen1
2013/12/20 23:37:43
I think you should also comment what would happen
yzshen1
2013/12/26 17:52:21
In case you didn't notice this comment...
| |
69 * | |
70 * @param[in] resource A <code>PP_Resource</code> corresponding to a video | |
71 * resource. | |
72 * @param[out] frame A <code>PP_Resource</code> corresponding to a VideoFrame | |
73 * resource. | |
74 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
75 * completion of GetFrame(). | |
76 * | |
77 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
78 * Returns PP_ERROR_BADRESOURCE if resource isn't a valid video source. | |
dmichael (off chromium)
2013/12/20 17:42:52
(I don't think you need to list PP_ERROR_BADRESOUR
Peng
2013/12/20 20:55:31
Done.
| |
79 * Returns PP_ERROR_NOMEMORY if |frame_buffer_size| frames buffer was not | |
80 * allocated successfully. | |
81 * Returns PP_ERROR_FAILED if the source is not open, or if some other | |
82 * browser error occurs. | |
dmichael (off chromium)
2013/12/20 17:42:52
(Ditto for PP_ERROR_FAILED; these are pretty commo
Peng
2013/12/20 20:55:31
Done.
| |
83 */ | |
84 int32_t GetFrame([in] PP_Resource resource, | |
85 [out] PP_Resource frame, | |
86 [in] PP_CompletionCallback callback); | |
87 | |
88 /** | |
89 * Release a frame got from |GetFrame()|, so the track can reuse it for | |
yzshen1
2013/12/20 17:52:26
Release*s*
Peng
2013/12/20 20:55:31
Changed to Recycles
| |
90 * new frames.Gets the next video frame from the MediaStream track. | |
dmichael (off chromium)
2013/12/20 17:42:52
I don't think you want the last sentence here...
yzshen1
2013/12/20 17:52:26
- One space before "Gets", please.
- Please talk
Peng
2013/12/20 20:55:31
Done.
Peng
2013/12/20 20:55:31
Done.
| |
91 * | |
92 * @param[in] resource A <code>PP_Resource</code> corresponding to a video | |
93 * resource. | |
94 * @param[in] frame A <code>PP_Resource</code> corresponding to a VideoFrame | |
95 * resource got from |GetFrame()| | |
96 * | |
97 * @return An int32_t containing a result code from <code>pp_errors.h</code>. | |
98 * Returns PP_ERROR_BADRESOURCE if resource isn't a valid video source. | |
99 * Retruns PP_ERROR_BADARGUMENT if frame isn't a vaild video frame got from | |
100 * |GetFrame()|. | |
101 * Returns PP_ERROR_FAILED if the source is not open, or if some other | |
102 * browser error occurs. | |
103 */ | |
104 int32_t ReuseFrame([in] PP_Resource resource, | |
dmichael (off chromium)
2013/12/20 17:42:52
I think we might be able to come up with a better
Peng
2013/12/20 20:55:31
Done.
| |
105 [in] PP_Resource frame); | |
106 | |
107 /** | |
108 * Closes the MediaStream video track. | |
yzshen1
2013/12/20 17:52:26
Please talk about whether it is allowed to do Conf
Peng
2013/12/20 20:55:31
Done.
| |
109 * | |
110 * @param[in] source A <code>PP_Resource</code> corresponding to a | |
111 * MediaStream video track resource. | |
112 */ | |
113 void Close([in] PP_Resource source); | |
114 }; | |
115 | |
OLD | NEW |