]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/media/videobuf2-v4l2.h
20d8ad20066ccf6bb547fed4945bebaf7c94c7cf
[karo-tx-linux.git] / include / media / videobuf2-v4l2.h
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
15 #include <linux/videodev2.h>
16 #include <media/videobuf2-core.h>
17
18 /**
19  * struct vb2_v4l2_buffer - video buffer information for v4l2
20  * @vb2_buf:    video buffer 2
21  * @flags:      buffer informational flags
22  * @field:      enum v4l2_field; field order of the image in the buffer
23  * @timestamp:  frame timestamp
24  * @timecode:   frame timecode
25  * @sequence:   sequence count of this frame
26  * Should contain enough information to be able to cover all the fields
27  * of struct v4l2_buffer at videodev2.h
28  */
29 struct vb2_v4l2_buffer {
30         struct vb2_buffer       vb2_buf;
31
32         __u32                   flags;
33         __u32                   field;
34         struct timeval          timestamp;
35         struct v4l2_timecode    timecode;
36         __u32                   sequence;
37 };
38
39 /**
40  * to_vb2_v4l2_buffer() - cast struct vb2_buffer * to struct vb2_v4l2_buffer *
41  */
42 #define to_vb2_v4l2_buffer(vb) \
43         (container_of(vb, struct vb2_v4l2_buffer, vb2_buf))
44
45 #endif /* _MEDIA_VIDEOBUF2_V4L2_H */