summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_videodev2_compat.h
blob: 0d9a3a348b8f919f48d77643d99d67447c74788c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * $FreeBSD$
 */

/*
 * This file defines compatibility versions of several video structures
 * defined in the Linux videodev2.h header (linux_videodev2.h).  The
 * structures defined in this file are the ones that have been determined
 * to have 32- to 64-bit size dependencies.
 */

#ifndef _LINUX_VIDEODEV2_COMPAT_H_
#define	_LINUX_VIDEODEV2_COMPAT_H_

struct l_v4l2_buffer {
	uint32_t		index;
	enum v4l2_buf_type	type;
	uint32_t		bytesused;
	uint32_t		flags;
	enum v4l2_field		field;
	l_timeval		timestamp;
	struct v4l2_timecode	timecode;
	uint32_t		sequence;

	/* memory location */
	enum v4l2_memory	memory;
	union {
		uint32_t	offset;
		l_ulong		userptr;
	} m;
	uint32_t		length;
	uint32_t		input;
	uint32_t		reserved;
};

struct l_v4l2_framebuffer {
	uint32_t		capability;
	uint32_t		flags;
/* FIXME: in theory we should pass something like PCI device + memory
 * region + offset instead of some physical address */
	l_uintptr_t		base;
	struct v4l2_pix_format	fmt;
};

struct l_v4l2_clip {
	struct v4l2_rect	c;
	l_uintptr_t		next;
};

struct l_v4l2_window {
	struct v4l2_rect	w;
	enum v4l2_field		field;
	uint32_t		chromakey;
	l_uintptr_t		clips;
	uint32_t		clipcount;
	l_uintptr_t		bitmap;
	uint8_t			global_alpha;
};

struct l_v4l2_standard {
	uint32_t		index;
	v4l2_std_id		id;
	uint8_t			name[24];
	struct v4l2_fract	frameperiod; /* Frames, not fields */
	uint32_t		framelines;
	uint32_t		reserved[4];
}
#ifdef COMPAT_LINUX32 /* 32bit linuxolator */
__attribute__ ((packed))
#endif
;

struct l_v4l2_ext_control {
	uint32_t id;
	uint32_t size;
	uint32_t reserved2[1];
	union {
		int32_t value;
		int64_t value64;
		l_uintptr_t string;
	} u;
} __attribute__ ((packed));

struct l_v4l2_ext_controls {
	uint32_t ctrl_class;
	uint32_t count;
	uint32_t error_idx;
	uint32_t reserved[2];
	l_uintptr_t controls;
};

struct l_v4l2_format {
	enum v4l2_buf_type type;
	union {
		struct v4l2_pix_format		pix;     /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
		struct l_v4l2_window		win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
		struct v4l2_vbi_format		vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
		struct v4l2_sliced_vbi_format	sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
		uint8_t	raw_data[200];                   /* user-defined */
	} fmt;
}
#ifdef COMPAT_LINUX32 /* 32bit linuxolator */
__attribute__ ((packed))
#endif
;

#ifdef VIDIOC_DQEVENT
struct l_v4l2_event {
	uint32_t				type;
	union {
		struct v4l2_event_vsync vsync;
		uint8_t			data[64];
	} u;
	uint32_t				pending;
	uint32_t				sequence;
	struct l_timespec			timestamp;
	uint32_t				reserved[9];
};
#endif

struct l_v4l2_input {
	uint32_t	     index;		/*  Which input */
	uint8_t		     name[32];		/*  Label */
	uint32_t	     type;		/*  Type of input */
	uint32_t	     audioset;		/*  Associated audios (bitfield) */
	uint32_t	     tuner;             /*  Associated tuner */
	v4l2_std_id  std;
	uint32_t	     status;
	uint32_t	     capabilities;
	uint32_t	     reserved[3];
}
#ifdef COMPAT_LINUX32 /* 32bit linuxolator */
__attribute__ ((packed))
#endif
;

#endif /* _LINUX_VIDEODEV2_COMPAT_H_ */
OpenPOWER on IntegriCloud