]> git.sesse.net Git - kdenlive/blobdiff - src/v4l/src.h
Complete rewrite of the video4linux capture to use MLT, in progress.
[kdenlive] / src / v4l / src.h
index ae228a4b23798a84099c3bc9aed6854a9fbaeb18..be2f0d9912fe3f3bff281550592441d5ce88ee7a 100644 (file)
@@ -11,6 +11,9 @@
 extern "C" {
  #endif
 
+#ifndef INC_SRC_H
+#define INC_SRC_H
+
 #include <stdint.h>
 #include <sys/time.h>
 #include <stdio.h>
@@ -20,8 +23,14 @@ extern "C" {
 #include <unistd.h>
 #include <fcntl.h>
 
-#ifndef INC_SRC_H
-#define INC_SRC_H
+#include "videodev2.h"
+
+
+
+typedef unsigned char avgbmp_t;
+
+
+#define CLIP(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
 
 #define SRC_TYPE_NONE   (0)
 #define SRC_TYPE_DEVICE (1 << 0) /* Can capture from a device */
@@ -110,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 *, int*, int*, char **);
-       
-} src_mod_t;
-
 typedef struct {
        
        /* List of options. */
@@ -204,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, int *width, int *height, char **pixelformat);
 
-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