| 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_12 "PPB_VideoDecoder(Dev);0.12" | 12 #define PPB_VIDEODECODER_DEV_INTERFACE_0_13 "PPB_VideoDecoder(Dev);0.13" |
| 13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_12 | 13 #define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_13 |
| 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 AssignPictureBuffers. |
| 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(). | 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. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // | 83 // |
| 84 // This function should be called when the plugin has its | 84 // This function should be called when the plugin has its |
| 85 // ProvidePictureBuffers method called. The decoder will stall until it has | 85 // ProvidePictureBuffers method called. The decoder will stall until it has |
| 86 // received all the buffers it's asked for. | 86 // received all the buffers it's asked for. |
| 87 // | 87 // |
| 88 // Parameters: | 88 // Parameters: |
| 89 // |video_decoder| is the previously created handle to the decoder resource. | 89 // |video_decoder| is the previously created handle to the decoder resource. |
| 90 // |no_of_buffers| how many buffers are behind picture buffer pointer. | 90 // |no_of_buffers| how many buffers are behind picture buffer pointer. |
| 91 // |buffers| contains the reference to the picture buffer that was | 91 // |buffers| contains the reference to the picture buffer that was |
| 92 // allocated. | 92 // allocated. |
| 93 void (*AssignGLESBuffers)(PP_Resource video_decoder, uint32_t no_of_buffers, | 93 void (*AssignPictureBuffers)( |
| 94 const struct PP_GLESBuffer_Dev* buffers); | 94 PP_Resource video_decoder, uint32_t no_of_buffers, |
| 95 const struct PP_PictureBuffer_Dev* buffers); |
| 95 | 96 |
| 96 // Tells the decoder to reuse the given picture buffer. Typical use of this | 97 // Tells the decoder to reuse the given picture buffer. Typical use of this |
| 97 // function is to call from PictureReady callback to recycle picture buffer | 98 // function is to call from PictureReady callback to recycle picture buffer |
| 98 // back to the decoder after blitting the image so that decoder can use the | 99 // back to the decoder after blitting the image so that decoder can use the |
| 99 // image for output again. | 100 // image for output again. |
| 100 // | 101 // |
| 101 // Parameters: | 102 // Parameters: |
| 102 // |video_decoder| is the previously created handle to the decoder resource. | 103 // |video_decoder| is the previously created handle to the decoder resource. |
| 103 // |picture_buffer_id| contains the id of the picture buffer that was | 104 // |picture_buffer_id| contains the id of the picture buffer that was |
| 104 // processed. | 105 // processed. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // may be freed asynchronously, after this method returns no more callbacks | 137 // may be freed asynchronously, after this method returns no more callbacks |
| 137 // will be made on the client. Any resources held by the client at that point | 138 // will be made on the client. Any resources held by the client at that point |
| 138 // may be freed. | 139 // may be freed. |
| 139 // | 140 // |
| 140 // Parameters: | 141 // Parameters: |
| 141 // |video_decoder| is the previously created handle to the decoder resource. | 142 // |video_decoder| is the previously created handle to the decoder resource. |
| 142 void (*Destroy)(PP_Resource video_decoder); | 143 void (*Destroy)(PP_Resource video_decoder); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ | 146 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ |
| OLD | NEW |