OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
| 3 * |
| 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 |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef VPX_VPX_EXTERNAL_FRAME_BUFFER_H_ |
| 12 #define VPX_VPX_EXTERNAL_FRAME_BUFFER_H_ |
| 13 |
| 14 #ifdef __cplusplus |
| 15 extern "C" { |
| 16 #endif |
| 17 |
| 18 #include "vpx/vpx_integer.h" |
| 19 |
| 20 /*!\brief External frame buffer |
| 21 * |
| 22 * This structure is used to hold external frame buffers passed into the |
| 23 * decoder by the application. |
| 24 */ |
| 25 typedef struct vpx_codec_frame_buffer { |
| 26 uint8_t *data; /**< Pointer to the data buffer */ |
| 27 size_t size; /**< Size of data in bytes */ |
| 28 void *frame_priv; /**< Frame's private data */ |
| 29 } vpx_codec_frame_buffer_t; |
| 30 |
| 31 /*!\brief realloc frame buffer callback prototype |
| 32 * |
| 33 * This callback is invoked by the decoder to notify the application one |
| 34 * of the external frame buffers must increase in size, in order for the |
| 35 * decode call to complete. The callback must allocate at least new_size in |
| 36 * bytes and assign it to fb->data. Then the callback must set fb->size to |
| 37 * the allocated size. The application does not need to align the allocated |
| 38 * data. The callback is usually triggered by a frame size change. On success |
| 39 * the callback must return 0. Any failure the callback must return a value |
| 40 * less than 0. |
| 41 * |
| 42 * \param[in] user_priv User's private data |
| 43 * \param[in] new_size Size in bytes needed by the buffer. |
| 44 * \param[in/out] fb Pointer to frame buffer to increase size. |
| 45 */ |
| 46 typedef int (*vpx_realloc_frame_buffer_cb_fn_t)( |
| 47 void *user_priv, size_t new_size, vpx_codec_frame_buffer_t *fb); |
| 48 |
| 49 #ifdef __cplusplus |
| 50 } // extern "C" |
| 51 #endif |
| 52 |
| 53 #endif // VPX_VPX_EXTERNAL_FRAME_BUFFER_H_ |
OLD | NEW |