| 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 #ifndef VPX_DECODER_H | 10 #ifndef VPX_DECODER_H |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * | 23 * |
| 24 * This file describes the interface between an application and a | 24 * This file describes the interface between an application and a |
| 25 * video decoder algorithm. | 25 * video decoder algorithm. |
| 26 * | 26 * |
| 27 */ | 27 */ |
| 28 #ifdef __cplusplus | 28 #ifdef __cplusplus |
| 29 extern "C" { | 29 extern "C" { |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #include "vpx_codec.h" | 32 #include "vpx_codec.h" |
| 33 #include "vpx_external_frame_buffer.h" |
| 33 | 34 |
| 34 /*!\brief Current ABI version number | 35 /*!\brief Current ABI version number |
| 35 * | 36 * |
| 36 * \internal | 37 * \internal |
| 37 * 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 |
| 38 * must be bumped. Examples include, but are not limited to, changing | 39 * must be bumped. Examples include, but are not limited to, changing |
| 39 * types, removing or reassigning enums, adding/removing/rearranging | 40 * types, removing or reassigning enums, adding/removing/rearranging |
| 40 * fields to structures | 41 * fields to structures |
| 41 */ | 42 */ |
| 42 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer
*/ | 43 #define VPX_DECODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer
*/ |
| 43 | 44 |
| 44 /*! \brief Decoder capabilities bitfield | 45 /*! \brief Decoder capabilities bitfield |
| 45 * | 46 * |
| 46 * Each decoder advertises the capabilities it supports as part of its | 47 * Each decoder advertises the capabilities it supports as part of its |
| 47 * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces | 48 * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces |
| 48 * 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. |
| 49 * | 50 * |
| 50 * The available flags are specified by VPX_CODEC_CAP_* defines. | 51 * The available flags are specified by VPX_CODEC_CAP_* defines. |
| 51 */ | 52 */ |
| 52 #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 */ |
| 53 #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 */ |
| 54 #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ | 55 #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ |
| 55 #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 |
| 56 packet loss */ | 57 packet loss */ |
| 57 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames | 58 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames |
| 58 one fragment at a time */ | 59 one fragment at a time */ |
| 59 | 60 |
| 60 /*! \brief Initialization-time Feature Enabling | 61 /*! \brief Initialization-time Feature Enabling |
| 61 * | 62 * |
| 62 * Certain codec features must be known at initialization time, to allow for | 63 * Certain codec features must be known at initialization time, to allow for |
| 63 * proper memory allocation. | 64 * proper memory allocation. |
| 64 * | 65 * |
| 65 * The available flags are specified by VPX_CODEC_USE_* defines. | 66 * The available flags are specified by VPX_CODEC_USE_* defines. |
| 66 */ | 67 */ |
| 67 #define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based | 68 #define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based |
| 68 multi-threading */ | 69 multi-threading */ |
| 70 #define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external |
| 71 frame buffers */ |
| 69 | 72 |
| 70 #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ | 73 #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ |
| 71 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded | 74 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded |
| 72 frames */ | 75 frames */ |
| 73 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be | 76 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be |
| 74 passed to the decoder one | 77 passed to the decoder one |
| 75 fragment at a time */ | 78 fragment at a time */ |
| 76 #define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based | 79 #define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based |
| 77 multi-threading */ | 80 multi-threading */ |
| 78 | 81 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 * Decoder context not initialized, or algorithm not capable of | 322 * Decoder context not initialized, or algorithm not capable of |
| 320 * posting slice completion. | 323 * posting slice completion. |
| 321 */ | 324 */ |
| 322 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *c
tx, | 325 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *c
tx, |
| 323 vpx_codec_put_slice_cb_fn_t c
b, | 326 vpx_codec_put_slice_cb_fn_t c
b, |
| 324 void *u
ser_priv); | 327 void *u
ser_priv); |
| 325 | 328 |
| 326 | 329 |
| 327 /*!@} - end defgroup cap_put_slice*/ | 330 /*!@} - end defgroup cap_put_slice*/ |
| 328 | 331 |
| 332 /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions |
| 333 * |
| 334 * The following section is required to be implemented for all decoders |
| 335 * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. |
| 336 * Calling this function for codecs that don't advertise this capability |
| 337 * will result in an error code being returned, usually VPX_CODEC_ERROR. |
| 338 * |
| 339 * \note |
| 340 * Currently this only works with VP9. |
| 341 * @{ |
| 342 */ |
| 343 |
| 344 /*!\brief Pass in external frame buffers for the decoder to use. |
| 345 * |
| 346 * Registers a given function to be called when the current frame to |
| 347 * decode will be bigger than the external frame buffer size. This |
| 348 * function must be called before the first call to decode or libvpx |
| 349 * will assume the default behavior of allocating frame buffers internally. |
| 350 * Frame buffers with a size of 0 are valid. |
| 351 * |
| 352 * \param[in] ctx Pointer to this instance's context |
| 353 * \param[in] fb_list Pointer to array of frame buffers |
| 354 * \param[in] fb_count Number of elements in frame buffer array |
| 355 * \param[in] cb Pointer to the callback function |
| 356 * \param[in] user_priv User's private data |
| 357 * |
| 358 * \retval #VPX_CODEC_OK |
| 359 * External frame buffers passed into the decoder. |
| 360 * \retval #VPX_CODEC_ERROR |
| 361 * Decoder context not initialized, or algorithm not capable of |
| 362 * using external frame buffers. |
| 363 * |
| 364 * \note |
| 365 * When decoding VP9, the application must pass in at least 8 external |
| 366 * frame buffers, as VP9 can have up to 8 reference frames. |
| 367 */ |
| 368 vpx_codec_err_t vpx_codec_set_frame_buffers( |
| 369 vpx_codec_ctx_t *ctx, |
| 370 vpx_codec_frame_buffer_t *fb_list, int fb_count, |
| 371 vpx_realloc_frame_buffer_cb_fn_t cb, void *user_priv); |
| 372 |
| 373 /*!@} - end defgroup cap_external_frame_buffer */ |
| 374 |
| 329 /*!@} - end defgroup decoder*/ | 375 /*!@} - end defgroup decoder*/ |
| 330 #ifdef __cplusplus | 376 #ifdef __cplusplus |
| 331 } | 377 } |
| 332 #endif | 378 #endif |
| 333 #endif | 379 #endif |
| 334 | 380 |
| OLD | NEW |