diff --git a/device.c b/device.c index aa8042a..73316c2 100644 --- a/device.c +++ b/device.c @@ -468,6 +468,7 @@ static void submit_noinput_buffer(struct vcam_out_buffer *buf, memset(vbuf_ptr, 0xff, rowsize * (rows % 255)); } + buf->vb.sequence = dev->sequence++; buf->vb.vb2_buf.timestamp = ktime_get_ns(); vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); } @@ -648,6 +649,7 @@ static void submit_copy_buffer(struct vcam_out_buffer *out_buf, } } } + out_buf->vb.sequence = dev->sequence++; out_buf->vb.vb2_buf.timestamp = ktime_get_ns(); vb2_buffer_done(&out_buf->vb.vb2_buf, VB2_BUF_STATE_DONE); } diff --git a/device.h b/device.h index 0b3a45c..f65f0f0 100644 --- a/device.h +++ b/device.h @@ -80,6 +80,7 @@ struct vcam_device { /* Submitter thread */ struct task_struct *sub_thr_id; + u32 sequence; /* Format descriptor */ size_t nr_fmts; diff --git a/videobuf.c b/videobuf.c index dd5298a..3b1b24e 100644 --- a/videobuf.c +++ b/videobuf.c @@ -69,6 +69,7 @@ static int vcam_start_streaming(struct vb2_queue *q, unsigned int count) struct vcam_device *dev = q->drv_priv; /* Try to start kernel thread */ + dev->sequence = 0; dev->sub_thr_id = kthread_create(submitter_thread, dev, "vcam_submitter"); if (!dev->sub_thr_id) { pr_err("Failed to create kernel thread\n");