diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2011-03-11 16:33:44 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-04-19 21:02:00 +0200 |
commit | 89582654ee3d1d76e153212c88daa6aa6c024fec (patch) | |
tree | 48d7d5a1294a15bfb2800cef225f1d38083022b3 /drivers/media/video/s5p-fimc | |
parent | [media] s5p-fimc: Fix bytesperline and plane payload setup (diff) | |
download | linux-89582654ee3d1d76e153212c88daa6aa6c024fec.tar.xz linux-89582654ee3d1d76e153212c88daa6aa6c024fec.zip |
[media] s5p-fimc: Add support for the buffer timestamps and sequence
Add support for buffer timestamps and the sequence number in
the video capture driver.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc')
-rw-r--r-- | drivers/media/video/s5p-fimc/fimc-core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index ef4e3f66eac0..dc91a8511af6 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c @@ -361,10 +361,20 @@ static void fimc_capture_irq_handler(struct fimc_dev *fimc) { struct fimc_vid_cap *cap = &fimc->vid_cap; struct fimc_vid_buffer *v_buf; + struct timeval *tv; + struct timespec ts; if (!list_empty(&cap->active_buf_q) && test_bit(ST_CAPT_RUN, &fimc->state)) { + ktime_get_real_ts(&ts); + v_buf = active_queue_pop(cap); + + tv = &v_buf->vb.v4l2_buf.timestamp; + tv->tv_sec = ts.tv_sec; + tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC; + v_buf->vb.v4l2_buf.sequence = cap->frame_count++; + vb2_buffer_done(&v_buf->vb, VB2_BUF_STATE_DONE); } |