#include <media/v4l2-event.h>
struct buffer {
- struct vb2_buffer vb;
+ struct vb2_v4l2_buffer vb;
struct buffer *next;
};
printk(KERN_ALERT "vdummy: buffer too small\n");
return -EINVAL;
}
- vb2_set_plane_payload(vb, 0, frame_size);
return 0;
}
while(buflist) {
struct buffer *buf = buflist;
buflist = buflist->next;
- vb2_buffer_done(&buf->vb, st);
+ vb2_buffer_done(&buf->vb.vb2_buf, st);
}
buflist = buflist_tail = 0;
spin_unlock(&blist_lock);
spin_unlock(&blist_lock);
if(buf) {
- struct vb2_v4l2_buffer *vvbuf;
+ memcpy(vb2_plane_vaddr(&buf->vb.vb2_buf, 0), frame, frame_size);
- memcpy(vb2_plane_vaddr(&buf->vb, 0), frame, frame_size);
-
- 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);
+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
+ buf->vb.sequence = seqno++;
+ buf->vb.field = V4L2_FIELD_NONE;
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
+ vb2_set_plane_payload(&buf->vb.vb2_buf, 0, frame_size);
}
return 0;