Junghak Sung | c139990 | 2015-09-22 10:30:29 -0300 | [diff] [blame] | 1 | /* |
| 2 | * videobuf2-v4l2.h - V4L2 driver helper framework |
| 3 | * |
| 4 | * Copyright (C) 2010 Samsung Electronics |
| 5 | * |
| 6 | * Author: Pawel Osciak <pawel@osciak.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation. |
| 11 | */ |
| 12 | #ifndef _MEDIA_VIDEOBUF2_V4L2_H |
| 13 | #define _MEDIA_VIDEOBUF2_V4L2_H |
| 14 | |
Junghak Sung | 2d70071 | 2015-09-22 10:30:30 -0300 | [diff] [blame] | 15 | #include <linux/videodev2.h> |
Junghak Sung | c139990 | 2015-09-22 10:30:29 -0300 | [diff] [blame] | 16 | #include <media/videobuf2-core.h> |
| 17 | |
Junghak Sung | bed04f9 | 2015-10-06 06:37:47 -0300 | [diff] [blame^] | 18 | #if VB2_MAX_FRAME != VIDEO_MAX_FRAME |
| 19 | #error VB2_MAX_FRAME != VIDEO_MAX_FRAME |
| 20 | #endif |
| 21 | |
| 22 | #if VB2_MAX_PLANES != VIDEO_MAX_PLANES |
| 23 | #error VB2_MAX_PLANES != VIDEO_MAX_PLANES |
| 24 | #endif |
| 25 | |
Junghak Sung | 2d70071 | 2015-09-22 10:30:30 -0300 | [diff] [blame] | 26 | /** |
| 27 | * struct vb2_v4l2_buffer - video buffer information for v4l2 |
| 28 | * @vb2_buf: video buffer 2 |
| 29 | * @flags: buffer informational flags |
| 30 | * @field: enum v4l2_field; field order of the image in the buffer |
| 31 | * @timestamp: frame timestamp |
| 32 | * @timecode: frame timecode |
| 33 | * @sequence: sequence count of this frame |
| 34 | * Should contain enough information to be able to cover all the fields |
| 35 | * of struct v4l2_buffer at videodev2.h |
| 36 | */ |
| 37 | struct vb2_v4l2_buffer { |
| 38 | struct vb2_buffer vb2_buf; |
| 39 | |
| 40 | __u32 flags; |
| 41 | __u32 field; |
| 42 | struct timeval timestamp; |
| 43 | struct v4l2_timecode timecode; |
| 44 | __u32 sequence; |
| 45 | }; |
| 46 | |
Mauro Carvalho Chehab | d383b57 | 2015-10-01 14:23:35 -0300 | [diff] [blame] | 47 | /* |
Junghak Sung | 2d70071 | 2015-09-22 10:30:30 -0300 | [diff] [blame] | 48 | * to_vb2_v4l2_buffer() - cast struct vb2_buffer * to struct vb2_v4l2_buffer * |
| 49 | */ |
| 50 | #define to_vb2_v4l2_buffer(vb) \ |
Mauro Carvalho Chehab | d383b57 | 2015-10-01 14:23:35 -0300 | [diff] [blame] | 51 | container_of(vb, struct vb2_v4l2_buffer, vb2_buf) |
Junghak Sung | 2d70071 | 2015-09-22 10:30:30 -0300 | [diff] [blame] | 52 | |
Junghak Sung | c139990 | 2015-09-22 10:30:29 -0300 | [diff] [blame] | 53 | #endif /* _MEDIA_VIDEOBUF2_V4L2_H */ |