video: driver: update sizeimage during set ctrl
update input port sizeimage for a decode session during set control of bitsream size overwrite control. Change-Id: I4cb7d6c8d416f187e1ac557d3b423acfdbcb7a60 Signed-off-by: Darshana Patil <darshana@codeaurora.org>
This commit is contained in:
@@ -309,6 +309,7 @@ bool core_lock_check(struct msm_vidc_core *core, const char *function);
|
||||
void inst_lock(struct msm_vidc_inst *inst, const char *function);
|
||||
void inst_unlock(struct msm_vidc_inst *inst, const char *function);
|
||||
bool inst_lock_check(struct msm_vidc_inst *inst, const char *function);
|
||||
int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst);
|
||||
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core);
|
||||
bool msm_vidc_is_super_buffer(struct msm_vidc_inst *inst);
|
||||
|
||||
@@ -743,9 +743,16 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
if (!inst->vb2q[OUTPUT_PORT].streaming) {
|
||||
capability->cap[cap_id].value = ctrl->val;
|
||||
|
||||
if (is_meta_ctrl(ctrl->id))
|
||||
msm_vidc_update_meta_port_settings(inst);
|
||||
|
||||
if (ctrl->id == V4L2_CID_MPEG_VIDC_MIN_BITSTREAM_SIZE_OVERWRITE) {
|
||||
rc = msm_vidc_update_bitstream_buffer_size(inst);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
if (is_meta_ctrl(ctrl->id)) {
|
||||
rc = msm_vidc_update_meta_port_settings(inst);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3298,6 +3298,26 @@ void inst_unlock(struct msm_vidc_inst *inst, const char *function)
|
||||
mutex_unlock(&inst->lock);
|
||||
}
|
||||
|
||||
int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_format *fmt;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
fmt = &inst->fmts[INPUT_PORT];
|
||||
fmt->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||
buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
Reference in New Issue
Block a user