summaryrefslogtreecommitdiffstats
path: root/sys/v4l2
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2')
-rw-r--r--sys/v4l2/gstv4l2colorbalance.h12
-rw-r--r--sys/v4l2/gstv4l2element.h68
-rw-r--r--sys/v4l2/gstv4l2src.h97
-rw-r--r--sys/v4l2/gstv4l2tuner.h28
-rw-r--r--sys/v4l2/gstv4l2xoverlay.h13
-rw-r--r--sys/v4l2/v4l2_calls.h60
-rw-r--r--sys/v4l2/v4l2src_calls.h41
7 files changed, 168 insertions, 151 deletions
diff --git a/sys/v4l2/gstv4l2colorbalance.h b/sys/v4l2/gstv4l2colorbalance.h
index f0de44ce..4003203b 100644
--- a/sys/v4l2/gstv4l2colorbalance.h
+++ b/sys/v4l2/gstv4l2colorbalance.h
@@ -27,6 +27,7 @@
#include "v4l2_calls.h"
G_BEGIN_DECLS
+
#define GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL \
(gst_v4l2_color_balance_channel_get_type ())
#define GST_V4L2_COLOR_BALANCE_CHANNEL(obj) \
@@ -39,20 +40,19 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL))
#define GST_IS_V4L2_COLOR_BALANCE_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL))
- typedef struct _GstV4l2ColorBalanceChannel
-{
+
+typedef struct _GstV4l2ColorBalanceChannel {
GstColorBalanceChannel parent;
guint32 index;
} GstV4l2ColorBalanceChannel;
-typedef struct _GstV4l2ColorBalanceChannelClass
-{
+typedef struct _GstV4l2ColorBalanceChannelClass {
GstColorBalanceChannelClass parent;
} GstV4l2ColorBalanceChannelClass;
-GType gst_v4l2_color_balance_channel_get_type (void);
+GType gst_v4l2_color_balance_channel_get_type (void);
-void gst_v4l2_color_balance_interface_init (GstColorBalanceClass * klass);
+void gst_v4l2_color_balance_interface_init (GstColorBalanceClass *klass);
#endif /* __GST_V4L2_COLOR_BALANCE_H__ */
diff --git a/sys/v4l2/gstv4l2element.h b/sys/v4l2/gstv4l2element.h
index 7dcd6846..e46b2440 100644
--- a/sys/v4l2/gstv4l2element.h
+++ b/sys/v4l2/gstv4l2element.h
@@ -55,53 +55,53 @@
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_V4L2ELEMENT, GstV4l2ElementClass))
-typedef struct _GstV4l2Element GstV4l2Element;
-typedef struct _GstV4l2ElementClass GstV4l2ElementClass;
+typedef struct _GstV4l2Element GstV4l2Element;
+typedef struct _GstV4l2ElementClass GstV4l2ElementClass;
-struct _GstV4l2Element
-{
- GstElement element;
+struct _GstV4l2Element {
+ GstElement element;
- /* the video device */
- char *device;
+ /* the video device */
+ char *device;
- /* the video-device's file descriptor */
- gint video_fd;
+ /* the video-device's file descriptor */
+ gint video_fd;
- /* the video buffer (mmap()'ed) */
- guint8 **buffer;
+ /* the video buffer (mmap()'ed) */
+ guint8 **buffer;
- /* the video-device's capabilities */
- struct v4l2_capability vcap;
+ /* the video-device's capabilities */
+ struct v4l2_capability vcap;
- /* the toys available to us */
- GList *channels;
- GList *norms;
- GList *colors;
+ /* the toys available to us */
+ GList *channels;
+ GList *norms;
+ GList *colors;
- /* X-overlay */
- GstXWindowListener *overlay;
- XID xwindow_id;
+ /* X-overlay */
+ GstXWindowListener *overlay;
+ XID xwindow_id;
- /* properties */
- gchar *norm;
- gchar *channel;
- gulong frequency;
+ /* properties */
+ gchar *norm;
+ gchar *channel;
+ gulong frequency;
- /* caching values */
- gchar *display;
+ /* caching values */
+ gchar *display;
};
-struct _GstV4l2ElementClass
-{
- GstElementClass parent_class;
+struct _GstV4l2ElementClass {
+ GstElementClass parent_class;
- /* probed devices */
- GList *devices;
+ /* probed devices */
+ GList *devices;
- /* signals */
- void (*open) (GstElement * element, const gchar * device);
- void (*close) (GstElement * element, const gchar * device);
+ /* signals */
+ void (*open) (GstElement *element,
+ const gchar *device);
+ void (*close) (GstElement *element,
+ const gchar *device);
};
diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h
index d68f9cf8..ca528d1e 100644
--- a/sys/v4l2/gstv4l2src.h
+++ b/sys/v4l2/gstv4l2src.h
@@ -38,75 +38,72 @@ GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
#define GST_IS_V4L2SRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC))
-typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
-typedef struct _GstV4l2Buffer GstV4l2Buffer;
-typedef struct _GstV4l2Src GstV4l2Src;
-typedef struct _GstV4l2SrcClass GstV4l2SrcClass;
+typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
+typedef struct _GstV4l2Buffer GstV4l2Buffer;
+typedef struct _GstV4l2Src GstV4l2Src;
+typedef struct _GstV4l2SrcClass GstV4l2SrcClass;
/* global info */
-struct _GstV4l2BufferPool
-{
- GstAtomicInt refcount; /* number of users: 1 for every buffer, 1 for element */
- gint video_fd;
- guint buffer_count;
- GstV4l2Buffer *buffers;
+struct _GstV4l2BufferPool {
+ GstAtomicInt refcount; /* number of users: 1 for every buffer, 1 for element */
+ gint video_fd;
+ guint buffer_count;
+ GstV4l2Buffer * buffers;
};
-struct _GstV4l2Buffer
-{
- struct v4l2_buffer buffer;
- guint8 *start;
- guint length;
- GstAtomicInt refcount; /* add 1 if in use by element, add 1 if in use by GstBuffer */
- GstV4l2BufferPool *pool;
+struct _GstV4l2Buffer {
+ struct v4l2_buffer buffer;
+ guint8 * start;
+ guint length;
+ GstAtomicInt refcount; /* add 1 if in use by element, add 1 if in use by GstBuffer */
+ GstV4l2BufferPool * pool;
};
-struct _GstV4l2Src
-{
- GstV4l2Element v4l2element;
+struct _GstV4l2Src {
+ GstV4l2Element v4l2element;
- /* pads */
- GstPad *srcpad;
+ /* pads */
+ GstPad *srcpad;
- /* internal lists */
- GSList *formats; /* list of available capture formats */
+ /* internal lists */
+ GSList *formats; /* list of available capture formats */
- /* buffers */
- GstV4l2BufferPool *pool;
+ /* buffers */
+ GstV4l2BufferPool *pool;
- struct v4l2_requestbuffers breq;
- struct v4l2_format format;
+ struct v4l2_requestbuffers breq;
+ struct v4l2_format format;
- /* True if we want to stop */
- gboolean quit;
+ /* True if we want to stop */
+ gboolean quit;
- /* A/V sync... frame counter and internal cache */
- gulong handled;
- gint need_writes;
- GstBuffer *cached_buffer;
- gulong last_seq;
+ /* A/V sync... frame counter and internal cache */
+ gulong handled;
+ gint need_writes;
+ GstBuffer *cached_buffer;
+ gulong last_seq;
- /* clock */
- GstClock *clock;
+ /* clock */
+ GstClock *clock;
+
+ /* time to substract from clock time to get back to timestamp */
+ GstClockTime substract_time;
- /* time to substract from clock time to get back to timestamp */
- GstClockTime substract_time;
-
- /* how are we going to push buffers? */
- gboolean use_fixed_fps;
+ /* how are we going to push buffers? */
+ gboolean use_fixed_fps;
};
-struct _GstV4l2SrcClass
-{
- GstV4l2ElementClass parent_class;
+struct _GstV4l2SrcClass {
+ GstV4l2ElementClass parent_class;
- void (*frame_capture) (GObject * object);
- void (*frame_drop) (GObject * object);
- void (*frame_insert) (GObject * object);
- void (*frame_lost) (GObject * object, gint num_lost);
+ void (*frame_capture) (GObject *object);
+ void (*frame_drop) (GObject *object);
+ void (*frame_insert) (GObject *object);
+ void (*frame_lost) (GObject *object,
+ gint num_lost);
};
-GType gst_v4l2src_get_type (void);
+GType gst_v4l2src_get_type(void);
#endif /* __GST_V4L2SRC_H__ */
diff --git a/sys/v4l2/gstv4l2tuner.h b/sys/v4l2/gstv4l2tuner.h
index 729fe221..a768ea2f 100644
--- a/sys/v4l2/gstv4l2tuner.h
+++ b/sys/v4l2/gstv4l2tuner.h
@@ -28,6 +28,7 @@
#include "gstv4l2element.h"
G_BEGIN_DECLS
+
#define GST_TYPE_V4L2_TUNER_CHANNEL \
(gst_v4l2_tuner_channel_get_type ())
#define GST_V4L2_TUNER_CHANNEL(obj) \
@@ -40,17 +41,16 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_TUNER_CHANNEL))
#define GST_IS_V4L2_TUNER_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_CHANNEL))
- typedef struct _GstV4l2TunerChannel
-{
+
+typedef struct _GstV4l2TunerChannel {
GstTunerChannel parent;
- guint32 index;
- guint32 tuner;
- guint32 audio;
+ guint32 index;
+ guint32 tuner;
+ guint32 audio;
} GstV4l2TunerChannel;
-typedef struct _GstV4l2TunerChannelClass
-{
+typedef struct _GstV4l2TunerChannelClass {
GstTunerChannelClass parent;
} GstV4l2TunerChannelClass;
@@ -67,21 +67,19 @@ typedef struct _GstV4l2TunerChannelClass
#define GST_IS_V4L2_TUNER_NORM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_NORM))
-typedef struct _GstV4l2TunerNorm
-{
+typedef struct _GstV4l2TunerNorm {
GstTunerNorm parent;
- v4l2_std_id index;
+ v4l2_std_id index;
} GstV4l2TunerNorm;
-typedef struct _GstV4l2TunerNormClass
-{
+typedef struct _GstV4l2TunerNormClass {
GstTunerNormClass parent;
} GstV4l2TunerNormClass;
-GType gst_v4l2_tuner_channel_get_type (void);
-GType gst_v4l2_tuner_norm_get_type (void);
+GType gst_v4l2_tuner_channel_get_type (void);
+GType gst_v4l2_tuner_norm_get_type (void);
-void gst_v4l2_tuner_interface_init (GstTunerClass * klass);
+void gst_v4l2_tuner_interface_init (GstTunerClass *klass);
#endif /* __GST_V4L2_TUNER_H__ */
diff --git a/sys/v4l2/gstv4l2xoverlay.h b/sys/v4l2/gstv4l2xoverlay.h
index d5cb7796..cfcdfd35 100644
--- a/sys/v4l2/gstv4l2xoverlay.h
+++ b/sys/v4l2/gstv4l2xoverlay.h
@@ -27,13 +27,16 @@
#include "gstv4l2element.h"
-G_BEGIN_DECLS void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
+G_BEGIN_DECLS
-GstXWindowListener *gst_v4l2_xoverlay_new (GstV4l2Element * v4l2element);
-void gst_v4l2_xoverlay_free (GstV4l2Element * v4l2element);
+void gst_v4l2_xoverlay_interface_init (GstXOverlayClass *klass);
+
+GstXWindowListener *
+ gst_v4l2_xoverlay_new (GstV4l2Element *v4l2element);
+void gst_v4l2_xoverlay_free (GstV4l2Element *v4l2element);
/* signal handlers */
-void gst_v4l2_xoverlay_open (GstV4l2Element * v4l2element);
-void gst_v4l2_xoverlay_close (GstV4l2Element * v4l2element);
+void gst_v4l2_xoverlay_open (GstV4l2Element *v4l2element);
+void gst_v4l2_xoverlay_close (GstV4l2Element *v4l2element);
#endif /* __GST_V4L2_X_OVERLAY_H__ */
diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h
index 488e7bca..428c57aa 100644
--- a/sys/v4l2/v4l2_calls.h
+++ b/sys/v4l2/v4l2_calls.h
@@ -82,36 +82,50 @@
/* open/close the device */
-gboolean gst_v4l2_open (GstV4l2Element * v4l2element);
-gboolean gst_v4l2_close (GstV4l2Element * v4l2element);
+gboolean gst_v4l2_open (GstV4l2Element *v4l2element);
+gboolean gst_v4l2_close (GstV4l2Element *v4l2element);
/* norm/input/output */
-gboolean gst_v4l2_get_norm (GstV4l2Element * v4l2element, v4l2_std_id * norm);
-gboolean gst_v4l2_set_norm (GstV4l2Element * v4l2element, v4l2_std_id norm);
-gboolean gst_v4l2_get_input (GstV4l2Element * v4l2element, gint * input);
-gboolean gst_v4l2_set_input (GstV4l2Element * v4l2element, gint input);
-gboolean gst_v4l2_get_output (GstV4l2Element * v4l2element, gint * output);
-gboolean gst_v4l2_set_output (GstV4l2Element * v4l2element, gint output);
+gboolean gst_v4l2_get_norm (GstV4l2Element *v4l2element,
+ v4l2_std_id *norm);
+gboolean gst_v4l2_set_norm (GstV4l2Element *v4l2element,
+ v4l2_std_id norm);
+gboolean gst_v4l2_get_input (GstV4l2Element *v4l2element,
+ gint *input);
+gboolean gst_v4l2_set_input (GstV4l2Element *v4l2element,
+ gint input);
+gboolean gst_v4l2_get_output (GstV4l2Element *v4l2element,
+ gint *output);
+gboolean gst_v4l2_set_output (GstV4l2Element *v4l2element,
+ gint output);
/* frequency control */
-gboolean gst_v4l2_get_frequency (GstV4l2Element * v4l2element,
- gint tunernum, gulong * frequency);
-gboolean gst_v4l2_set_frequency (GstV4l2Element * v4l2element,
- gint tunernum, gulong frequency);
-gboolean gst_v4l2_signal_strength (GstV4l2Element * v4l2element,
- gint tunernum, gulong * signal);
+gboolean gst_v4l2_get_frequency (GstV4l2Element *v4l2element,
+ gint tunernum,
+ gulong *frequency);
+gboolean gst_v4l2_set_frequency (GstV4l2Element *v4l2element,
+ gint tunernum,
+ gulong frequency);
+gboolean gst_v4l2_signal_strength (GstV4l2Element *v4l2element,
+ gint tunernum,
+ gulong *signal);
/* attribute control */
-gboolean gst_v4l2_get_attribute (GstV4l2Element * v4l2element,
- int attribute, int *value);
-gboolean gst_v4l2_set_attribute (GstV4l2Element * v4l2element,
- int attribute, const int value);
+gboolean gst_v4l2_get_attribute (GstV4l2Element *v4l2element,
+ int attribute,
+ int *value);
+gboolean gst_v4l2_set_attribute (GstV4l2Element *v4l2element,
+ int attribute,
+ const int value);
/* overlay */
-gboolean gst_v4l2_set_display (GstV4l2Element * v4l2element);
-gboolean gst_v4l2_set_window (GstElement * element,
- gint x, gint y, gint w, gint h, struct v4l2_clip *clips, gint num_clips);
-gboolean gst_v4l2_enable_overlay (GstV4l2Element * v4l2element,
- gboolean enable);
+gboolean gst_v4l2_set_display (GstV4l2Element *v4l2element);
+gboolean gst_v4l2_set_window (GstElement *element,
+ gint x, gint y,
+ gint w, gint h,
+ struct v4l2_clip *clips,
+ gint num_clips);
+gboolean gst_v4l2_enable_overlay (GstV4l2Element *v4l2element,
+ gboolean enable);
#endif /* __V4L2_CALLS_H__ */
diff --git a/sys/v4l2/v4l2src_calls.h b/sys/v4l2/v4l2src_calls.h
index 043dddf0..dc5fca0c 100644
--- a/sys/v4l2/v4l2src_calls.h
+++ b/sys/v4l2/v4l2src_calls.h
@@ -24,25 +24,30 @@
#include "v4l2_calls.h"
-gboolean gst_v4l2src_get_capture (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_set_capture (GstV4l2Src * v4l2src,
- struct v4l2_fmtdesc *fmt, gint width, gint height);
-gboolean gst_v4l2src_capture_init (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_capture_start (GstV4l2Src * v4l2src);
-gint gst_v4l2src_grab_frame (GstV4l2Src * v4l2src);
-guint8 *gst_v4l2src_get_buffer (GstV4l2Src * v4l2src, gint num);
-gboolean gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i);
-gboolean gst_v4l2src_capture_stop (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_capture_deinit (GstV4l2Src * v4l2src);
-
-gboolean gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_clear_format_list (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_get_capture (GstV4l2Src *v4l2src);
+gboolean gst_v4l2src_set_capture (GstV4l2Src *v4l2src,
+ struct v4l2_fmtdesc *fmt,
+ gint width,
+ gint height);
+gboolean gst_v4l2src_capture_init (GstV4l2Src *v4l2src);
+gboolean gst_v4l2src_capture_start (GstV4l2Src *v4l2src);
+gint gst_v4l2src_grab_frame (GstV4l2Src *v4l2src);
+guint8 * gst_v4l2src_get_buffer (GstV4l2Src *v4l2src,
+ gint num);
+gboolean gst_v4l2src_queue_frame (GstV4l2Src *v4l2src,
+ guint i);
+gboolean gst_v4l2src_capture_stop (GstV4l2Src *v4l2src);
+gboolean gst_v4l2src_capture_deinit (GstV4l2Src *v4l2src);
+
+gboolean gst_v4l2src_fill_format_list (GstV4l2Src *v4l2src);
+gboolean gst_v4l2src_clear_format_list (GstV4l2Src *v4l2src);
/* hacky */
-gboolean gst_v4l2src_get_size_limits (GstV4l2Src * v4l2src,
- struct v4l2_fmtdesc *fmt,
- gint * min_w, gint * max_w, gint * min_h, gint * max_h);
-
-void gst_v4l2src_free_buffer (GstBuffer * buffer);
+gboolean gst_v4l2src_get_size_limits (GstV4l2Src *v4l2src,
+ struct v4l2_fmtdesc *fmt,
+ gint *min_w, gint *max_w,
+ gint *min_h, gint *max_h);
+void gst_v4l2src_free_buffer (GstBuffer *buffer);
+
#endif /* __V4L2SRC_CALLS_H__ */