Commit eabed931 authored by Michael Olbrich's avatar Michael Olbrich Committed by Mauro Carvalho Chehab

[media] coda: delay coda_fill_bitstream()

coda_fill_bitstream() calls v4l2_m2m_buf_done() which is no longer allowed
before streaming was started.
Delay coda_fill_bitstream() until coda_start_streaming() and explicitly set
'start_streaming_called' before calling coda_fill_bitstream()
Signed-off-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 390503bd
...@@ -1680,6 +1680,7 @@ static void coda_buf_queue(struct vb2_buffer *vb) ...@@ -1680,6 +1680,7 @@ static void coda_buf_queue(struct vb2_buffer *vb)
} }
mutex_lock(&ctx->bitstream_mutex); mutex_lock(&ctx->bitstream_mutex);
v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vb); v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vb);
if (vb2_is_streaming(vb->vb2_queue))
coda_fill_bitstream(ctx); coda_fill_bitstream(ctx);
mutex_unlock(&ctx->bitstream_mutex); mutex_unlock(&ctx->bitstream_mutex);
} else { } else {
...@@ -2270,6 +2271,11 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -2270,6 +2271,11 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
if (q_data_src->fourcc == V4L2_PIX_FMT_H264) { if (q_data_src->fourcc == V4L2_PIX_FMT_H264) {
/* copy the buffers that where queued before streamon */
mutex_lock(&ctx->bitstream_mutex);
coda_fill_bitstream(ctx);
mutex_unlock(&ctx->bitstream_mutex);
if (coda_get_bitstream_payload(ctx) < 512) if (coda_get_bitstream_payload(ctx) < 512)
return -EINVAL; return -EINVAL;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment