| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 #ifdef __cplusplus | 27 #ifdef __cplusplus |
| 28 extern "C" { | 28 extern "C" { |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 #ifndef VPX_DECODER_H | 31 #ifndef VPX_DECODER_H |
| 32 #define VPX_DECODER_H | 32 #define VPX_DECODER_H |
| 33 #include "vpx_codec.h" | 33 #include "vpx_codec.h" |
| 34 | 34 |
| 35 /*!\brief Current ABI version number | 35 /*!\brief Current ABI version number |
| 36 * | 36 * |
| 37 * \internal | 37 * \internal |
| 38 * If this file is altered in any way that changes the ABI, this value | 38 * If this file is altered in any way that changes the ABI, this value |
| 39 * must be bumped. Examples include, but are not limited to, changing | 39 * must be bumped. Examples include, but are not limited to, changing |
| 40 * types, removing or reassigning enums, adding/removing/rearranging | 40 * types, removing or reassigning enums, adding/removing/rearranging |
| 41 * fields to structures | 41 * fields to structures |
| 42 */ | 42 */ |
| 43 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer
*/ | 43 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer
*/ |
| 44 | 44 |
| 45 /*! \brief Decoder capabilities bitfield | 45 /*! \brief Decoder capabilities bitfield |
| 46 * | 46 * |
| 47 * Each decoder advertises the capabilities it supports as part of its | 47 * Each decoder advertises the capabilities it supports as part of its |
| 48 * ::vpx_codec_iface_t interface structure. Capabilities are extra interfac
es | 48 * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces |
| 49 * or functionality, and are not required to be supported by a decoder. | 49 * or functionality, and are not required to be supported by a decoder. |
| 50 * | 50 * |
| 51 * The available flags are specified by VPX_CODEC_CAP_* defines. | 51 * The available flags are specified by VPX_CODEC_CAP_* defines. |
| 52 */ | 52 */ |
| 53 #define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */ | 53 #define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */ |
| 54 #define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */ | 54 #define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */ |
| 55 #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ | 55 #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ |
| 56 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 /**< Can conceal errors due to | 56 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 /**< Can conceal errors due to |
| 57 packet loss */ | 57 packet loss */ |
| 58 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames | 58 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames |
| 59 one fragment at a time */ | 59 one fragment at a time */ |
| 60 | 60 |
| 61 /*! \brief Initialization-time Feature Enabling | 61 /*! \brief Initialization-time Feature Enabling |
| 62 * | 62 * |
| 63 * Certain codec features must be known at initialization time, to allow fo
r | 63 * Certain codec features must be known at initialization time, to allow for |
| 64 * proper memory allocation. | 64 * proper memory allocation. |
| 65 * | 65 * |
| 66 * The available flags are specified by VPX_CODEC_USE_* defines. | 66 * The available flags are specified by VPX_CODEC_USE_* defines. |
| 67 */ | 67 */ |
| 68 #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ | 68 #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ |
| 69 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded | 69 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded |
| 70 frames */ | 70 frames */ |
| 71 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be | 71 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be |
| 72 passed to the decoder one | 72 passed to the decoder one |
| 73 fragment at a time */ | 73 fragment at a time */ |
| 74 | 74 |
| 75 /*!\brief Stream properties | 75 /*!\brief Stream properties |
| 76 * | 76 * |
| 77 * This structure is used to query or set properties of the decoded | 77 * This structure is used to query or set properties of the decoded |
| 78 * stream. Algorithms may extend this structure with data specific | 78 * stream. Algorithms may extend this structure with data specific |
| 79 * to their bitstream by setting the sz member appropriately. | 79 * to their bitstream by setting the sz member appropriately. |
| 80 */ | 80 */ |
| 81 typedef struct vpx_codec_stream_info | 81 typedef struct vpx_codec_stream_info { |
| 82 { | 82 unsigned int sz; /**< Size of this structure */ |
| 83 unsigned int sz; /**< Size of this structure */ | 83 unsigned int w; /**< Width (or 0 for unknown/default) */ |
| 84 unsigned int w; /**< Width (or 0 for unknown/default) */ | 84 unsigned int h; /**< Height (or 0 for unknown/default) */ |
| 85 unsigned int h; /**< Height (or 0 for unknown/default) */ | 85 unsigned int is_kf; /**< Current frame is a keyframe */ |
| 86 unsigned int is_kf; /**< Current frame is a keyframe */ | 86 } vpx_codec_stream_info_t; |
| 87 } vpx_codec_stream_info_t; | 87 |
| 88 | 88 /* REQUIRED FUNCTIONS |
| 89 /* REQUIRED FUNCTIONS | 89 * |
| 90 * | 90 * The following functions are required to be implemented for all decoders. |
| 91 * The following functions are required to be implemented for all decoders. | 91 * They represent the base case functionality expected of all decoders. |
| 92 * They represent the base case functionality expected of all decoders. | 92 */ |
| 93 */ | 93 |
| 94 | 94 |
| 95 | 95 /*!\brief Initialization Configurations |
| 96 /*!\brief Initialization Configurations | 96 * |
| 97 * | 97 * This structure is used to pass init time configuration options to the |
| 98 * This structure is used to pass init time configuration options to the | 98 * decoder. |
| 99 * decoder. | 99 */ |
| 100 */ | 100 typedef struct vpx_codec_dec_cfg { |
| 101 typedef struct vpx_codec_dec_cfg | 101 unsigned int threads; /**< Maximum number of threads to use, default 1 */ |
| 102 { | 102 unsigned int w; /**< Width */ |
| 103 unsigned int threads; /**< Maximum number of threads to use, default 1 *
/ | 103 unsigned int h; /**< Height */ |
| 104 unsigned int w; /**< Width */ | 104 } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */ |
| 105 unsigned int h; /**< Height */ | 105 |
| 106 } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */ | 106 |
| 107 | 107 /*!\brief Initialize a decoder instance |
| 108 | 108 * |
| 109 /*!\brief Initialize a decoder instance | 109 * Initializes a decoder context using the given interface. Applications |
| 110 * | 110 * should call the vpx_codec_dec_init convenience macro instead of this |
| 111 * Initializes a decoder context using the given interface. Applications | 111 * function directly, to ensure that the ABI version number parameter |
| 112 * should call the vpx_codec_dec_init convenience macro instead of this | 112 * is properly initialized. |
| 113 * function directly, to ensure that the ABI version number parameter | 113 * |
| 114 * is properly initialized. | 114 * If the library was configured with --disable-multithread, this call |
| 115 * | 115 * is not thread safe and should be guarded with a lock if being used |
| 116 * If the library was configured with --disable-multithread, this call | 116 * in a multithreaded context. |
| 117 * is not thread safe and should be guarded with a lock if being used | 117 * |
| 118 * in a multithreaded context. | 118 * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags |
| 119 * | 119 * parameter), the storage pointed to by the cfg parameter must be |
| 120 * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags | 120 * kept readable and stable until all memory maps have been set. |
| 121 * parameter), the storage pointed to by the cfg parameter must be | 121 * |
| 122 * kept readable and stable until all memory maps have been set. | 122 * \param[in] ctx Pointer to this instance's context. |
| 123 * | 123 * \param[in] iface Pointer to the algorithm interface to use. |
| 124 * \param[in] ctx Pointer to this instance's context. | 124 * \param[in] cfg Configuration to use, if known. May be NULL. |
| 125 * \param[in] iface Pointer to the algorithm interface to use. | 125 * \param[in] flags Bitfield of VPX_CODEC_USE_* flags |
| 126 * \param[in] cfg Configuration to use, if known. May be NULL. | 126 * \param[in] ver ABI version number. Must be set to |
| 127 * \param[in] flags Bitfield of VPX_CODEC_USE_* flags | 127 * VPX_DECODER_ABI_VERSION |
| 128 * \param[in] ver ABI version number. Must be set to | 128 * \retval #VPX_CODEC_OK |
| 129 * VPX_DECODER_ABI_VERSION | 129 * The decoder algorithm initialized. |
| 130 * \retval #VPX_CODEC_OK | 130 * \retval #VPX_CODEC_MEM_ERROR |
| 131 * The decoder algorithm initialized. | 131 * Memory allocation failed. |
| 132 * \retval #VPX_CODEC_MEM_ERROR | 132 */ |
| 133 * Memory allocation failed. | 133 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, |
| 134 */ | 134 vpx_codec_iface_t *iface, |
| 135 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, | 135 vpx_codec_dec_cfg_t *cfg, |
| 136 vpx_codec_iface_t *iface, | 136 vpx_codec_flags_t flags, |
| 137 vpx_codec_dec_cfg_t *cfg, | 137 int ver); |
| 138 vpx_codec_flags_t flags, | 138 |
| 139 int ver); | 139 /*!\brief Convenience macro for vpx_codec_dec_init_ver() |
| 140 | 140 * |
| 141 /*!\brief Convenience macro for vpx_codec_dec_init_ver() | 141 * Ensures the ABI version parameter is properly set. |
| 142 * | 142 */ |
| 143 * Ensures the ABI version parameter is properly set. | |
| 144 */ | |
| 145 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \ | 143 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \ |
| 146 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) | 144 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) |
| 147 | 145 |
| 148 | 146 |
| 149 /*!\brief Parse stream info from a buffer | 147 /*!\brief Parse stream info from a buffer |
| 150 * | 148 * |
| 151 * Performs high level parsing of the bitstream. Construction of a decoder | 149 * Performs high level parsing of the bitstream. Construction of a decoder |
| 152 * context is not necessary. Can be used to determine if the bitstream is | 150 * context is not necessary. Can be used to determine if the bitstream is |
| 153 * of the proper format, and to extract information from the stream. | 151 * of the proper format, and to extract information from the stream. |
| 154 * | 152 * |
| 155 * \param[in] iface Pointer to the algorithm interface | 153 * \param[in] iface Pointer to the algorithm interface |
| 156 * \param[in] data Pointer to a block of data to parse | 154 * \param[in] data Pointer to a block of data to parse |
| 157 * \param[in] data_sz Size of the data buffer | 155 * \param[in] data_sz Size of the data buffer |
| 158 * \param[in,out] si Pointer to stream info to update. The size member | 156 * \param[in,out] si Pointer to stream info to update. The size member |
| 159 * \ref MUST be properly initialized, but \ref MAY b
e | 157 * \ref MUST be properly initialized, but \ref MAY be |
| 160 * clobbered by the algorithm. This parameter \ref M
AY | 158 * clobbered by the algorithm. This parameter \ref MAY |
| 161 * be NULL. | 159 * be NULL. |
| 162 * | 160 * |
| 163 * \retval #VPX_CODEC_OK | 161 * \retval #VPX_CODEC_OK |
| 164 * Bitstream is parsable and stream information updated | 162 * Bitstream is parsable and stream information updated |
| 165 */ | 163 */ |
| 166 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, | 164 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, |
| 167 const uint8_t *data, | 165 const uint8_t *data, |
| 168 unsigned int data_sz, | 166 unsigned int data_sz, |
| 169 vpx_codec_stream_info_t *si); | 167 vpx_codec_stream_info_t *si); |
| 170 | 168 |
| 171 | 169 |
| 172 /*!\brief Return information about the current stream. | 170 /*!\brief Return information about the current stream. |
| 173 * | 171 * |
| 174 * Returns information about the stream that has been parsed during decoding
. | 172 * Returns information about the stream that has been parsed during decoding. |
| 175 * | 173 * |
| 176 * \param[in] ctx Pointer to this instance's context | 174 * \param[in] ctx Pointer to this instance's context |
| 177 * \param[in,out] si Pointer to stream info to update. The size member | 175 * \param[in,out] si Pointer to stream info to update. The size member |
| 178 * \ref MUST be properly initialized, but \ref MAY b
e | 176 * \ref MUST be properly initialized, but \ref MAY be |
| 179 * clobbered by the algorithm. This parameter \ref M
AY | 177 * clobbered by the algorithm. This parameter \ref MAY |
| 180 * be NULL. | 178 * be NULL. |
| 181 * | 179 * |
| 182 * \retval #VPX_CODEC_OK | 180 * \retval #VPX_CODEC_OK |
| 183 * Bitstream is parsable and stream information updated | 181 * Bitstream is parsable and stream information updated |
| 184 */ | 182 */ |
| 185 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, | 183 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, |
| 186 vpx_codec_stream_info_t *si); | 184 vpx_codec_stream_info_t *si); |
| 187 | 185 |
| 188 | 186 |
| 189 /*!\brief Decode data | 187 /*!\brief Decode data |
| 190 * | 188 * |
| 191 * Processes a buffer of coded data. If the processing results in a new | 189 * Processes a buffer of coded data. If the processing results in a new |
| 192 * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be | 190 * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be |
| 193 * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decod
e | 191 * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode |
| 194 * time stamp) order. Frames produced will always be in PTS (presentation | 192 * time stamp) order. Frames produced will always be in PTS (presentation |
| 195 * time stamp) order. | 193 * time stamp) order. |
| 196 * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, | 194 * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, |
| 197 * data and data_sz can contain a fragment of the encoded frame. Fragment | 195 * data and data_sz can contain a fragment of the encoded frame. Fragment |
| 198 * \#n must contain at least partition \#n, but can also contain subsequent | 196 * \#n must contain at least partition \#n, but can also contain subsequent |
| 199 * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must | 197 * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must |
| 200 * be empty. When no more data is available, this function should be called | 198 * be empty. When no more data is available, this function should be called |
| 201 * with NULL as data and 0 as data_sz. The memory passed to this function | 199 * with NULL as data and 0 as data_sz. The memory passed to this function |
| 202 * must be available until the frame has been decoded. | 200 * must be available until the frame has been decoded. |
| 203 * | 201 * |
| 204 * \param[in] ctx Pointer to this instance's context | 202 * \param[in] ctx Pointer to this instance's context |
| 205 * \param[in] data Pointer to this block of new coded data. If | 203 * \param[in] data Pointer to this block of new coded data. If |
| 206 * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted | 204 * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted |
| 207 * for the previously decoded frame. | 205 * for the previously decoded frame. |
| 208 * \param[in] data_sz Size of the coded data, in bytes. | 206 * \param[in] data_sz Size of the coded data, in bytes. |
| 209 * \param[in] user_priv Application specific data to associate with | 207 * \param[in] user_priv Application specific data to associate with |
| 210 * this frame. | 208 * this frame. |
| 211 * \param[in] deadline Soft deadline the decoder should attempt to meet, | 209 * \param[in] deadline Soft deadline the decoder should attempt to meet, |
| 212 * in us. Set to zero for unlimited. | 210 * in us. Set to zero for unlimited. |
| 213 * | 211 * |
| 214 * \return Returns #VPX_CODEC_OK if the coded data was processed completely | 212 * \return Returns #VPX_CODEC_OK if the coded data was processed completely |
| 215 * and future pictures can be decoded without error. Otherwise, | 213 * and future pictures can be decoded without error. Otherwise, |
| 216 * see the descriptions of the other error codes in ::vpx_codec_err_
t | 214 * see the descriptions of the other error codes in ::vpx_codec_err_t |
| 217 * for recoverability capabilities. | 215 * for recoverability capabilities. |
| 218 */ | 216 */ |
| 219 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, | 217 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, |
| 220 const uint8_t *data, | 218 const uint8_t *data, |
| 221 unsigned int data_sz, | 219 unsigned int data_sz, |
| 222 void *user_priv, | 220 void *user_priv, |
| 223 long deadline); | 221 long deadline); |
| 224 | 222 |
| 225 | 223 |
| 226 /*!\brief Decoded frames iterator | 224 /*!\brief Decoded frames iterator |
| 227 * | 225 * |
| 228 * Iterates over a list of the frames available for display. The iterator | 226 * Iterates over a list of the frames available for display. The iterator |
| 229 * storage should be initialized to NULL to start the iteration. Iteration i
s | 227 * storage should be initialized to NULL to start the iteration. Iteration is |
| 230 * complete when this function returns NULL. | 228 * complete when this function returns NULL. |
| 231 * | 229 * |
| 232 * The list of available frames becomes valid upon completion of the | 230 * The list of available frames becomes valid upon completion of the |
| 233 * vpx_codec_decode call, and remains valid until the next call to vpx_codec
_decode. | 231 * vpx_codec_decode call, and remains valid until the next call to vpx_codec_d
ecode. |
| 234 * | 232 * |
| 235 * \param[in] ctx Pointer to this instance's context | 233 * \param[in] ctx Pointer to this instance's context |
| 236 * \param[in,out] iter Iterator storage, initialized to NULL | 234 * \param[in,out] iter Iterator storage, initialized to NULL |
| 237 * | 235 * |
| 238 * \return Returns a pointer to an image, if one is ready for display. Frame
s | 236 * \return Returns a pointer to an image, if one is ready for display. Frames |
| 239 * produced will always be in PTS (presentation time stamp) order. | 237 * produced will always be in PTS (presentation time stamp) order. |
| 240 */ | 238 */ |
| 241 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, | 239 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, |
| 242 vpx_codec_iter_t *iter); | 240 vpx_codec_iter_t *iter); |
| 243 | 241 |
| 244 | 242 |
| 245 /*!\defgroup cap_put_frame Frame-Based Decoding Functions | 243 /*!\defgroup cap_put_frame Frame-Based Decoding Functions |
| 246 * | 244 * |
| 247 * The following functions are required to be implemented for all decoders | 245 * The following functions are required to be implemented for all decoders |
| 248 * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these func
tions | 246 * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functi
ons |
| 249 * for codecs that don't advertise this capability will result in an error | 247 * for codecs that don't advertise this capability will result in an error |
| 250 * code being returned, usually VPX_CODEC_ERROR | 248 * code being returned, usually VPX_CODEC_ERROR |
| 251 * @{ | 249 * @{ |
| 252 */ | 250 */ |
| 253 | 251 |
| 254 /*!\brief put frame callback prototype | 252 /*!\brief put frame callback prototype |
| 255 * | 253 * |
| 256 * This callback is invoked by the decoder to notify the application of | 254 * This callback is invoked by the decoder to notify the application of |
| 257 * the availability of decoded image data. | 255 * the availability of decoded image data. |
| 258 */ | 256 */ |
| 259 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, | 257 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, |
| 260 const vpx_image_t *img); | 258 const vpx_image_t *img); |
| 261 | 259 |
| 262 | 260 |
| 263 /*!\brief Register for notification of frame completion. | 261 /*!\brief Register for notification of frame completion. |
| 264 * | 262 * |
| 265 * Registers a given function to be called when a decoded frame is | 263 * Registers a given function to be called when a decoded frame is |
| 266 * available. | 264 * available. |
| 267 * | 265 * |
| 268 * \param[in] ctx Pointer to this instance's context | 266 * \param[in] ctx Pointer to this instance's context |
| 269 * \param[in] cb Pointer to the callback function | 267 * \param[in] cb Pointer to the callback function |
| 270 * \param[in] user_priv User's private data | 268 * \param[in] user_priv User's private data |
| 271 * | 269 * |
| 272 * \retval #VPX_CODEC_OK | 270 * \retval #VPX_CODEC_OK |
| 273 * Callback successfully registered. | 271 * Callback successfully registered. |
| 274 * \retval #VPX_CODEC_ERROR | 272 * \retval #VPX_CODEC_ERROR |
| 275 * Decoder context not initialized, or algorithm not capable of | 273 * Decoder context not initialized, or algorithm not capable of |
| 276 * posting slice completion. | 274 * posting slice completion. |
| 277 */ | 275 */ |
| 278 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t
*ctx, | 276 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *c
tx, |
| 279 vpx_codec_put_frame_cb_fn_t cb, | 277 vpx_codec_put_frame_cb_fn_t c
b, |
| 280 void *user_priv); | 278 void *u
ser_priv); |
| 281 | 279 |
| 282 | 280 |
| 283 /*!@} - end defgroup cap_put_frame */ | 281 /*!@} - end defgroup cap_put_frame */ |
| 284 | 282 |
| 285 /*!\defgroup cap_put_slice Slice-Based Decoding Functions | 283 /*!\defgroup cap_put_slice Slice-Based Decoding Functions |
| 286 * | 284 * |
| 287 * The following functions are required to be implemented for all decoders | 285 * The following functions are required to be implemented for all decoders |
| 288 * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these func
tions | 286 * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functi
ons |
| 289 * for codecs that don't advertise this capability will result in an error | 287 * for codecs that don't advertise this capability will result in an error |
| 290 * code being returned, usually VPX_CODEC_ERROR | 288 * code being returned, usually VPX_CODEC_ERROR |
| 291 * @{ | 289 * @{ |
| 292 */ | 290 */ |
| 293 | 291 |
| 294 /*!\brief put slice callback prototype | 292 /*!\brief put slice callback prototype |
| 295 * | 293 * |
| 296 * This callback is invoked by the decoder to notify the application of | 294 * This callback is invoked by the decoder to notify the application of |
| 297 * the availability of partially decoded image data. The | 295 * the availability of partially decoded image data. The |
| 298 */ | 296 */ |
| 299 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, | 297 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, |
| 300 const vpx_image_t *img, | 298 const vpx_image_t *img, |
| 301 const vpx_image_rect_t *valid, | 299 const vpx_image_rect_t *valid, |
| 302 const vpx_image_rect_t *update); | 300 const vpx_image_rect_t *update); |
| 303 | 301 |
| 304 | 302 |
| 305 /*!\brief Register for notification of slice completion. | 303 /*!\brief Register for notification of slice completion. |
| 306 * | 304 * |
| 307 * Registers a given function to be called when a decoded slice is | 305 * Registers a given function to be called when a decoded slice is |
| 308 * available. | 306 * available. |
| 309 * | 307 * |
| 310 * \param[in] ctx Pointer to this instance's context | 308 * \param[in] ctx Pointer to this instance's context |
| 311 * \param[in] cb Pointer to the callback function | 309 * \param[in] cb Pointer to the callback function |
| 312 * \param[in] user_priv User's private data | 310 * \param[in] user_priv User's private data |
| 313 * | 311 * |
| 314 * \retval #VPX_CODEC_OK | 312 * \retval #VPX_CODEC_OK |
| 315 * Callback successfully registered. | 313 * Callback successfully registered. |
| 316 * \retval #VPX_CODEC_ERROR | 314 * \retval #VPX_CODEC_ERROR |
| 317 * Decoder context not initialized, or algorithm not capable of | 315 * Decoder context not initialized, or algorithm not capable of |
| 318 * posting slice completion. | 316 * posting slice completion. |
| 319 */ | 317 */ |
| 320 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t
*ctx, | 318 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *c
tx, |
| 321 vpx_codec_put_slice_cb_fn_t cb, | 319 vpx_codec_put_slice_cb_fn_t c
b, |
| 322 void *user_priv); | 320 void *u
ser_priv); |
| 323 | 321 |
| 324 | 322 |
| 325 /*!@} - end defgroup cap_put_slice*/ | 323 /*!@} - end defgroup cap_put_slice*/ |
| 326 | 324 |
| 327 /*!@} - end defgroup decoder*/ | 325 /*!@} - end defgroup decoder*/ |
| 328 | 326 |
| 329 #endif | 327 #endif |
| 330 | 328 |
| 331 #ifdef __cplusplus | 329 #ifdef __cplusplus |
| 332 } | 330 } |
| 333 #endif | 331 #endif |
| OLD | NEW |