};
enum mfc_dec_wait_state {
- WAIT_NONE = 0,
- WAIT_DECODING,
- WAIT_DPB_FLUSH,
+ WAIT_NONE = 0,
+ WAIT_G_FMT = (1 << 0),
+ WAIT_STOP = (1 << 1),
};
/**
ctx->state == MFCINST_RES_CHANGE_FLUSH ||
ctx->state == MFCINST_RES_CHANGE_END) {
/* If there is no source buffer to parsing, we can't SEQ_START */
- if ((ctx->wait_state == WAIT_DECODING) &&
+ if (((ctx->wait_state & WAIT_G_FMT) != 0) &&
mfc_is_queue_count_same(&ctx->buf_queue_lock, &ctx->src_buf_queue, 0)) {
mfc_err_dev("There is no source buffer to parsing, keep previous resolution\n");
return -EAGAIN;
}
}
- if (ctx->wait_state == WAIT_DECODING) {
- ctx->wait_state = WAIT_DPB_FLUSH;
- mfc_debug(2, "wait DPB flush for decoding(INIT_BUFFER)\n");
+ if ((ctx->wait_state & WAIT_G_FMT) != 0) {
+ ctx->wait_state &= ~(WAIT_G_FMT);
+ mfc_debug(2, "clear WAIT_G_FMT %d\n", ctx->wait_state);
}
mfc_debug_leave();
index++;
}
- if (ctx->wait_state == WAIT_DPB_FLUSH) {
- ctx->wait_state = WAIT_NONE;
- mfc_debug(2, "Decoding(INIT_BUFFER) can be started now\n");
+ if (ctx->wait_state & WAIT_STOP) {
+ ctx->wait_state &= ~(WAIT_STOP);
+ mfc_debug(2, "clear WAIT_STOP %d\n", ctx->wait_state);
}
}
if (res_change) {
mfc_debug(2, "[DRC] Resolution change set to %d\n", res_change);
mfc_change_state(ctx, MFCINST_RES_CHANGE_INIT);
- ctx->wait_state = WAIT_DECODING;
+ ctx->wait_state = WAIT_G_FMT | WAIT_STOP;
mfc_debug(2, "[DRC] Decoding waiting! : %d\n", ctx->wait_state);
return;
}
ctx->is_dpb_realloc = 1;
mfc_change_state(ctx, MFCINST_HEAD_PARSED);
ctx->capture_state = QUEUE_FREE;
- ctx->wait_state = WAIT_DECODING;
+ ctx->wait_state = WAIT_STOP;
__mfc_handle_frame_all_extracted(ctx);
goto leave_handle_frame;
}
if (res_change) {
mfc_debug(2, "[NALQ][DRC] Resolution change set to %d\n", res_change);
mfc_change_state(ctx, MFCINST_RES_CHANGE_INIT);
- ctx->wait_state = WAIT_DECODING;
+ ctx->wait_state = WAIT_G_FMT | WAIT_STOP;
dev->nal_q_handle->nal_q_exception = 1;
mfc_info_ctx("[NALQ][DRC] nal_q_exception is set (res change)\n");
goto leave_handle_frame;