summaryrefslogtreecommitdiff
path: root/vpx/src/vpx_codec.c
diff options
context:
space:
mode:
authorclang-format <noreply@google.com>2016-07-21 19:58:19 -0700
committerJames Zern <jzern@google.com>2016-07-21 20:49:07 -0700
commite3e9fee41958da6e5e46b53c604fc2b0a3fc3474 (patch)
tree4f2bbd1af7e4943b993e957c706313447cc09097 /vpx/src/vpx_codec.c
parent4b073bc39a39283577c485ed1e56c92cf0eaaa89 (diff)
downloadlibvpx-e3e9fee41958da6e5e46b53c604fc2b0a3fc3474.tar
libvpx-e3e9fee41958da6e5e46b53c604fc2b0a3fc3474.tar.gz
libvpx-e3e9fee41958da6e5e46b53c604fc2b0a3fc3474.tar.bz2
libvpx-e3e9fee41958da6e5e46b53c604fc2b0a3fc3474.zip
vpx/: apply clang-format
Change-Id: I95922a64568bf289863c1564212b6be5beec36df
Diffstat (limited to 'vpx/src/vpx_codec.c')
-rw-r--r--vpx/src/vpx_codec.c65
1 files changed, 20 insertions, 45 deletions
diff --git a/vpx/src/vpx_codec.c b/vpx/src/vpx_codec.c
index 5a495ce81..f222b9e5c 100644
--- a/vpx/src/vpx_codec.c
+++ b/vpx/src/vpx_codec.c
@@ -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);
}