MFCINST_RES_CHANGE_INIT,
MFCINST_RES_CHANGE_FLUSH,
MFCINST_RES_CHANGE_END,
- MFCINST_RUNNING_NO_OUTPUT,
+ MFCINST_RUNNING_NO_OUTPUT, // Unused
MFCINST_ABORT_INST,
MFCINST_DPB_FLUSHING,
MFCINST_SPECIAL_PARSING,
ctrl->value = enc->frame_type;
break;
case V4L2_CID_MPEG_MFC51_VIDEO_CHECK_STATE:
- if (ctx->state == MFCINST_RUNNING_NO_OUTPUT)
- ctrl->value = MFCSTATE_ENC_NO_OUTPUT;
- else
- ctrl->value = MFCSTATE_PROCESSING;
+ ctrl->value = MFCSTATE_PROCESSING;
break;
case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG:
case V4L2_CID_MPEG_MFC51_VIDEO_LUMA_ADDR:
ret = s5p_mfc_run_enc_last_frames(ctx);
break;
case MFCINST_RUNNING:
- case MFCINST_RUNNING_NO_OUTPUT:
if (ctx->otf_handle) {
ret = s5p_mfc_otf_run_enc_frame(ctx);
break;
raw = &ctx->raw_buf;
- if (ctx->state == MFCINST_RUNNING_NO_OUTPUT ||
- ctx->state == MFCINST_RUNNING_BUF_FULL)
- s5p_mfc_change_state(ctx, MFCINST_RUNNING);
-
s5p_mfc_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes);
if (enc_addr[0] == 0) {
mfc_debug(3, "no encoded src\n");
s5p_mfc_change_state(ctx, MFCINST_ABORT_INST);
return 0;
}
+ if (ctx->state == MFCINST_RUNNING_BUF_FULL)
+ s5p_mfc_change_state(ctx, MFCINST_RUNNING);
/* set encoded frame type */
enc->frame_type = slice_type;
break;
}
/* An error has occured */
- if (ctx->state == MFCINST_RUNNING || ctx->state == MFCINST_ABORT ||
- ctx->state == MFCINST_RUNNING_NO_OUTPUT) {
+ if (ctx->state == MFCINST_RUNNING || ctx->state == MFCINST_ABORT) {
if ((s5p_mfc_get_err(err) >= S5P_FIMV_ERR_WARNINGS_START) &&
(s5p_mfc_get_err(err) <= S5P_FIMV_ERR_WARNINGS_END))
mfc_handle_frame(ctx, reason, err);
return 0;
}
/* NAL-Q can be enabled when all ctx are in running state */
- if (temp_ctx->state != MFCINST_RUNNING &&
- temp_ctx->state != MFCINST_RUNNING_NO_OUTPUT) {
+ if (temp_ctx->state != MFCINST_RUNNING) {
mfc_debug(2, "There is a ctx which is not in running state. "
"index: %d, state: %d\n", i, temp_ctx->state);
return 0;
raw = &ctx->raw_buf;
- if (ctx->state == MFCINST_RUNNING_NO_OUTPUT ||
- ctx->state == MFCINST_RUNNING_BUF_FULL)
- ctx->state = MFCINST_RUNNING;
-
mfc_nal_q_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes, pOutStr);
if (enc_addr[0] == 0) {
mfc_debug(3, "NAL Q: no encoded src\n");
mfc_debug(2, "NAL Q: encoded stream size: %d\n", strm_size);
mfc_debug(2, "NAL Q: display order: %d\n", pic_count);
+ /* buffer full handling */
+ if (ctx->state == MFCINST_RUNNING_BUF_FULL)
+ ctx->state = MFCINST_RUNNING;
+
/* set encoded frame type */
enc->frame_type = slice_type;
ctx->sequence++;
src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0)
return 1;
- /* context is ready to encode a frame in case of B frame */
- if (ctx->state == MFCINST_RUNNING_NO_OUTPUT &&
- src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0)
- return 1;
-
/* context is ready to encode a frame for NAL_ABORT command */
if (ctx->state == MFCINST_ABORT_INST &&
src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0)