OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 #ifndef PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/dev/pp_video_dev.h" | 8 #include "ppapi/c/dev/pp_video_dev.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
11 | 11 |
12 #define PPB_VIDEODECODER_DEV_INTERFACE_0_11 "PPB_VideoDecoder(Dev);0.11" | 12 #define PPB_VIDEODECODER_DEV_INTERFACE_0_12 "PPB_VideoDecoder(Dev);0.12" |
13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_11 | 13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_12 |
14 | 14 |
15 // Video decoder interface. | 15 // Video decoder interface. |
16 // | 16 // |
17 // Typical usage: | 17 // Typical usage: |
18 // - Use Create() to get a new PPB_VideoDecoder_Dev resource. | 18 // - Use Create() to get a new PPB_VideoDecoder_Dev resource. |
19 // - Call Initialize() to create the underlying resources in the GPU process and | 19 // - Call Initialize() to create the underlying resources in the GPU process and |
20 // configure the decoder there. | 20 // configure the decoder there. |
21 // - Call Decode() to decode some video data. | 21 // - Call Decode() to decode some video data. |
22 // - Receive ProvidePictureBuffers callback | 22 // - Receive ProvidePictureBuffers callback |
23 // - Supply the decoder with textures using AssignGLESBuffers. | 23 // - Supply the decoder with textures using AssignGLESBuffers. |
24 // - Receive PictureReady callbacks | 24 // - Receive PictureReady callbacks |
25 // - Hand the textures back to the decoder using ReusePictureBuffer. | 25 // - Hand the textures back to the decoder using ReusePictureBuffer. |
26 // - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone | 26 // - To signal EOS to the decoder: call Flush() and wait for NotifyFlushDone |
27 // callback. | 27 // callback. |
28 // - To reset the decoder (e.g. to implement Seek): call Reset() and wait for | 28 // - To reset the decoder (e.g. to implement Seek): call Reset() and wait for |
29 // NotifyResetDone callback. | 29 // NotifyResetDone callback. |
30 // - To tear down the decoder call Destroy() and wait for NotifyDestroyDone. | 30 // - To tear down the decoder call Destroy(). |
31 // | 31 // |
32 // See PPP_VideoDecoder_Dev for the notifications the decoder may send the | 32 // See PPP_VideoDecoder_Dev for the notifications the decoder may send the |
33 // plugin. | 33 // plugin. |
34 struct PPB_VideoDecoder_Dev { | 34 struct PPB_VideoDecoder_Dev { |
35 // Creates a video decoder. Initialize() must be called afterwards to | 35 // Creates a video decoder. Initialize() must be called afterwards to |
36 // set its configuration. | 36 // set its configuration. |
37 // | 37 // |
38 // Parameters: | 38 // Parameters: |
39 // |instance| pointer to the plugin instance. | 39 // |instance| pointer to the plugin instance. |
40 // | 40 // |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Parameters: | 125 // Parameters: |
126 // |video_decoder| is the previously created handle to the decoder resource. | 126 // |video_decoder| is the previously created handle to the decoder resource. |
127 // |callback| is one-time callback that will be called once the reset | 127 // |callback| is one-time callback that will be called once the reset |
128 // request has been completed. | 128 // request has been completed. |
129 // | 129 // |
130 // Returns an error code from pp_errors.h. | 130 // Returns an error code from pp_errors.h. |
131 int32_t (*Reset)(PP_Resource video_decoder, | 131 int32_t (*Reset)(PP_Resource video_decoder, |
132 struct PP_CompletionCallback callback); | 132 struct PP_CompletionCallback callback); |
133 | 133 |
134 // Tear down the decoder as quickly as possible. Pending inputs and outputs | 134 // Tear down the decoder as quickly as possible. Pending inputs and outputs |
135 // are dropped and the decoder frees all of its resources. When |callback| is | 135 // are dropped and the decoder frees all of its resources. Although resources |
136 // called the plugin is guaranteed not to receive any further callbacks and | 136 // may be freed asynchronously, after this method returns no more callbacks |
137 // must make no further calls on |video_decoder|. | 137 // will be made on the client. Any resources held by the client at that point |
| 138 // may be freed. |
138 // | 139 // |
139 // Parameters: | 140 // Parameters: |
140 // |video_decoder| is the previously created handle to the decoder resource. | 141 // |video_decoder| is the previously created handle to the decoder resource. |
141 // |callback| is one-time callback that will be called once the destroy | 142 void (*Destroy)(PP_Resource video_decoder); |
142 // request has been completed. | |
143 // | |
144 // Returns an error code from pp_errors.h. | |
145 int32_t (*Destroy)(PP_Resource video_decoder, | |
146 struct PP_CompletionCallback callback); | |
147 }; | 143 }; |
148 | 144 |
149 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ | 145 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ |
OLD | NEW |