summaryrefslogtreecommitdiff
path: root/vp9/vp9_dx_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/vp9_dx_iface.c')
-rw-r--r--vp9/vp9_dx_iface.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 734ec4658..48110b414 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -38,7 +38,6 @@ struct vpx_codec_alg_priv {
vpx_decrypt_cb decrypt_cb;
void *decrypt_state;
vpx_image_t img;
- int img_avail;
int invert_tile_order;
// External frame buffer info to save for VP9 common.
@@ -48,10 +47,12 @@ struct vpx_codec_alg_priv {
};
static vpx_codec_err_t decoder_init(vpx_codec_ctx_t *ctx,
- vpx_codec_priv_enc_mr_cfg_t *data) {
+ vpx_codec_priv_enc_mr_cfg_t *data) {
// This function only allocates space for the vpx_codec_alg_priv_t
// structure. More memory may be required at the time the stream
// information becomes known.
+ (void)data;
+
if (!ctx->priv) {
vpx_codec_alg_priv_t *alg_priv = vpx_memalign(32, sizeof(*alg_priv));
if (alg_priv == NULL)
@@ -243,14 +244,11 @@ static void init_decoder(vpx_codec_alg_priv_t *ctx) {
static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
const uint8_t **data, unsigned int data_sz,
void *user_priv, int64_t deadline) {
- YV12_BUFFER_CONFIG sd = { 0 };
vp9_ppflags_t flags = {0};
VP9_COMMON *cm = NULL;
(void)deadline;
- ctx->img_avail = 0;
-
// Determine the stream parameters. Note that we rely on peek_si to
// validate that we have a buffer that does not wrap around the top
// of the heap.
@@ -285,13 +283,6 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
set_ppflags(ctx, &flags);
- if (vp9_get_raw_frame(ctx->pbi, &sd, &flags))
- return update_error_state(ctx, &cm->error);
-
- yuvconfig2image(&ctx->img, &sd, user_priv);
- ctx->img.fb_priv = cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer.priv;
- ctx->img_avail = 1;
-
return VPX_CODEC_OK;
}
@@ -420,15 +411,20 @@ static vpx_image_t *decoder_get_frame(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter) {
vpx_image_t *img = NULL;
- if (ctx->img_avail) {
- // iter acts as a flip flop, so an image is only returned on the first
- // call to get_frame.
- if (!(*iter)) {
+ // iter acts as a flip flop, so an image is only returned on the first
+ // call to get_frame.
+ if (*iter == NULL && ctx->pbi != NULL) {
+ YV12_BUFFER_CONFIG sd;
+ vp9_ppflags_t flags = {0, 0, 0};
+
+ if (vp9_get_raw_frame(ctx->pbi, &sd, &flags) == 0) {
+ VP9_COMMON *cm = &ctx->pbi->common;
+ yuvconfig2image(&ctx->img, &sd, NULL);
+ ctx->img.fb_priv = cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer.priv;
img = &ctx->img;
*iter = img;
}
}
- ctx->img_avail = 0;
return img;
}
@@ -631,11 +627,12 @@ CODEC_INTERFACE(vpx_codec_vp9_dx) = {
decoder_set_fb_fn, // vpx_codec_set_fb_fn_t
},
{ // NOLINT
- NOT_IMPLEMENTED,
- NOT_IMPLEMENTED,
- NOT_IMPLEMENTED,
- NOT_IMPLEMENTED,
- NOT_IMPLEMENTED,
- NOT_IMPLEMENTED
+ NOT_IMPLEMENTED, // vpx_codec_enc_cfg_map_t
+ NOT_IMPLEMENTED, // vpx_codec_encode_fn_t
+ NOT_IMPLEMENTED, // vpx_codec_get_cx_data_fn_t
+ NOT_IMPLEMENTED, // vpx_codec_enc_config_set_fn_t
+ NOT_IMPLEMENTED, // vpx_codec_get_global_headers_fn_t
+ NOT_IMPLEMENTED, // vpx_codec_get_preview_frame_fn_t
+ NOT_IMPLEMENTED // vpx_codec_enc_mr_get_mem_loc_fn_t
}
};