Skip to contentSkip to conversation

media: mtk-vcodec: Always signal source change event on format change

PATCH In review Tomasz Figa 2 participants 2 messages Jan 9, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: mtk-vcodec: Always signal source change event on format change

Currently the driver signals the source change event only in case of a midstream resolution change, however the initial format detection is also defined as a source change by the V4L2 codec API specification. Fix this by signaling the event after the initial header is parsed as well.

---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +2 -0
index 843510979ad8..86f0a7134365 100644
@@ -1224,6 +1224,8 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb)
 	ctx->dpb_size = dpbsize;
 	ctx->state = MTK_STATE_HEADER;
 	mtk_v4l2_debug(1, "[%d] dpbsize=%d", ctx->id, ctx->dpb_size);
+
+	mtk_vdec_queue_res_chg_event(ctx);
 }
 
 static void vb2ops_vdec_buf_finish(struct vb2_buffer *vb)
Signature · 1 line
2.16.0.rc0.223.g4a4ac83678-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Tomasz Figa

Currently the driver signals the source change event only in case of a midstream resolution change, however the initial format detection is also defined as a source change by the V4L2 codec API specification. Fix this by signaling the event after the initial header is parsed as well.

---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +2 -1
index 843510979ad8..86f0a7134365 100644
@@ -1224,6 +1224,8 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb)
        ctx->dpb_size = dpbsize;
        ctx->state = MTK_STATE_HEADER;
        mtk_v4l2_debug(1, "[%d] dpbsize=%d", ctx->id, ctx->dpb_size);
+
+       mtk_vdec_queue_res_chg_event(ctx);
 }
 
 static void vb2ops_vdec_buf_finish(struct vb2_buffer *vb)
--

2.16.0.rc0.223.g4a4ac83678-goog