.min = 0,
.step = 1,
.def = 0,
+ },
+ {
+ .id = V4L2_CID_USER_STREAM_INPUT_MODE,
+ .name = "stream input mode",
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .min = 0,
+ .max = NON_FRAME_LVL,
+ .step = 1,
+ .def = 1,
}
};
case V4L2_CID_USER_BS_H_THRESHOLD:
ctx->bs_h_threshold = ctrl->val;
break;
+ case V4L2_CID_USER_STREAM_INPUT_MODE:
+ ctx->stream_input_mode = ctrl->val;
+ break;
default:
vpu_err("%s() Invalid costomer control(%d)\n",
__func__, ctrl->id);
static void fill_stream_buffer_info(struct vpu_ctx *ctx)
{
- pDEC_RPC_HOST_IFACE pSharedInterface = ctx->dev->shared_mem.pSharedInterface;
- pBUFFER_INFO_TYPE buffer_info = &pSharedInterface->StreamBuffInfo[ctx->str_index];
+ pDEC_RPC_HOST_IFACE pSharedInterface;
+ pBUFFER_INFO_TYPE buffer_info;
if (!ctx)
return;
- if (ctx->start_code_bypass) {
- buffer_info->stream_input_mode = NON_FRAME_LVL;
+ pSharedInterface = ctx->dev->shared_mem.pSharedInterface;
+ buffer_info = &pSharedInterface->StreamBuffInfo[ctx->str_index];
+
+ buffer_info->stream_input_mode = ctx->stream_input_mode;
+ if (ctx->stream_input_mode == NON_FRAME_LVL)
buffer_info->stream_buffer_threshold = stream_buffer_threshold;
- } else {
- buffer_info->stream_input_mode = FRAME_LVL;
- }
buffer_info->stream_pic_input_count = ctx->frm_total_num;
}
/*
*frame depth need to be set by user and then the condition works
*/
- if (vpu_frm_depth != INVALID_FRAME_DEPTH) {
+ if (vpu_frm_depth != INVALID_FRAME_DEPTH &&
+ ctx->stream_input_mode == FRAME_LVL) {
if ((getTSManagerPreBufferCnt(ctx->tsm)) >= vpu_frm_depth)
return false;
}
pDEC_RPC_HOST_IFACE pSharedInterface = ctx->dev->shared_mem.pSharedInterface;
pBUFFER_INFO_TYPE buffer_info = &pSharedInterface->StreamBuffInfo[ctx->str_index];
- if (ctx->start_code_bypass)
+ if (ctx->stream_input_mode != FRAME_LVL)
return true;
if (buffer_info->stream_pic_input_count != buffer_info->stream_pic_parsed_count) {
num += scnprintf(buf + num, PAGE_SIZE - num,
"\t%40s:%16d\n", "stream_buffer_threshold",
buffer_info->stream_buffer_threshold);
+ num += scnprintf(buf + num, PAGE_SIZE - num,
+ "\t%40s:%16d\n", "start_code_bypass",
+ ctx->start_code_bypass);
return num;
}
ctx->ctx_released = false;
ctx->b_dis_reorder = false;
ctx->start_code_bypass = false;
+ ctx->stream_input_mode = FRAME_LVL;
ctx->hang_status = false;
ctx->first_dump_data_flag = true;
INIT_LIST_HEAD(&ctx->cmd_q);
#define MAX_TIMEOUT_COUNT 10
#define VPU_REG_BASE 0x40000000
-#define V4L2_MAX_CTRLS 12
+#define V4L2_MAX_CTRLS 16
#define V4L2_PIX_FMT_NV12_10BIT v4l2_fourcc('N', 'T', '1', '2') /* Y/CbCr 4:2:0 for 10bit */
#define INVALID_FRAME_DEPTH -1
#define DECODER_NODE_NUMBER 12 // use /dev/video12 as vpu decoder
#define V4L2_CID_USER_FRAME_FULLRANGE (V4L2_CID_USER_BASE + 0x1107)
#define V4L2_CID_USER_FRAME_VUIPRESENT (V4L2_CID_USER_BASE + 0x1108)
+#define V4L2_CID_USER_STREAM_INPUT_MODE (V4L2_CID_USER_BASE + 0x1109)
+
#define IMX_V4L2_DEC_CMD_START (0x09000000)
#define IMX_V4L2_DEC_CMD_RESET (IMX_V4L2_DEC_CMD_START + 1)
bool eos_stop_added;
bool ctx_released;
bool start_code_bypass;
+ STREAM_INPUT_MODE stream_input_mode;
bool hang_status;
bool fifo_low;
bool frame_decoded;