aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pwc/pwc-uncompress.c
diff options
context:
space:
mode:
authorJunghak Sung <jh1009.sung@samsung.com>2015-09-22 09:30:30 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-10-01 08:04:43 -0400
commit2d7007153f0c9b1dd00c01894df7d26ddc32b79f (patch)
tree8320f9d22f45dd7dcea64088b50ff706bb0082b2 /drivers/media/usb/pwc/pwc-uncompress.c
parentc139990e842d550db2f59bd4f5993bba90f140e0 (diff)
[media] media: videobuf2: Restructure vb2_buffer
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer. Add new member variables - bytesused, length, offset, userptr, fd, data_offset - to struct vb2_plane in order to cover all information of v4l2_plane. struct vb2_plane { <snip> unsigned int bytesused; unsigned int length; union { unsigned int offset; unsigned long userptr; int fd; } m; unsigned int data_offset; } Replace v4l2_buf with new member variables - index, type, memory - which are common fields for buffer management. struct vb2_buffer { <snip> unsigned int index; unsigned int type; unsigned int memory; unsigned int num_planes; struct vb2_plane planes[VIDEO_MAX_PLANES]; <snip> }; v4l2 specific fields - flags, field, timestamp, timecode, sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c struct vb2_v4l2_buffer { struct vb2_buffer vb2_buf; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; }; Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/pwc/pwc-uncompress.c')
-rw-r--r--drivers/media/usb/pwc/pwc-uncompress.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/usb/pwc/pwc-uncompress.c b/drivers/media/usb/pwc/pwc-uncompress.c
index b65903fbcf0d..98c46f93f119 100644
--- a/drivers/media/usb/pwc/pwc-uncompress.c
+++ b/drivers/media/usb/pwc/pwc-uncompress.c
@@ -40,7 +40,7 @@ int pwc_decompress(struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
40 u16 *src; 40 u16 *src;
41 u16 *dsty, *dstu, *dstv; 41 u16 *dsty, *dstu, *dstv;
42 42
43 image = vb2_plane_vaddr(&fbuf->vb, 0); 43 image = vb2_plane_vaddr(&fbuf->vb.vb2_buf, 0);
44 44
45 yuv = fbuf->data + pdev->frame_header_size; /* Skip header */ 45 yuv = fbuf->data + pdev->frame_header_size; /* Skip header */
46 46
@@ -55,12 +55,12 @@ int pwc_decompress(struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
55 * determine this using the type of the webcam */ 55 * determine this using the type of the webcam */
56 memcpy(raw_frame->cmd, pdev->cmd_buf, 4); 56 memcpy(raw_frame->cmd, pdev->cmd_buf, 4);
57 memcpy(raw_frame+1, yuv, pdev->frame_size); 57 memcpy(raw_frame+1, yuv, pdev->frame_size);
58 vb2_set_plane_payload(&fbuf->vb, 0, 58 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0,
59 pdev->frame_size + sizeof(struct pwc_raw_frame)); 59 pdev->frame_size + sizeof(struct pwc_raw_frame));
60 return 0; 60 return 0;
61 } 61 }
62 62
63 vb2_set_plane_payload(&fbuf->vb, 0, 63 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0,
64 pdev->width * pdev->height * 3 / 2); 64 pdev->width * pdev->height * 3 / 2);
65 65
66 if (pdev->vbandlength == 0) { 66 if (pdev->vbandlength == 0) {