Index: source/libvpx/vpx/internal/vpx_codec_internal.h |
=================================================================== |
--- source/libvpx/vpx/internal/vpx_codec_internal.h (revision 290053) |
+++ source/libvpx/vpx/internal/vpx_codec_internal.h (working copy) |
@@ -248,38 +248,7 @@ |
vpx_get_frame_buffer_cb_fn_t cb_get, |
vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv); |
-/*\brief eXternal Memory Allocation memory map get iterator |
- * |
- * Iterates over a list of the memory maps requested by the decoder. The |
- * iterator storage should be initialized to NULL to start the iteration. |
- * Iteration is complete when this function returns NULL. |
- * |
- * \param[in out] iter Iterator storage, initialized to NULL |
- * |
- * \return Returns a pointer to an memory segment descriptor, or NULL to |
- * indicate end-of-list. |
- */ |
-typedef vpx_codec_err_t (*vpx_codec_get_mmap_fn_t)(const vpx_codec_ctx_t *ctx, |
- vpx_codec_mmap_t *mmap, |
- vpx_codec_iter_t *iter); |
- |
-/*\brief eXternal Memory Allocation memory map set iterator |
- * |
- * Sets a memory descriptor inside the decoder instance. |
- * |
- * \param[in] ctx Pointer to this instance's context |
- * \param[in] mmap Memory map to store. |
- * |
- * \retval #VPX_CODEC_OK |
- * The memory map was accepted and stored. |
- * \retval #VPX_CODEC_MEM_ERROR |
- * The memory map was rejected. |
- */ |
-typedef vpx_codec_err_t (*vpx_codec_set_mmap_fn_t)(vpx_codec_ctx_t *ctx, |
- const vpx_codec_mmap_t *mmap); |
- |
- |
typedef vpx_codec_err_t (*vpx_codec_encode_fn_t)(vpx_codec_alg_priv_t *ctx, |
const vpx_image_t *img, |
vpx_codec_pts_t pts, |
@@ -330,8 +299,6 @@ |
vpx_codec_init_fn_t init; /**< \copydoc ::vpx_codec_init_fn_t */ |
vpx_codec_destroy_fn_t destroy; /**< \copydoc ::vpx_codec_destroy_fn_t */ |
vpx_codec_ctrl_fn_map_t *ctrl_maps; /**< \copydoc ::vpx_codec_ctrl_fn_map_t */ |
- vpx_codec_get_mmap_fn_t get_mmap; /**< \copydoc ::vpx_codec_get_mmap_fn_t */ |
- vpx_codec_set_mmap_fn_t set_mmap; /**< \copydoc ::vpx_codec_set_mmap_fn_t */ |
struct vpx_codec_dec_iface { |
vpx_codec_peek_si_fn_t peek_si; /**< \copydoc ::vpx_codec_peek_si_fn_t */ |
vpx_codec_get_si_fn_t get_si; /**< \copydoc ::vpx_codec_get_si_fn_t */ |
@@ -340,6 +307,7 @@ |
vpx_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::vpx_codec_set_fb_fn_t */ |
} dec; |
struct vpx_codec_enc_iface { |
+ int cfg_map_count; |
vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */ |
vpx_codec_encode_fn_t encode; /**< \copydoc ::vpx_codec_encode_fn_t */ |
vpx_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::vpx_codec_get_cx_data_fn_t */ |
@@ -401,11 +369,11 @@ |
#undef VPX_CTRL_USE_TYPE |
#define VPX_CTRL_USE_TYPE(id, typ) \ |
- static typ id##__value(va_list args) {return va_arg(args, typ);} \ |
+ static VPX_INLINE typ id##__value(va_list args) {return va_arg(args, typ);} |
#undef VPX_CTRL_USE_TYPE_DEPRECATED |
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \ |
- static typ id##__value(va_list args) {return va_arg(args, typ);} \ |
+ static VPX_INLINE typ id##__value(va_list args) {return va_arg(args, typ);} |
#define CAST(id, arg) id##__value(arg) |
@@ -463,54 +431,11 @@ |
jmp_buf jmp; |
}; |
-static void vpx_internal_error(struct vpx_internal_error_info *info, |
- vpx_codec_err_t error, |
- const char *fmt, |
- ...) { |
- va_list ap; |
+void vpx_internal_error(struct vpx_internal_error_info *info, |
+ vpx_codec_err_t error, |
+ const char *fmt, |
+ ...); |
- info->error_code = error; |
- info->has_detail = 0; |
- |
- if (fmt) { |
- size_t sz = sizeof(info->detail); |
- |
- info->has_detail = 1; |
- va_start(ap, fmt); |
- vsnprintf(info->detail, sz - 1, fmt, ap); |
- va_end(ap); |
- info->detail[sz - 1] = '\0'; |
- } |
- |
- if (info->setjmp) |
- longjmp(info->jmp, info->error_code); |
-} |
- |
-//------------------------------------------------------------------------------ |
-// mmap interface |
- |
-typedef struct { |
- unsigned int id; |
- unsigned long sz; |
- unsigned int align; |
- unsigned int flags; |
- unsigned long (*calc_sz)(const vpx_codec_dec_cfg_t *, vpx_codec_flags_t); |
-} mem_req_t; |
- |
-// Allocates mmap.priv and sets mmap.base based on mmap.sz/align/flags |
-// requirements. |
-// Returns #VPX_CODEC_OK on success, #VPX_CODEC_MEM_ERROR otherwise. |
-vpx_codec_err_t vpx_mmap_alloc(vpx_codec_mmap_t *mmap); |
- |
-// Frees mmap.base allocated by a call to vpx_mmap_alloc(). |
-void vpx_mmap_dtor(vpx_codec_mmap_t *mmap); |
- |
-// Checks each mmap has the size requirement specificied by mem_reqs. |
-// Returns #VPX_CODEC_OK on success, #VPX_CODEC_MEM_ERROR otherwise. |
-vpx_codec_err_t vpx_validate_mmaps(const vpx_codec_stream_info_t *si, |
- const vpx_codec_mmap_t *mmaps, |
- const mem_req_t *mem_reqs, int nreqs, |
- vpx_codec_flags_t init_flags); |
#ifdef __cplusplus |
} // extern "C" |
#endif |