Commit 83a52078 authored by clang-format's avatar clang-format Committed by James Zern
Browse files

vpx/: apply clang-format

Change-Id: I727b41153cc7929a143e5c370623277558b66e80
parent 6c4d83ec
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/*!\file
* \brief Describes the decoder algorithm interface for algorithm
* implementations.
......@@ -61,7 +60,7 @@ extern "C" {
*/
#define VPX_CODEC_INTERNAL_ABI_VERSION (5) /**<\hideinitializer*/
typedef struct vpx_codec_alg_priv vpx_codec_alg_priv_t;
typedef struct vpx_codec_alg_priv vpx_codec_alg_priv_t;
typedef struct vpx_codec_priv_enc_mr_cfg vpx_codec_priv_enc_mr_cfg_t;
/*!\brief init function pointer prototype
......@@ -77,8 +76,8 @@ typedef struct vpx_codec_priv_enc_mr_cfg vpx_codec_priv_enc_mr_cfg_t;
* \retval #VPX_CODEC_MEM_ERROR
* Memory operation failed.
*/
typedef vpx_codec_err_t (*vpx_codec_init_fn_t)(vpx_codec_ctx_t *ctx,
vpx_codec_priv_enc_mr_cfg_t *data);
typedef vpx_codec_err_t (*vpx_codec_init_fn_t)(
vpx_codec_ctx_t *ctx, vpx_codec_priv_enc_mr_cfg_t *data);
/*!\brief destroy function pointer prototype
*
......@@ -112,8 +111,8 @@ typedef vpx_codec_err_t (*vpx_codec_destroy_fn_t)(vpx_codec_alg_priv_t *ctx);
* \retval #VPX_CODEC_OK
* Bitstream is parsable and stream information updated
*/
typedef vpx_codec_err_t (*vpx_codec_peek_si_fn_t)(const uint8_t *data,
unsigned int data_sz,
typedef vpx_codec_err_t (*vpx_codec_peek_si_fn_t)(const uint8_t *data,
unsigned int data_sz,
vpx_codec_stream_info_t *si);
/*!\brief Return information about the current stream.
......@@ -129,7 +128,7 @@ typedef vpx_codec_err_t (*vpx_codec_peek_si_fn_t)(const uint8_t *data,
* \retval #VPX_CODEC_OK
* Bitstream is parsable and stream information updated
*/
typedef vpx_codec_err_t (*vpx_codec_get_si_fn_t)(vpx_codec_alg_priv_t *ctx,
typedef vpx_codec_err_t (*vpx_codec_get_si_fn_t)(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si);
/*!\brief control function pointer prototype
......@@ -193,11 +192,11 @@ typedef const struct vpx_codec_ctrl_fn_map {
* see the descriptions of the other error codes in ::vpx_codec_err_t
* for recoverability capabilities.
*/
typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
const uint8_t *data,
unsigned int data_sz,
void *user_priv,
long deadline);
typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
const uint8_t *data,
unsigned int data_sz,
void *user_priv,
long deadline);
/*!\brief Decoded frames iterator
*
......@@ -206,7 +205,8 @@ typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
* complete when this function returns NULL.
*
* The list of available frames becomes valid upon completion of the
* vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
* vpx_codec_decode call, and remains valid until the next call to
* vpx_codec_decode.
*
* \param[in] ctx Pointer to this instance's context
* \param[in out] iter Iterator storage, initialized to NULL
......@@ -215,7 +215,7 @@ typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
* produced will always be in PTS (presentation time stamp) order.
*/
typedef vpx_image_t *(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter);
vpx_codec_iter_t *iter);
/*!\brief Pass in external frame buffers for the decoder to use.
*
......@@ -244,32 +244,28 @@ typedef vpx_image_t *(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx,
* buffers.
*/
typedef vpx_codec_err_t (*vpx_codec_set_fb_fn_t)(
vpx_codec_alg_priv_t *ctx,
vpx_get_frame_buffer_cb_fn_t cb_get,
vpx_codec_alg_priv_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get,
vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
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,
unsigned long duration,
vpx_enc_frame_flags_t flags,
unsigned long deadline);
typedef const vpx_codec_cx_pkt_t *(*vpx_codec_get_cx_data_fn_t)(
vpx_codec_alg_priv_t *ctx, vpx_codec_iter_t *iter);
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,
unsigned long duration,
vpx_enc_frame_flags_t flags,
unsigned long deadline);
typedef const vpx_codec_cx_pkt_t *(*vpx_codec_get_cx_data_fn_t)(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter);
typedef vpx_codec_err_t
(*vpx_codec_enc_config_set_fn_t)(vpx_codec_alg_priv_t *ctx,
const vpx_codec_enc_cfg_t *cfg);
typedef vpx_fixed_buf_t *
(*vpx_codec_get_global_headers_fn_t)(vpx_codec_alg_priv_t *ctx);
typedef vpx_codec_err_t (*vpx_codec_enc_config_set_fn_t)(
vpx_codec_alg_priv_t *ctx, const vpx_codec_enc_cfg_t *cfg);
typedef vpx_fixed_buf_t *(*vpx_codec_get_global_headers_fn_t)(
vpx_codec_alg_priv_t *ctx);
typedef vpx_image_t *
(*vpx_codec_get_preview_frame_fn_t)(vpx_codec_alg_priv_t *ctx);
typedef vpx_image_t *(*vpx_codec_get_preview_frame_fn_t)(
vpx_codec_alg_priv_t *ctx);
typedef vpx_codec_err_t
(*vpx_codec_enc_mr_get_mem_loc_fn_t)(const vpx_codec_enc_cfg_t *cfg,
void **mem_loc);
typedef vpx_codec_err_t (*vpx_codec_enc_mr_get_mem_loc_fn_t)(
const vpx_codec_enc_cfg_t *cfg, void **mem_loc);
/*!\brief usage configuration mapping
*
......@@ -282,7 +278,7 @@ typedef vpx_codec_err_t
*
*/
typedef const struct vpx_codec_enc_cfg_map {
int usage;
int usage;
vpx_codec_enc_cfg_t cfg;
} vpx_codec_enc_cfg_map_t;
......@@ -291,41 +287,47 @@ typedef const struct vpx_codec_enc_cfg_map {
* All decoders \ref MUST expose a variable of this type.
*/
struct vpx_codec_iface {
const char *name; /**< Identification String */
int abi_version; /**< Implemented ABI version */
vpx_codec_caps_t caps; /**< Decoder capabilities */
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 */
const char *name; /**< Identification String */
int abi_version; /**< Implemented ABI version */
vpx_codec_caps_t caps; /**< Decoder capabilities */
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 */
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 */
vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */
vpx_codec_get_frame_fn_t get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */
vpx_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::vpx_codec_set_fb_fn_t */
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 */
vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */
vpx_codec_get_frame_fn_t
get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */
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 */
vpx_codec_enc_config_set_fn_t cfg_set; /**< \copydoc ::vpx_codec_enc_config_set_fn_t */
vpx_codec_get_global_headers_fn_t get_glob_hdrs; /**< \copydoc ::vpx_codec_get_global_headers_fn_t */
vpx_codec_get_preview_frame_fn_t get_preview; /**< \copydoc ::vpx_codec_get_preview_frame_fn_t */
vpx_codec_enc_mr_get_mem_loc_fn_t mr_get_mem_loc; /**< \copydoc ::vpx_codec_enc_mr_get_mem_loc_fn_t */
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 */
vpx_codec_enc_config_set_fn_t
cfg_set; /**< \copydoc ::vpx_codec_enc_config_set_fn_t */
vpx_codec_get_global_headers_fn_t
get_glob_hdrs; /**< \copydoc ::vpx_codec_get_global_headers_fn_t */
vpx_codec_get_preview_frame_fn_t
get_preview; /**< \copydoc ::vpx_codec_get_preview_frame_fn_t */
vpx_codec_enc_mr_get_mem_loc_fn_t
mr_get_mem_loc; /**< \copydoc ::vpx_codec_enc_mr_get_mem_loc_fn_t */
} enc;
};
/*!\brief Callback function pointer / user data pair storage */
typedef struct vpx_codec_priv_cb_pair {
union {
vpx_codec_put_frame_cb_fn_t put_frame;
vpx_codec_put_slice_cb_fn_t put_slice;
vpx_codec_put_frame_cb_fn_t put_frame;
vpx_codec_put_slice_cb_fn_t put_slice;
} u;
void *user_priv;
void *user_priv;
} vpx_codec_priv_cb_pair_t;
/*!\brief Instance private storage
*
* This structure is allocated by the algorithm's init function. It can be
......@@ -335,39 +337,38 @@ typedef struct vpx_codec_priv_cb_pair {
* and the pointer cast to the proper type.
*/
struct vpx_codec_priv {
const char *err_detail;
vpx_codec_flags_t init_flags;
const char *err_detail;
vpx_codec_flags_t init_flags;
struct {
vpx_codec_priv_cb_pair_t put_frame_cb;
vpx_codec_priv_cb_pair_t put_slice_cb;
vpx_codec_priv_cb_pair_t put_frame_cb;
vpx_codec_priv_cb_pair_t put_slice_cb;
} dec;
struct {
vpx_fixed_buf_t cx_data_dst_buf;
unsigned int cx_data_pad_before;
unsigned int cx_data_pad_after;
vpx_codec_cx_pkt_t cx_data_pkt;
unsigned int total_encoders;
vpx_fixed_buf_t cx_data_dst_buf;
unsigned int cx_data_pad_before;
unsigned int cx_data_pad_after;
vpx_codec_cx_pkt_t cx_data_pkt;
unsigned int total_encoders;
} enc;
};
/*
* Multi-resolution encoding internal configuration
*/
struct vpx_codec_priv_enc_mr_cfg
{
unsigned int mr_total_resolutions;
unsigned int mr_encoder_id;
struct vpx_rational mr_down_sampling_factor;
void* mr_low_res_mode_info;
struct vpx_codec_priv_enc_mr_cfg {
unsigned int mr_total_resolutions;
unsigned int mr_encoder_id;
struct vpx_rational mr_down_sampling_factor;
void *mr_low_res_mode_info;
};
#undef VPX_CTRL_USE_TYPE
#define VPX_CTRL_USE_TYPE(id, typ) \
static VPX_INLINE 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 VPX_INLINE 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)
......@@ -380,10 +381,9 @@ struct vpx_codec_priv_enc_mr_cfg
* the same name as the struct, less the _algo suffix. The CODEC_INTERFACE
* macro is provided to define this getter function automatically.
*/
#define CODEC_INTERFACE(id)\
vpx_codec_iface_t* id(void) { return &id##_algo; }\
vpx_codec_iface_t id##_algo
#define CODEC_INTERFACE(id) \
vpx_codec_iface_t *id(void) { return &id##_algo; } \
vpx_codec_iface_t id##_algo
/* Internal Utility Functions
*
......@@ -391,38 +391,39 @@ struct vpx_codec_priv_enc_mr_cfg
* utilities for manipulating vpx_codec_* data structures.
*/
struct vpx_codec_pkt_list {
unsigned int cnt;
unsigned int max;
unsigned int cnt;
unsigned int max;
struct vpx_codec_cx_pkt pkts[1];
};
#define vpx_codec_pkt_list_decl(n)\
union {struct vpx_codec_pkt_list head;\
struct {struct vpx_codec_pkt_list head;\
struct vpx_codec_cx_pkt pkts[n];} alloc;}
#define vpx_codec_pkt_list_init(m)\
(m)->alloc.head.cnt = 0,\
(m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0])
#define vpx_codec_pkt_list_decl(n) \
union { \
struct vpx_codec_pkt_list head; \
struct { \
struct vpx_codec_pkt_list head; \
struct vpx_codec_cx_pkt pkts[n]; \
} alloc; \
}
int
vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *,
const struct vpx_codec_cx_pkt *);
#define vpx_codec_pkt_list_init(m) \
(m)->alloc.head.cnt = 0, \
(m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0])
const vpx_codec_cx_pkt_t *
vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list,
vpx_codec_iter_t *iter);
int vpx_codec_pkt_list_add(struct vpx_codec_pkt_list *,
const struct vpx_codec_cx_pkt *);
const vpx_codec_cx_pkt_t *vpx_codec_pkt_list_get(
struct vpx_codec_pkt_list *list, vpx_codec_iter_t *iter);
#include <stdio.h>
#include <setjmp.h>
struct vpx_internal_error_info {
vpx_codec_err_t error_code;
int has_detail;
char detail[80];
int setjmp;
jmp_buf jmp;
vpx_codec_err_t error_code;
int has_detail;
char detail[80];
int setjmp;
jmp_buf jmp;
};
#define CLANG_ANALYZER_NORETURN
......@@ -434,8 +435,7 @@ struct vpx_internal_error_info {
#endif
void vpx_internal_error(struct vpx_internal_error_info *info,
vpx_codec_err_t error,
const char *fmt,
vpx_codec_err_t error, const char *fmt,
...) CLANG_ANALYZER_NORETURN;
#ifdef __cplusplus
......
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/*!\file
* \brief Provides the high level interface to wrap decoder algorithms.
*
......@@ -19,67 +18,50 @@
#include "vpx/internal/vpx_codec_internal.h"
#include "vpx_version.h"
#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var)
int vpx_codec_version(void) {
return VERSION_PACKED;
}
const char *vpx_codec_version_str(void) {
return VERSION_STRING_NOSP;
}
#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
int vpx_codec_version(void) { return VERSION_PACKED; }
const char *vpx_codec_version_extra_str(void) {
return VERSION_EXTRA;
}
const char *vpx_codec_version_str(void) { return VERSION_STRING_NOSP; }
const char *vpx_codec_version_extra_str(void) { return VERSION_EXTRA; }
const char *vpx_codec_iface_name(vpx_codec_iface_t *iface) {
return iface ? iface->name : "<invalid interface>";
}
const char *vpx_codec_err_to_string(vpx_codec_err_t err) {
const char *vpx_codec_err_to_string(vpx_codec_err_t err) {
switch (err) {
case VPX_CODEC_OK:
return "Success";
case VPX_CODEC_ERROR:
return "Unspecified internal error";
case VPX_CODEC_MEM_ERROR:
return "Memory allocation error";
case VPX_CODEC_ABI_MISMATCH:
return "ABI version mismatch";
case VPX_CODEC_OK: return "Success";
case VPX_CODEC_ERROR: return "Unspecified internal error";
case VPX_CODEC_MEM_ERROR: return "Memory allocation error";
case VPX_CODEC_ABI_MISMATCH: return "ABI version mismatch";
case VPX_CODEC_INCAPABLE:
return "Codec does not implement requested capability";
case VPX_CODEC_UNSUP_BITSTREAM:
return "Bitstream not supported by this decoder";
case VPX_CODEC_UNSUP_FEATURE:
return "Bitstream required feature not supported by this decoder";
case VPX_CODEC_CORRUPT_FRAME:
return "Corrupt frame detected";
case VPX_CODEC_INVALID_PARAM:
return "Invalid parameter";
case VPX_CODEC_LIST_END:
return "End of iterated list";
case VPX_CODEC_CORRUPT_FRAME: return "Corrupt frame detected";
case VPX_CODEC_INVALID_PARAM: return "Invalid parameter";
case VPX_CODEC_LIST_END: return "End of iterated list";
}
return "Unrecognized error code";
}
const char *vpx_codec_error(vpx_codec_ctx_t *ctx) {
const char *vpx_codec_error(vpx_codec_ctx_t *ctx) {
return (ctx) ? vpx_codec_err_to_string(ctx->err)
: vpx_codec_err_to_string(VPX_CODEC_INVALID_PARAM);
: vpx_codec_err_to_string(VPX_CODEC_INVALID_PARAM);
}
const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx) {
const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx) {
if (ctx && ctx->err)
return ctx->priv ? ctx->priv->err_detail : ctx->err_detail;
return NULL;
}
vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx) {
vpx_codec_err_t res;
......@@ -99,15 +81,11 @@ vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx) {
return SAVE_STATUS(ctx, res);
}
vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface) {
return (iface) ? iface->caps : 0;
}
vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
int ctrl_id,
...) {
vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...) {
vpx_codec_err_t res;
if (!ctx || !ctrl_id)
......@@ -121,7 +99,7 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
for (entry = ctx->iface->ctrl_maps; entry && entry->fn; entry++) {
if (!entry->ctrl_id || entry->ctrl_id == ctrl_id) {
va_list ap;
va_list ap;
va_start(ap, ctrl_id);
res = entry->fn((vpx_codec_alg_priv_t *)ctx->priv, ap);
......@@ -135,16 +113,14 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
}
void vpx_internal_error(struct vpx_internal_error_info *info,
vpx_codec_err_t error,
const char *fmt,
...) {
vpx_codec_err_t error, const char *fmt, ...) {
va_list ap;
info->error_code = error;
info->has_detail = 0;
if (fmt) {
size_t sz = sizeof(info->detail);
size_t sz = sizeof(info->detail);
info->has_detail = 1;
va_start(ap, fmt);
......@@ -153,6 +129,5 @@ void vpx_internal_error(struct vpx_internal_error_info *info,
info->detail[sz - 1] = '\0';
}
if (info->setjmp)
longjmp(info->jmp, info->error_code);
if (info->setjmp) longjmp(info->jmp, info->error_code);
}
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/*!\file
* \brief Provides the high level interface to wrap decoder algorithms.
*
......@@ -16,17 +15,16 @@
#include <string.h>
#include "vpx/internal/vpx_codec_internal.h"
#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var)
#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
static vpx_codec_alg_priv_t *get_alg_priv(vpx_codec_ctx_t *ctx) {
return (vpx_codec_alg_priv_t *)ctx->priv;
}
vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
vpx_codec_iface_t *iface,
vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
vpx_codec_iface_t *iface,
const vpx_codec_dec_cfg_t *cfg,
vpx_codec_flags_t flags,
int ver) {
vpx_codec_flags_t flags, int ver) {
vpx_codec_err_t res;
if (ver != VPX_DECODER_ABI_VERSION)
......@@ -35,7 +33,8 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
res = VPX_CODEC_INVALID_PARAM;
else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
else if ((flags & VPX_CODEC_USE_POSTPROC) && !(iface->caps & VPX_CODEC_CAP_POSTPROC))
else if ((flags & VPX_CODEC_USE_POSTPROC) &&
!(iface->caps & VPX_CODEC_CAP_POSTPROC))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_ERROR_CONCEALMENT) &&
!(iface->caps & VPX_CODEC_CAP_ERROR_CONCEALMENT))
......@@ -63,15 +62,14 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
const uint8_t *data,
unsigned int data_sz,
vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
const uint8_t *data,
unsigned int data_sz,
vpx_codec_stream_info_t *si) {
vpx_codec_err_t res;
if (!iface || !data || !data_sz || !si
|| si->sz < sizeof(vpx_codec_stream_info_t))
if (!iface || !data || !data_sz || !si ||
si->sz < sizeof(vpx_codec_stream_info_t))
res = VPX_CODEC_INVALID_PARAM;
else {
/* Set default/unknown values */
......@@ -84,8 +82,7 @@ vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
return res;
}
vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
vpx_codec_stream_info_t *si) {
vpx_codec_err_t res;
......@@ -104,12 +101,9 @@ vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
const uint8_t *data,
unsigned int data_sz,
void *user_priv,
long deadline) {
vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
unsigned int data_sz, void *user_priv,
long deadline) {
vpx_codec_err_t res;
/* Sanity checks */
......@@ -126,8 +120,7 @@ vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
vpx_codec_iter_t *iter) {
vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter) {
vpx_image_t *img;
if (!ctx || !iter || !ctx->iface || !ctx->priv)
......@@ -138,16 +131,15 @@ vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
return img;
}
vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
vpx_codec_put_frame_cb_fn_t cb,
void *user_priv) {
vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
vpx_codec_put_frame_cb_fn_t cb,
void *user_priv) {
vpx_codec_err_t res;
if (!ctx || !cb)
res = VPX_CODEC_INVALID_PARAM;
else if (!ctx->iface || !ctx->priv
|| !(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME))
else if (!ctx->iface || !ctx->priv ||
!(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME))
res = VPX_CODEC_ERROR;
else {
ctx->priv->dec.put_frame_cb.u.put_frame = cb;
......@@ -158,16 +150,15 @@ vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx
return SAVE_STATUS(ctx, res);
}
vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
vpx_codec_put_slice_cb_fn_t cb,
void *user_priv) {
vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
vpx_codec_put_slice_cb_fn_t cb,
void *user_priv) {
vpx_codec_err_t res;
if (!ctx || !cb)
res = VPX_CODEC_INVALID_PARAM;
else if (!ctx