aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/video/video_if.m
blob: 236225111428b7d4f6e12319981814764332b382 (plain) (blame)
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#
# Copyright (c) 2026 Abdelkader Boudih <freebsd@seuros.com>
#
# SPDX-License-Identifier: BSD-2-Clause
#

#include <sys/bus.h>
#include <dev/video/video.h>

INTERFACE video;

CODE {
	static int
	video_default_open(device_t dev __unused)
	{

		return (0);
	}

	static void
	video_default_close(device_t dev __unused)
	{
	}

	static int
	video_default_frmsize(device_t dev __unused,
	    struct video_frmsizeenum *fs __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_frmival(device_t dev __unused,
	    struct video_frmivalenum *fi __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_format(device_t dev __unused,
	    struct video_format *fmt __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_fract(device_t dev __unused,
	    struct video_fract *fr __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_enum_input(device_t dev __unused, uint32_t index __unused,
	    struct video_input *inp __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_get_input(device_t dev __unused, uint32_t *idx __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_set_input(device_t dev __unused, uint32_t idx __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_query_control(device_t dev __unused,
	    struct video_control_desc *d __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_get_control(device_t dev __unused,
	    struct video_control *c __unused)
	{

		return (ENOTTY);
	}

	static int
	video_default_set_control(device_t dev __unused,
	    const struct video_control *c __unused)
	{

		return (ENOTTY);
	}
};

METHOD int open {
	device_t	dev;
} DEFAULT video_default_open;

METHOD void close {
	device_t	dev;
} DEFAULT video_default_close;

METHOD int querycap {
	device_t		 dev;
	struct video_caps	*caps;
};

METHOD int enum_format {
	device_t		 dev;
	uint32_t		 index;
	struct video_format	*format;
};

METHOD int enum_framesizes {
	device_t			 dev;
	struct video_frmsizeenum	*fsize;
} DEFAULT video_default_frmsize;

METHOD int enum_frameintervals {
	device_t			 dev;
	struct video_frmivalenum	*fival;
} DEFAULT video_default_frmival;

METHOD int try_format {
	device_t		 dev;
	struct video_format	*format;
} DEFAULT video_default_format;

METHOD int set_format {
	device_t			 dev;
	const struct video_format	*format;
};

METHOD int get_format {
	device_t		 dev;
	struct video_format	*format;
};

METHOD int get_parm {
	device_t		 dev;
	struct video_fract	*fract;
} DEFAULT video_default_fract;

METHOD int set_parm {
	device_t		 dev;
	struct video_fract	*fract;
} DEFAULT video_default_fract;

METHOD int enum_input {
	device_t		 dev;
	uint32_t		 index;
	struct video_input	*input;
} DEFAULT video_default_enum_input;

METHOD int get_input {
	device_t	 dev;
	uint32_t	*index;
} DEFAULT video_default_get_input;

METHOD int set_input {
	device_t	dev;
	uint32_t	index;
} DEFAULT video_default_set_input;

METHOD int query_control {
	device_t			 dev;
	struct video_control_desc	*desc;
} DEFAULT video_default_query_control;

METHOD int get_control {
	device_t		 dev;
	struct video_control	*control;
} DEFAULT video_default_get_control;

METHOD int set_control {
	device_t			 dev;
	const struct video_control	*control;
} DEFAULT video_default_set_control;

# stop_stream must quiesce the provider before returning.
METHOD int start_stream {
	device_t	dev;
};

METHOD void stop_stream {
	device_t	dev;
};