summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2023-03-28 18:07:41 -0700
committerJames Zern <jzern@google.com>2023-05-04 22:08:21 -0700
commit8e47341b0ea4bf2a37f968cf260d6dbfd1f0062a (patch)
tree1c57f6b206e73963e42327cd8288a6007735f5c0
parent601a98b1542fa1fb439c715a9e2e8559338d33f8 (diff)
downloadlibvpx-8e47341b0ea4bf2a37f968cf260d6dbfd1f0062a.tar.gz
Have vpx_codec_error take const vpx_codec_ctx_t *
Also have vpx_codec_error_detail take vpx_codec_ctx_t *. Both functions are getter functions that don't modify the codec context. Change-Id: I4689022425efbf7b1da5034255ac052fce5e5b4f
-rw-r--r--vpx/src/vpx_codec.c6
-rw-r--r--vpx/vpx_codec.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/vpx/src/vpx_codec.c b/vpx/src/vpx_codec.c
index 114b94e19..24528d860 100644
--- a/vpx/src/vpx_codec.c
+++ b/vpx/src/vpx_codec.c
@@ -50,12 +50,12 @@ const char *vpx_codec_err_to_string(vpx_codec_err_t err) {
return "Unrecognized error code";
}
-const char *vpx_codec_error(vpx_codec_ctx_t *ctx) {
+const char *vpx_codec_error(const vpx_codec_ctx_t *ctx) {
return (ctx) ? vpx_codec_err_to_string(ctx->err)
: 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(const vpx_codec_ctx_t *ctx) {
if (ctx && ctx->err)
return ctx->priv ? ctx->priv->err_detail : ctx->err_detail;
@@ -82,7 +82,7 @@ vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx) {
}
vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface) {
- return (iface) ? iface->caps : 0;
+ return iface ? iface->caps : 0;
}
vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...) {
diff --git a/vpx/vpx_codec.h b/vpx/vpx_codec.h
index 11bf8aaa2..ca18d90cb 100644
--- a/vpx/vpx_codec.h
+++ b/vpx/vpx_codec.h
@@ -318,7 +318,7 @@ const char *vpx_codec_err_to_string(vpx_codec_err_t err);
* \param[in] ctx Pointer to this instance's context.
*
*/
-const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
+const char *vpx_codec_error(const vpx_codec_ctx_t *ctx);
/*!\brief Retrieve detailed error information for codec context
*
@@ -330,7 +330,7 @@ const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
* \retval NULL
* No detailed information is available.
*/
-const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
+const char *vpx_codec_error_detail(const vpx_codec_ctx_t *ctx);
/* REQUIRED FUNCTIONS
*