trying to fix this
authorJohn Tsiombikas <nuclear@mutantstargoat.com>
Sun, 14 May 2017 00:36:39 +0000 (03:36 +0300)
committerJohn Tsiombikas <nuclear@mutantstargoat.com>
Sun, 14 May 2017 00:36:39 +0000 (03:36 +0300)
vdummy.c

index fcc68c0..b0caa82 100644 (file)
--- a/vdummy.c
+++ b/vdummy.c
@@ -171,7 +171,7 @@ static void shutdown(void)
 static int ioctl_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
        strcpy(cap->driver, KBUILD_MODNAME);
-       strcpy(cap->card, "dummy v4l2 dev");
+       strcpy(cap->card, "Test V4L2 device");
        strcpy(cap->bus_info, "nobus");
        cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
@@ -363,11 +363,14 @@ static int gen_frame(void)
        spin_unlock(&blist_lock);
 
        if(buf) {
+               struct vb2_v4l2_buffer *vvbuf;
+
                memcpy(vb2_plane_vaddr(&buf->vb, 0), frame, frame_size);
 
-               /*v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp);
-               buf->vb.v4l2_buf.sequence = seqno++;
-               buf->vb.v4l2_buf.field = V4L2_FIELD_NONE;*/
+               vvbuf = to_vb2_v4l2_buffer(&buf->vb);
+               buf->vb.timestamp = ktime_get_ns();
+               vvbuf->sequence = seqno++;
+               vvbuf->field = V4L2_FIELD_NONE;
                vb2_buffer_done(&buf->vb, VB2_BUF_STATE_DONE);
        }