OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 25 matching lines...) Expand all Loading... |
36 typedef struct vpx_codec_frame_buffer { | 36 typedef struct vpx_codec_frame_buffer { |
37 uint8_t *data; /**< Pointer to the data buffer */ | 37 uint8_t *data; /**< Pointer to the data buffer */ |
38 size_t size; /**< Size of data in bytes */ | 38 size_t size; /**< Size of data in bytes */ |
39 void *priv; /**< Frame's private data */ | 39 void *priv; /**< Frame's private data */ |
40 } vpx_codec_frame_buffer_t; | 40 } vpx_codec_frame_buffer_t; |
41 | 41 |
42 /*!\brief get frame buffer callback prototype | 42 /*!\brief get frame buffer callback prototype |
43 * | 43 * |
44 * This callback is invoked by the decoder to retrieve data for the frame | 44 * This callback is invoked by the decoder to retrieve data for the frame |
45 * buffer in order for the decode call to complete. The callback must | 45 * buffer in order for the decode call to complete. The callback must |
46 * allocate at least min_size in bytes and assign it to fb->data. Then the | 46 * allocate at least min_size in bytes and assign it to fb->data. The callback |
47 * callback must set fb->size to the allocated size. The application does not | 47 * must zero out all the data allocated. Then the callback must set fb->size |
48 * need to align the allocated data. The callback is triggered when the | 48 * to the allocated size. The application does not need to align the allocated |
49 * decoder needs a frame buffer to decode a compressed image into. This | 49 * data. The callback is triggered when the decoder needs a frame buffer to |
50 * function may be called more than once for every call to vpx_codec_decode. | 50 * decode a compressed image into. This function may be called more than once |
51 * The application may set fb->priv to some data which will be passed | 51 * for every call to vpx_codec_decode. The application may set fb->priv to |
52 * back in the ximage and the release function call. |fb| is guaranteed to | 52 * some data which will be passed back in the ximage and the release function |
53 * not be NULL. On success the callback must return 0. Any failure the | 53 * call. |fb| is guaranteed to not be NULL. On success the callback must |
54 * callback must return a value less than 0. | 54 * return 0. Any failure the callback must return a value less than 0. |
55 * | 55 * |
56 * \param[in] priv Callback's private data | 56 * \param[in] priv Callback's private data |
57 * \param[in] new_size Size in bytes needed by the buffer | 57 * \param[in] new_size Size in bytes needed by the buffer |
58 * \param[in,out] fb Pointer to vpx_codec_frame_buffer_t | 58 * \param[in,out] fb Pointer to vpx_codec_frame_buffer_t |
59 */ | 59 */ |
60 typedef int (*vpx_get_frame_buffer_cb_fn_t)( | 60 typedef int (*vpx_get_frame_buffer_cb_fn_t)( |
61 void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb); | 61 void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb); |
62 | 62 |
63 /*!\brief release frame buffer callback prototype | 63 /*!\brief release frame buffer callback prototype |
64 * | 64 * |
65 * This callback is invoked by the decoder when the frame buffer is not | 65 * This callback is invoked by the decoder when the frame buffer is not |
66 * referenced by any other buffers. |fb| is guaranteed to not be NULL. On | 66 * referenced by any other buffers. |fb| is guaranteed to not be NULL. On |
67 * success the callback must return 0. Any failure the callback must return | 67 * success the callback must return 0. Any failure the callback must return |
68 * a value less than 0. | 68 * a value less than 0. |
69 * | 69 * |
70 * \param[in] priv Callback's private data | 70 * \param[in] priv Callback's private data |
71 * \param[in] fb Pointer to vpx_codec_frame_buffer_t | 71 * \param[in] fb Pointer to vpx_codec_frame_buffer_t |
72 */ | 72 */ |
73 typedef int (*vpx_release_frame_buffer_cb_fn_t)( | 73 typedef int (*vpx_release_frame_buffer_cb_fn_t)( |
74 void *priv, vpx_codec_frame_buffer_t *fb); | 74 void *priv, vpx_codec_frame_buffer_t *fb); |
75 | 75 |
76 #ifdef __cplusplus | 76 #ifdef __cplusplus |
77 } // extern "C" | 77 } // extern "C" |
78 #endif | 78 #endif |
79 | 79 |
80 #endif // VPX_VPX_FRAME_BUFFER_H_ | 80 #endif // VPX_VPX_FRAME_BUFFER_H_ |
OLD | NEW |