| 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" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // with valid elements to the buffer pointed by |matching_configs|. No more | 109 // with valid elements to the buffer pointed by |matching_configs|. No more |
| 110 // than |config_size| PP_VideoConfig_Devs will be returned even if more would | 110 // than |config_size| PP_VideoConfig_Devs will be returned even if more would |
| 111 // be available for the decoder device. | 111 // be available for the decoder device. |
| 112 // | 112 // |
| 113 // When this function is called with |matching_configs| = NULL, then no | 113 // When this function is called with |matching_configs| = NULL, then no |
| 114 // configurations are returned, but the total number of PP_VideoConfig_Devs | 114 // configurations are returned, but the total number of PP_VideoConfig_Devs |
| 115 // available will be returned in |num_of_matching_configs|. | 115 // available will be returned in |num_of_matching_configs|. |
| 116 // | 116 // |
| 117 // Returns PP_TRUE on success, PP_FALSE otherwise. | 117 // Returns PP_TRUE on success, PP_FALSE otherwise. |
| 118 PP_Bool (*GetConfigs)(PP_Instance instance, | 118 PP_Bool (*GetConfigs)(PP_Instance instance, |
| 119 PP_VideoConfigElement* proto_config, | 119 const PP_VideoConfigElement* proto_config, |
| 120 PP_VideoConfigElement* matching_configs, | 120 PP_VideoConfigElement* matching_configs, |
| 121 uint32_t matching_configs_size, | 121 uint32_t matching_configs_size, |
| 122 uint32_t* num_of_matching_configs); | 122 uint32_t* num_of_matching_configs); |
| 123 | 123 |
| 124 // Creates a video decoder with requested |decoder_config|. | 124 // Creates a video decoder with requested |decoder_config|. |
| 125 // |input_format| in |decoder_config| specifies the format of input access | 125 // |input_format| in |decoder_config| specifies the format of input access |
| 126 // unit, with PP_VIDEOKEY_CODECID and PP_VIDEOKEY_PAYLOADFORMAT required. | 126 // unit, with PP_VIDEOKEY_CODECID and PP_VIDEOKEY_PAYLOADFORMAT required. |
| 127 // Plugin has the option to specify codec profile/level and other | 127 // Plugin has the option to specify codec profile/level and other |
| 128 // information such as PP_VIDEOKEY_ACCELERATION, to let browser choose | 128 // information such as PP_VIDEOKEY_ACCELERATION, to let browser choose |
| 129 // the most appropriate decoder. | 129 // the most appropriate decoder. |
| 130 // | 130 // |
| 131 // Parameters: | 131 // Parameters: |
| 132 // |instance| pointer to the plugin instance. | 132 // |instance| pointer to the plugin instance. |
| 133 // |dec_config| the configuration which to use to initialize the decoder. | 133 // |dec_config| the configuration which to use to initialize the decoder. |
| 134 // |callback| called after initialize is complete. | 134 // |callback| called after initialize is complete. |
| 135 // | 135 // |
| 136 // The created decoder is returned as PP_Resource. NULL means failure. | 136 // The created decoder is returned as PP_Resource. NULL means failure. |
| 137 PP_Resource (*Create)(PP_Instance instance, | 137 PP_Resource (*Create)(PP_Instance instance, |
| 138 PP_VideoConfigElement* dec_config, | 138 const PP_VideoConfigElement* dec_config, |
| 139 struct PP_CompletionCallback callback); | 139 struct PP_CompletionCallback callback); |
| 140 | 140 |
| 141 // Tests whether |resource| is a video decoder created through Create | 141 // Tests whether |resource| is a video decoder created through Create |
| 142 // function of this interface. | 142 // function of this interface. |
| 143 // | 143 // |
| 144 // Parameters: | 144 // Parameters: |
| 145 // |resource| is handle to resource to test. | 145 // |resource| is handle to resource to test. |
| 146 // | 146 // |
| 147 // Returns true if is a video decoder, false otherwise. | 147 // Returns true if is a video decoder, false otherwise. |
| 148 PP_Bool (*IsVideoDecoder)(PP_Resource resource); | 148 PP_Bool (*IsVideoDecoder)(PP_Resource resource); |
| 149 | 149 |
| 150 // Dispatches bitstream buffer to the decoder. This is asynchronous and | 150 // Dispatches bitstream buffer to the decoder. This is asynchronous and |
| 151 // non-blocking function. | 151 // non-blocking function. |
| 152 // | 152 // |
| 153 // Parameters: | 153 // Parameters: |
| 154 // |video_decoder| is the previously created handle to the decoder instance. | 154 // |video_decoder| is the previously created handle to the decoder instance. |
| 155 // |bitstream_buffer| is the bitstream buffer that contains the input data. | 155 // |bitstream_buffer| is the bitstream buffer that contains the input data. |
| 156 // |callback| will be called when |bitstream_buffer| has been processed by | 156 // |callback| will be called when |bitstream_buffer| has been processed by |
| 157 // the decoder. | 157 // the decoder. |
| 158 // | 158 // |
| 159 // Returns PP_TRUE on decoder successfully accepting buffer, PP_FALSE | 159 // Returns PP_TRUE on decoder successfully accepting buffer, PP_FALSE |
| 160 // otherwise. | 160 // otherwise. |
| 161 PP_Bool (*Decode)(PP_Resource video_decoder, | 161 PP_Bool (*Decode)(PP_Resource video_decoder, |
| 162 struct PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 162 const struct PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 163 struct PP_CompletionCallback callback); | 163 struct PP_CompletionCallback callback); |
| 164 | 164 |
| 165 // Provides the decoder with picture buffers for video decoding. | 165 // Provides the decoder with picture buffers for video decoding. |
| 166 // AssignGLESBuffers provides texture-backed buffers, whereas | 166 // AssignGLESBuffers provides texture-backed buffers, whereas |
| 167 // AssignSysmemBuffers provides system memory-backed buffers. | 167 // AssignSysmemBuffers provides system memory-backed buffers. |
| 168 // | 168 // |
| 169 // This function should be called when decoder has issued the | 169 // This function should be called when decoder has issued the |
| 170 // ProvidePictureBuffers callback to the plugin with buffer requirements. | 170 // ProvidePictureBuffers callback to the plugin with buffer requirements. |
| 171 // | 171 // |
| 172 // It can also be called in advance or outside of ProvidePictureBuffers calls | 172 // It can also be called in advance or outside of ProvidePictureBuffers calls |
| (...skipping 11 matching lines...) Expand all Loading... |
| 184 // callback parameters to ProvidePictureBuffers instead of being part of the | 184 // callback parameters to ProvidePictureBuffers instead of being part of the |
| 185 // PPB API. | 185 // PPB API. |
| 186 // | 186 // |
| 187 // Parameters: | 187 // Parameters: |
| 188 // |video_decoder| is the previously created handle to the decoder instance. | 188 // |video_decoder| is the previously created handle to the decoder instance. |
| 189 // |no_of_buffers| how many buffers are behind picture buffer pointer. | 189 // |no_of_buffers| how many buffers are behind picture buffer pointer. |
| 190 // |buffers| contains the reference to the picture buffer that was | 190 // |buffers| contains the reference to the picture buffer that was |
| 191 // allocated. | 191 // allocated. |
| 192 void (*AssignGLESBuffers)(PP_Resource video_decoder, | 192 void (*AssignGLESBuffers)(PP_Resource video_decoder, |
| 193 uint32_t no_of_buffers, | 193 uint32_t no_of_buffers, |
| 194 struct PP_GLESBuffer_Dev* buffers); | 194 const struct PP_GLESBuffer_Dev* buffers); |
| 195 void (*AssignSysmemBuffers)(PP_Resource video_decoder, | 195 void (*AssignSysmemBuffers)(PP_Resource video_decoder, |
| 196 uint32_t no_of_buffers, | 196 uint32_t no_of_buffers, |
| 197 struct PP_SysmemBuffer_Dev* buffers); | 197 const struct PP_SysmemBuffer_Dev* buffers); |
| 198 | 198 |
| 199 // Tells the decoder to reuse given picture buffer. Typical use of this | 199 // Tells the decoder to reuse given picture buffer. Typical use of this |
| 200 // function is to call from PictureReady callback to recycle picture buffer | 200 // function is to call from PictureReady callback to recycle picture buffer |
| 201 // back to the decoder after blitting the image so that decoder can use the | 201 // back to the decoder after blitting the image so that decoder can use the |
| 202 // image for output again. | 202 // image for output again. |
| 203 // | 203 // |
| 204 // The decoder will ignore any picture buffer not previously provided via | 204 // The decoder will ignore any picture buffer not previously provided via |
| 205 // AssignPictureBuffer. | 205 // AssignPictureBuffer. |
| 206 // | 206 // |
| 207 // TODO(vmr): figure out how the sync will be handled with command buffer as | 207 // TODO(vmr): figure out how the sync will be handled with command buffer as |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // |callback| is one-time callback that will be called once the abortion | 243 // |callback| is one-time callback that will be called once the abortion |
| 244 // request has been completed. | 244 // request has been completed. |
| 245 // | 245 // |
| 246 // Returns PP_TRUE on acceptance of abort request and PP_FALSE if request to | 246 // Returns PP_TRUE on acceptance of abort request and PP_FALSE if request to |
| 247 // abort is rejected by the decoder. | 247 // abort is rejected by the decoder. |
| 248 PP_Bool (*Abort)(PP_Resource video_decoder, | 248 PP_Bool (*Abort)(PP_Resource video_decoder, |
| 249 struct PP_CompletionCallback callback); | 249 struct PP_CompletionCallback callback); |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ | 252 #endif /* PPAPI_C_DEV_PPB_VIDEO_DECODER_DEV_H_ */ |
| OLD | NEW |