| Index: source/libvpx/vpx/src/vpx_encoder.c
|
| ===================================================================
|
| --- source/libvpx/vpx/src/vpx_encoder.c (revision 291857)
|
| +++ source/libvpx/vpx/src/vpx_encoder.c (working copy)
|
| @@ -20,9 +20,13 @@
|
|
|
| #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_enc_init_ver(vpx_codec_ctx_t *ctx,
|
| vpx_codec_iface_t *iface,
|
| - vpx_codec_enc_cfg_t *cfg,
|
| + const vpx_codec_enc_cfg_t *cfg,
|
| vpx_codec_flags_t flags,
|
| int ver) {
|
| vpx_codec_err_t res;
|
| @@ -216,7 +220,7 @@
|
| FLOATING_POINT_INIT();
|
|
|
| if (num_enc == 1)
|
| - res = ctx->iface->enc.encode(ctx->priv->alg_priv, img, pts,
|
| + res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts,
|
| duration, flags, deadline);
|
| else {
|
| /* Multi-resolution encoding:
|
| @@ -230,7 +234,7 @@
|
| if (img) img += num_enc - 1;
|
|
|
| for (i = num_enc - 1; i >= 0; i--) {
|
| - if ((res = ctx->iface->enc.encode(ctx->priv->alg_priv, img, pts,
|
| + if ((res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts,
|
| duration, flags, deadline)))
|
| break;
|
|
|
| @@ -259,7 +263,7 @@
|
| else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
|
| ctx->err = VPX_CODEC_INCAPABLE;
|
| else
|
| - pkt = ctx->iface->enc.get_cx_data(ctx->priv->alg_priv, iter);
|
| + pkt = ctx->iface->enc.get_cx_data(get_alg_priv(ctx), iter);
|
| }
|
|
|
| if (pkt && pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
|
| @@ -327,7 +331,7 @@
|
| else if (!ctx->iface->enc.get_preview)
|
| ctx->err = VPX_CODEC_INCAPABLE;
|
| else
|
| - img = ctx->iface->enc.get_preview(ctx->priv->alg_priv);
|
| + img = ctx->iface->enc.get_preview(get_alg_priv(ctx));
|
| }
|
|
|
| return img;
|
| @@ -345,7 +349,7 @@
|
| else if (!ctx->iface->enc.get_glob_hdrs)
|
| ctx->err = VPX_CODEC_INCAPABLE;
|
| else
|
| - buf = ctx->iface->enc.get_glob_hdrs(ctx->priv->alg_priv);
|
| + buf = ctx->iface->enc.get_glob_hdrs(get_alg_priv(ctx));
|
| }
|
|
|
| return buf;
|
| @@ -361,7 +365,7 @@
|
| else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER))
|
| res = VPX_CODEC_INCAPABLE;
|
| else
|
| - res = ctx->iface->enc.cfg_set(ctx->priv->alg_priv, cfg);
|
| + res = ctx->iface->enc.cfg_set(get_alg_priv(ctx), cfg);
|
|
|
| return SAVE_STATUS(ctx, res);
|
| }
|
|
|