#ifndef __GST_V4L2_OBJECT_H__
#define __GST_V4L2_OBJECT_H__
+#include "ext/videodev2.h"
#ifdef HAVE_LIBV4L2
# include <libv4l2.h>
-#else
-# include "ext/videodev2.h"
-# include <sys/ioctl.h>
-# include <sys/mman.h>
-# include <unistd.h>
-# define v4l2_fd_open(fd, flags) (fd)
-# define v4l2_close close
-# define v4l2_dup dup
-# define v4l2_ioctl ioctl
-# define v4l2_read read
-# define v4l2_mmap mmap
-# define v4l2_munmap munmap
#endif
-#include "ext/videodev2.h"
#include "v4l2-utils.h"
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
#include <gst/video/video.h>
+#include <unistd.h>
typedef struct _GstV4l2Object GstV4l2Object;
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
-typedef struct _GstV4l2Xv GstV4l2Xv;
#include <gstv4l2bufferpool.h>
struct _GstV4l2Object {
GstElement * element;
+ GstObject * dbg_obj;
enum v4l2_buf_type type; /* V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_OUTPUT */
* calculate the minimum latency. */
guint32 min_buffers;
- /* This will be set if supported in propose allocation. */
- guint32 min_buffers_for_output;
-
/* wanted mode */
GstV4l2IOMode req_mode;
/* opened device specific capabilities */
guint32 device_caps;
- /* the video device's window properties */
- struct v4l2_window vwin;
-
- /* some more info about the current input's capabilities */
- struct v4l2_input vinput;
-
/* lists... */
GSList *formats; /* list of available capture formats */
GstCaps *probed_caps;
gboolean keep_aspect;
GValue *par;
- /* X-overlay */
- GstV4l2Xv *xv;
- gulong xwindow_id;
-
/* funcs */
GstV4l2GetInOutFunction get_in_out_func;
GstV4l2SetInOutFunction set_in_out_func;
GstV4l2UpdateFpsFunction update_fps_func;
+ /* syscalls */
+ gint (*fd_open) (gint fd, gint v4l2_flags);
+ gint (*close) (gint fd);
+ gint (*dup) (gint fd);
+ gint (*ioctl) (gint fd, gulong request, ...);
+ gssize (*read) (gint fd, gpointer buffer, gsize n);
+ gpointer (*mmap) (gpointer start, gsize length, gint prot, gint flags,
+ gint fd, off_t offset);
+ gint (*munmap) (gpointer _start, gsize length);
+
/* Quirks */
/* Skips interlacing probes */
gboolean never_interlaced;
/* create/destroy */
GstV4l2Object* gst_v4l2_object_new (GstElement * element,
+ GstObject * dbg_obj,
enum v4l2_buf_type type,
const char * default_device,
GstV4l2GetInOutFunction get_in_out_func,
gboolean gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps, GstV4l2Error * error);
gboolean gst_v4l2_object_try_format (GstV4l2Object * v4l2object, GstCaps * caps, GstV4l2Error * error);
-gboolean gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps);
+gboolean gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps);
+gboolean gst_v4l2_object_caps_is_subset (GstV4l2Object * v4l2object, GstCaps * caps);
+GstCaps * gst_v4l2_object_get_current_caps (GstV4l2Object * v4l2object);
gboolean gst_v4l2_object_unlock (GstV4l2Object * v4l2object);
gboolean gst_v4l2_object_unlock_stop (GstV4l2Object * v4l2object);