libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-v4l2.h
Go to the documentation of this file.
1/*
2 * libwebsockets - small server side websockets and web server implementation
3 *
4 * Copyright (C) 2010 - 2026 Andy Green <andy@warmcat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 */
24
25#ifndef __LWS_V4L2_H__
26#define __LWS_V4L2_H__
27
28struct lws_v4l2_ctx;
29
31 const char *device_path;
34 uint32_t pixelformat; /* V4L2_PIX_FMT_... */
35};
36
40 char name[32];
41 int32_t min;
42 int32_t max;
43 int32_t step;
44 int32_t def;
45 int32_t val;
46};
47
48typedef int (*lws_v4l2_control_cb)(void *user, const struct lws_v4l2_control *c);
49
50LWS_VISIBLE LWS_EXTERN struct lws_v4l2_ctx *
51lws_v4l2_create(const struct lws_v4l2_info *info);
52
54lws_v4l2_destroy(struct lws_v4l2_ctx **ctx);
55
57lws_v4l2_get_buffer(struct lws_v4l2_ctx *ctx, int index, void **start, size_t *len);
58
60lws_v4l2_get_fd(struct lws_v4l2_ctx *ctx);
61
63lws_v4l2_get_info(struct lws_v4l2_ctx *ctx, struct lws_v4l2_info *info);
64
66lws_v4l2_enum_controls(struct lws_v4l2_ctx *ctx, lws_v4l2_control_cb cb, void *user);
67
69lws_v4l2_set_control(struct lws_v4l2_ctx *ctx, uint32_t id, int32_t val);
70
71#endif
unsigned int uint32_t
#define LWS_EXTERN
#define LWS_VISIBLE
LWS_VISIBLE LWS_EXTERN int lws_v4l2_get_buffer(struct lws_v4l2_ctx *ctx, int index, void **start, size_t *len)
uint32_t width
Definition lws-v4l2.h:32
int(* lws_v4l2_control_cb)(void *user, const struct lws_v4l2_control *c)
Definition lws-v4l2.h:48
const char * device_path
Definition lws-v4l2.h:31
uint32_t type
Definition lws-v4l2.h:39
char name[32]
Definition lws-v4l2.h:40
LWS_VISIBLE LWS_EXTERN int lws_v4l2_get_info(struct lws_v4l2_ctx *ctx, struct lws_v4l2_info *info)
uint32_t id
Definition lws-v4l2.h:38
LWS_VISIBLE LWS_EXTERN int lws_v4l2_set_control(struct lws_v4l2_ctx *ctx, uint32_t id, int32_t val)
LWS_VISIBLE LWS_EXTERN int lws_v4l2_get_fd(struct lws_v4l2_ctx *ctx)
LWS_VISIBLE LWS_EXTERN struct lws_v4l2_ctx * lws_v4l2_create(const struct lws_v4l2_info *info)
uint32_t pixelformat
Definition lws-v4l2.h:34
LWS_VISIBLE LWS_EXTERN void lws_v4l2_destroy(struct lws_v4l2_ctx **ctx)
uint32_t height
Definition lws-v4l2.h:33
LWS_VISIBLE LWS_EXTERN int lws_v4l2_enum_controls(struct lws_v4l2_ctx *ctx, lws_v4l2_control_cb cb, void *user)