X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fv4l%2Fsrc.h;h=be2f0d9912fe3f3bff281550592441d5ce88ee7a;hb=ac5f5c9f6d4bdffeb76f3f2098b80f27bc532606;hp=3ce1d3b2584a736c0a9814c608124a783557d136;hpb=13caa29beb9cd02136e4616300d7da72363354ff;p=kdenlive diff --git a/src/v4l/src.h b/src/v4l/src.h index 3ce1d3b2..be2f0d99 100644 --- a/src/v4l/src.h +++ b/src/v4l/src.h @@ -11,6 +11,9 @@ extern "C" { #endif +#ifndef INC_SRC_H +#define INC_SRC_H + #include #include #include @@ -20,8 +23,9 @@ extern "C" { #include #include -#ifndef INC_SRC_H -#define INC_SRC_H +#include "videodev2.h" + + typedef unsigned char avgbmp_t; @@ -115,19 +119,6 @@ typedef struct { } src_t; -typedef struct { - - char *name; - - uint8_t flags; - - int (*open)(src_t *); - int (*close)(src_t *); - int (*grab)(src_t *); - const char *(*query)(src_t *, uint*, uint*, char **); - -} src_mod_t; - typedef struct { /* List of options. */ @@ -209,15 +200,31 @@ typedef struct { } fswebcam_config_t; -extern int src_open(src_t *src, char *source); -extern int src_close(src_t *src); -extern int src_grab(src_t *src); -extern const char *src_query(src_t *src, char *source, uint *width, uint *height, char **pixelformatdescription); -extern int src_set_option(src_option_t ***options, char *name, char *value); -extern int src_get_option_by_number(src_option_t **opt, int number, char **name, char **value); -extern int src_get_option_by_name(src_option_t **opt, char *name, char **value); -extern int src_free_options(src_option_t ***options); + +typedef struct { + void *start; + size_t length; +} v4l2_buffer_t; + +typedef struct { + + int fd; + char map; + + struct v4l2_capability cap; + struct v4l2_format fmt; + struct v4l2_requestbuffers req; + struct v4l2_buffer buf; + + v4l2_buffer_t *buffer; + + int pframe; + +} src_v4l2_t; + + +const char *query_v4ldevice(src_t *src, char **pixelformatdescription); #endif