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 * This file defines the <code>PPB_VideoReader</code> struct for a video reader | |
8 * resource. | |
9 */ | |
10 | |
11 label Chrome { | |
12 M28 = 1.0 | |
13 }; | |
14 | |
15 /** | |
16 * The <code>PPB_VideoReader</code> interface contains pointers to several | |
17 * functions for creating video reader resources and using them to consume | |
18 * streams of video frames. | |
19 */ | |
20 interface PPB_VideoReader { | |
21 /** | |
22 * Creates a video reader resource. | |
23 * | |
24 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
25 * of a module. | |
26 * | |
27 * @return A <code>PP_Resource</code> with a nonzero ID on success or zero on | |
28 * failure. Failure means the instance was invalid. | |
29 */ | |
30 PP_Resource Create([in] PP_Instance instance); | |
31 | |
32 /** | |
33 * Determines if a given resource is a video reader. | |
34 * | |
35 * @param[in] resource A <code>PP_Resource</code> corresponding to a resource. | |
36 * | |
37 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | |
38 * resource is a video writer or <code>PP_FALSE</code> otherwise. | |
39 */ | |
40 PP_Bool IsVideoReader([in] PP_Resource resource); | |
41 | |
42 /** | |
43 * Opens a video stream with the given id for reading. | |
44 * | |
45 * @param[in] reader A <code>PP_Resource</code> corresponding to a video | |
46 * reader resource. | |
47 * @param[in] stream_id A <code>PP_Var</code> holding a string uniquely | |
48 * identifying the stream. | |
yzshen1
2013/04/02 19:28:39
It is good to comment how to get this ID.
bbudge
2013/04/02 20:07:34
Done.
| |
49 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
50 * completion of Open(). | |
51 * | |
52 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
53 * Returns PP_ERROR_BADRESOURCE if reader isn't a valid video reader. | |
54 * Returns PP_ERROR_INPROGRESS if the writer has already opened a stream. | |
yzshen1
2013/04/02 19:28:39
writer -> reader?
bbudge
2013/04/02 20:07:34
Done.
| |
55 */ | |
56 int32_t Open([in] PP_Resource reader, | |
57 [in] PP_Var stream_id, | |
58 [in] PP_CompletionCallback callback); | |
59 | |
60 /** | |
61 * Closes the reader's video stream. | |
62 * | |
63 * @param[in] reader A <code>PP_Resource</code> corresponding to a video | |
64 * reader resource. | |
65 * | |
66 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
67 * Returns PP_ERROR_BADRESOURCE if reader isn't a valid video reader. | |
68 * Returns PP_ERROR_FAILED if the reader has not opened a stream. | |
69 */ | |
70 int32_t Close([in] PP_Resource reader); | |
yzshen1
2013/04/02 19:28:39
nit:
(1) So far, all Close() methods (FileIO, URLL
bbudge
2013/04/02 20:07:34
Done.
| |
71 | |
72 /** | |
73 * Gets the next frame of video from the reader's open stream. The image data | |
74 * resource returned in the frame will have its reference count incremented by | |
75 * one and must be managed by the plugin. | |
76 * | |
77 * @param[in] reader A <code>PP_Resource</code> corresponding to a video | |
78 * reader resource. | |
79 * @param[out] frame A <code>PP_VideoFrame</code> to hold a video frame to | |
80 * read from the open stream. | |
81 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
82 * completion of GetNextFrame(). | |
83 * | |
84 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
85 * Returns PP_ERROR_BADRESOURCE if reader isn't a valid video reader. | |
86 * Returns PP_ERROR_FAILED if the writer has not opened a stream or if the | |
87 * video frame has an invalid image data resource. | |
88 */ | |
89 int32_t GetNextFrame([in] PP_Resource reader, | |
90 [out] PP_VideoFrame frame, | |
91 [in] PP_CompletionCallback callback); | |
92 }; | |
93 | |
OLD | NEW |