MFCINST_FINISHED status has following meaning.
Instance has already been opened but can't do anything.
When new format settings come, encoding can be re-started
begin with SEQ_START.
Change-Id: I679f77541942db75db9ba76e936b88668ba25e45
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
MFCINST_RES_CHANGE_INIT,
MFCINST_RES_CHANGE_FLUSH,
MFCINST_RES_CHANGE_END,
- MFCINST_RUNNING_NO_OUTPUT, // Unused
+ MFCINST_FINISHED,
MFCINST_ABORT_INST,
MFCINST_DPB_FLUSHING,
MFCINST_SPECIAL_PARSING,
__mfc_enc_check_format(ctx);
- if (ctx->state == MFCINST_RUNNING) {
+ if (ctx->state == MFCINST_FINISHED) {
mfc_change_state(ctx, MFCINST_GOT_INST);
mfc_info_ctx("[DRC] Enc resolution is changed\n");
}
if ((cr->c.height > ctx->img_height) || (cr->c.top > ctx->img_height) ||
(cr->c.width > ctx->img_width) || (cr->c.left > ctx->img_width) ||
- (cr->c.left <= (ctx->img_width - cr->c.width)) ||
- (cr->c.top <= (ctx->img_height - cr->c.height))) {
+ (cr->c.left >= (ctx->img_width - cr->c.width)) ||
+ (cr->c.top >= (ctx->img_height - cr->c.height))) {
mfc_err_ctx("[FRAME] Out of crop range: (%d,%d,%d,%d) from %dx%d\n",
cr->c.left, cr->c.top, cr->c.width, cr->c.height,
ctx->img_width, ctx->img_height);
struct mfc_ctx *ctx = q->drv_priv;
struct mfc_dev *dev = ctx->dev;
int index = 0;
- int aborted = 0;
int ret = 0;
mfc_info_ctx("enc stop_streaming is called, hwlock : %d, type : %d\n",
mfc_err_ctx("time out during nal abort\n");
mfc_cleanup_work_bit_and_try_run(ctx);
}
- aborted = 1;
}
ret = mfc_get_hwlock_ctx(ctx);
index++;
}
} else if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
- if (ctx->state == MFCINST_RUNNING) {
+ if (ctx->state == MFCINST_RUNNING || ctx->state == MFCINST_FINISHING) {
mfc_change_state(ctx, MFCINST_FINISHING);
mfc_set_bit(ctx->num, &dev->work_bits);
mfc_err_ctx("Waiting for LAST_SEQ timed out\n");
break;
}
- if (ctx->state == MFCINST_RUNNING) {
+ if (ctx->state == MFCINST_FINISHED) {
mfc_debug(2, "all encoded buffers out\n");
break;
}
}
}
- if (aborted || ctx->state == MFCINST_FINISHING)
- mfc_change_state(ctx, MFCINST_RUNNING);
+ if (ctx->state == MFCINST_FINISHING)
+ mfc_change_state(ctx, MFCINST_FINISHED);
mfc_debug(2, "buffer cleanup is done in stop_streaming, type : %d\n", q->type);
/* If the ROI is enabled at SEQ_START, clear ROI_ENABLE bit */
mfc_clear_roi_enable(dev);
- if (!ctx->codec_buffer_allocated) {
+ if (ctx->codec_buffer_allocated) {
mfc_debug(2, "[DRC] previous codec buffer is exist\n");
if (dev->has_mmcache && dev->mmcache.is_on_status)
case MFC_REG_R2H_CMD_COMPLETE_SEQ_RET:
if (ctx->type == MFCINST_ENCODER) {
__mfc_handle_stream(ctx);
- mfc_change_state(ctx, MFCINST_RUNNING);
+ mfc_change_state(ctx, MFCINST_FINISHED);
} else if (ctx->type == MFCINST_DECODER) {
return __mfc_handle_done_frame(ctx, reason, err);
}