summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-09-26 13:18:06 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-09-26 13:18:06 +0000
commit27bde5b96e294024d056433a078d81f1cdba61fa (patch)
treeeb4bb1cc6f37be82cb64f3cfc9e320eb94400995
parentd9db447dfaa832a383905bf588c0472d9a8c27e5 (diff)
sys/v4l2/Makefile.am: Fix makefile, list libs in stack order.
Original commit message from CVS: * sys/v4l2/Makefile.am: Fix makefile, list libs in stack order. * sys/v4l2/gstv4l2colorbalance.c: * sys/v4l2/gstv4l2colorbalance.h: * sys/v4l2/gstv4l2object.c: (gst_v4l2_device_get_type), (gst_v4l2_object_install_properties_helper): * sys/v4l2/gstv4l2object.h: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read), (gst_v4l2src_get_mmap), (gst_v4l2src_create): * sys/v4l2/gstv4l2src.h: * sys/v4l2/gstv4l2tuner.h: * sys/v4l2/gstv4l2vidorient.h: * sys/v4l2/gstv4l2xoverlay.h: * sys/v4l2/v4l2_calls.h: * sys/v4l2/v4l2src_calls.h: Fix coding style: - Remove extern from functions. - Fix header indentation. Fix Flags, add defaults for properties. Remove unused enums. Fix TOO_LAZY in error messages.
-rw-r--r--sys/v4l2/Makefile.am4
-rw-r--r--sys/v4l2/gstv4l2colorbalance.c1
-rw-r--r--sys/v4l2/gstv4l2colorbalance.h16
-rw-r--r--sys/v4l2/gstv4l2object.c82
-rw-r--r--sys/v4l2/gstv4l2object.h87
-rw-r--r--sys/v4l2/gstv4l2src.c8
-rw-r--r--sys/v4l2/gstv4l2src.h13
-rw-r--r--sys/v4l2/gstv4l2tuner.h54
-rw-r--r--sys/v4l2/gstv4l2vidorient.h28
-rw-r--r--sys/v4l2/gstv4l2xoverlay.h3
-rw-r--r--sys/v4l2/v4l2_calls.h6
-rw-r--r--sys/v4l2/v4l2src_calls.h62
12 files changed, 156 insertions, 208 deletions
diff --git a/sys/v4l2/Makefile.am b/sys/v4l2/Makefile.am
index d40e7fe77..82e2ff332 100644
--- a/sys/v4l2/Makefile.am
+++ b/sys/v4l2/Makefile.am
@@ -27,9 +27,9 @@ libgstvideo4linux2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvideo4linux2_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
+ -lgstinterfaces-$(GST_MAJORMINOR) \
$(GST_LIBS) \
- $(xv_libs) \
- -lgstinterfaces-$(GST_MAJORMINOR)
+ $(xv_libs)
noinst_HEADERS = gstv4l2object.h v4l2_calls.h \
gstv4l2src.h v4l2src_calls.h \
diff --git a/sys/v4l2/gstv4l2colorbalance.c b/sys/v4l2/gstv4l2colorbalance.c
index 62478ebfc..f5cde096f 100644
--- a/sys/v4l2/gstv4l2colorbalance.c
+++ b/sys/v4l2/gstv4l2colorbalance.c
@@ -33,7 +33,6 @@ GST_BOILERPLATE (GstV4l2ColorBalanceChannel,
gst_v4l2_color_balance_channel,
GstColorBalanceChannel, GST_TYPE_COLOR_BALANCE_CHANNEL);
-
static void
gst_v4l2_color_balance_channel_base_init (gpointer g_class)
{
diff --git a/sys/v4l2/gstv4l2colorbalance.h b/sys/v4l2/gstv4l2colorbalance.h
index 193c6a4ac..ecd0111dd 100644
--- a/sys/v4l2/gstv4l2colorbalance.h
+++ b/sys/v4l2/gstv4l2colorbalance.h
@@ -53,18 +53,16 @@ typedef struct _GstV4l2ColorBalanceChannelClass {
GstColorBalanceChannelClass parent;
} GstV4l2ColorBalanceChannelClass;
-GType gst_v4l2_color_balance_channel_get_type (void);
+GType gst_v4l2_color_balance_channel_get_type (void);
-extern const GList *
-gst_v4l2_color_balance_list_channels (GstV4l2Object * v4l2object);
+const GList * gst_v4l2_color_balance_list_channels (GstV4l2Object * v4l2object);
-extern void
-gst_v4l2_color_balance_set_value (GstV4l2Object * v4l2object,
- GstColorBalanceChannel * channel, gint value);
+void gst_v4l2_color_balance_set_value (GstV4l2Object * v4l2object,
+ GstColorBalanceChannel * channel,
+ gint value);
-extern gint
-gst_v4l2_color_balance_get_value (GstV4l2Object * v4l2object,
- GstColorBalanceChannel * channel);
+gint gst_v4l2_color_balance_get_value (GstV4l2Object * v4l2object,
+ GstColorBalanceChannel * channel);
#define GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS(Type, interface_as_function) \
\
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index bec30eb66..f16b03375 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -35,6 +35,13 @@
#endif
#include "gstv4l2colorbalance.h"
+#define DEFAULT_PROP_DEVICE "/dev/video0"
+#define DEFAULT_PROP_DEVICE_NAME NULL
+#define DEFAULT_PROP_FLAGS 0
+#define DEFAULT_PROP_STD NULL
+#define DEFAULT_PROP_INPUT NULL
+#define DEFAULT_PROP_FREQUENCY 0
+
enum
{
PROP_0,
@@ -205,22 +212,15 @@ gst_v4l2_device_get_type (void)
if (v4l2_device_type == 0) {
static const GFlagsValue values[] = {
- {V4L2_CAP_VIDEO_CAPTURE, "CAPTURE",
- "Device supports video capture"},
- {V4L2_CAP_VIDEO_OUTPUT, "PLAYBACK",
- "Device supports video playback"},
- {V4L2_CAP_VIDEO_OVERLAY, "OVERLAY",
- "Device supports video overlay"},
-
- {V4L2_CAP_VBI_CAPTURE, "VBI_CAPTURE",
- "Device supports the VBI capture"},
- {V4L2_CAP_VBI_OUTPUT, "VBI_OUTPUT",
- "Device supports the VBI output"},
-
- {V4L2_CAP_TUNER, "TUNER",
- "Device has a tuner or modulator"},
- {V4L2_CAP_AUDIO, "AUDIO",
- "Device has audio inputs or outputs"},
+ {V4L2_CAP_VIDEO_CAPTURE, "Device supports video capture", "capture"},
+ {V4L2_CAP_VIDEO_OUTPUT, "Device supports video playback", "output"},
+ {V4L2_CAP_VIDEO_OVERLAY, "Device supports video overlay", "overlay"},
+
+ {V4L2_CAP_VBI_CAPTURE, "Device supports the VBI capture", "vbi-capture"},
+ {V4L2_CAP_VBI_OUTPUT, "Device supports the VBI output", "vbi-output"},
+
+ {V4L2_CAP_TUNER, "Device has a tuner or modulator", "tuner"},
+ {V4L2_CAP_AUDIO, "Device has audio inputs or outputs", "audio"},
{0, NULL, NULL}
};
@@ -235,34 +235,26 @@ gst_v4l2_device_get_type (void)
void
gst_v4l2_object_install_properties_helper (GObjectClass * gobject_class)
{
- g_object_class_install_property
- (G_OBJECT_CLASS (gobject_class), PROP_DEVICE,
- g_param_spec_string ("device",
- "Device", "Device location", NULL, G_PARAM_READWRITE));
- g_object_class_install_property
- (G_OBJECT_CLASS (gobject_class),
- PROP_DEVICE_NAME,
- g_param_spec_string ("device-name",
- "Device name", "Name of the device", NULL, G_PARAM_READABLE));
- g_object_class_install_property
- (G_OBJECT_CLASS (gobject_class), PROP_FLAGS,
- g_param_spec_flags ("flags", "Flags",
- "Device type flags",
- GST_TYPE_V4L2_DEVICE_FLAGS, 0, G_PARAM_READABLE));
- g_object_class_install_property
- (gobject_class, PROP_STD,
- g_param_spec_string ("std", "Std",
- "Standard (norm) to use", NULL, G_PARAM_READWRITE));
- g_object_class_install_property
- (gobject_class, PROP_INPUT,
- g_param_spec_string ("input",
- "Input",
- "Input/output (channel) to switch to", NULL, G_PARAM_READWRITE));
- g_object_class_install_property
- (gobject_class, PROP_FREQUENCY,
- g_param_spec_ulong ("frequency",
- "Frequency",
- "Frequency to tune to (in Hz)", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_DEVICE,
+ g_param_spec_string ("device", "Device", "Device location",
+ DEFAULT_PROP_DEVICE, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
+ g_param_spec_string ("device-name", "Device name",
+ "Name of the device", DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class, PROP_FLAGS,
+ g_param_spec_flags ("flags", "Flags", "Device type flags",
+ GST_TYPE_V4L2_DEVICE_FLAGS, DEFAULT_PROP_FLAGS, G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class, PROP_STD,
+ g_param_spec_string ("std", "Std", "Standard (norm) to use",
+ DEFAULT_PROP_STD, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_INPUT,
+ g_param_spec_string ("input", "Input",
+ "Input/output (channel) to switch to", DEFAULT_PROP_INPUT,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_FREQUENCY,
+ g_param_spec_ulong ("frequency", "Frequency",
+ "Frequency to tune to (in Hz)", 0, G_MAXULONG, DEFAULT_PROP_FREQUENCY,
+ G_PARAM_READWRITE));
}
GstV4l2Object *
@@ -285,7 +277,7 @@ gst_v4l2_object_new (GstElement * element,
v4l2object->video_fd = -1;
v4l2object->buffer = NULL;
- v4l2object->videodev = g_strdup ("/dev/video0");
+ v4l2object->videodev = g_strdup (DEFAULT_PROP_DEVICE);
v4l2object->stds = NULL;
v4l2object->inputs = NULL;
diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
index 2695abd3b..9c0c51e45 100644
--- a/sys/v4l2/gstv4l2object.h
+++ b/sys/v4l2/gstv4l2object.h
@@ -55,9 +55,9 @@ typedef struct _GstV4l2Object GstV4l2Object;
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
typedef struct _GstV4l2Xv GstV4l2Xv;
-typedef gboolean (*GstV4l2GetInOutFunction) (GstV4l2Object * v4l2object, gint * input);
-typedef gboolean (*GstV4l2SetInOutFunction) (GstV4l2Object * v4l2object, gint input);
-typedef gboolean (*GstV4l2UpdateFpsFunction) (GstV4l2Object * v4l2object);
+typedef gboolean (*GstV4l2GetInOutFunction) (GstV4l2Object * v4l2object, gint * input);
+typedef gboolean (*GstV4l2SetInOutFunction) (GstV4l2Object * v4l2object, gint input);
+typedef gboolean (*GstV4l2UpdateFpsFunction) (GstV4l2Object * v4l2object);
struct _GstV4l2Object {
GstElement * element;
@@ -90,15 +90,14 @@ struct _GstV4l2Object {
gchar *input;
gulong frequency;
-
/* X-overlay */
GstV4l2Xv *xv;
gulong xwindow_id;
/* funcs */
- GstV4l2GetInOutFunction get_in_out_func;
- GstV4l2SetInOutFunction set_in_out_func;
- GstV4l2UpdateFpsFunction update_fps_func;
+ GstV4l2GetInOutFunction get_in_out_func;
+ GstV4l2SetInOutFunction set_in_out_func;
+ GstV4l2UpdateFpsFunction update_fps_func;
};
struct _GstV4l2ObjectClassHelper {
@@ -117,48 +116,38 @@ GType gst_v4l2_object_get_type(void);
PROP_FREQUENCY
-extern GstV4l2Object *
-gst_v4l2_object_new (GstElement * element,
- GstV4l2GetInOutFunction get_in_out_func,
- GstV4l2SetInOutFunction set_in_out_func,
- GstV4l2UpdateFpsFunction update_fps_func);
-
-extern void
-gst_v4l2_object_destroy (GstV4l2Object ** v4l2object);
-
-extern void
-gst_v4l2_object_install_properties_helper (GObjectClass *gobject_class);
-
-extern gboolean
-gst_v4l2_object_set_property_helper (GstV4l2Object *v4l2object,
- guint prop_id, const GValue * value, GParamSpec * pspec);
-extern gboolean
-gst_v4l2_object_get_property_helper (GstV4l2Object *v4l2object,
- guint prop_id, GValue * value, GParamSpec * pspec);
-
-extern gboolean gst_v4l2_object_start (GstV4l2Object *v4l2object);
-extern gboolean gst_v4l2_object_stop (GstV4l2Object *v4l2object);
-
-extern const GList *
-gst_v4l2_probe_get_properties (GstPropertyProbe * probe);
-
-extern void
-gst_v4l2_probe_probe_property (GstPropertyProbe * probe,
- guint prop_id,
- const GParamSpec * pspec,
- GList ** klass_devices);
-
-extern gboolean
-gst_v4l2_probe_needs_probe (GstPropertyProbe * probe,
- guint prop_id,
- const GParamSpec * pspec,
- GList ** klass_devices);
-
-extern GValueArray *
-gst_v4l2_probe_get_values (GstPropertyProbe * probe,
- guint prop_id,
- const GParamSpec * pspec,
- GList ** klass_devices);
+/* create/destroy */
+GstV4l2Object * gst_v4l2_object_new (GstElement * element,
+ GstV4l2GetInOutFunction get_in_out_func,
+ GstV4l2SetInOutFunction set_in_out_func,
+ GstV4l2UpdateFpsFunction update_fps_func);
+void gst_v4l2_object_destroy (GstV4l2Object ** v4l2object);
+
+/* properties */
+void gst_v4l2_object_install_properties_helper (GObjectClass *gobject_class);
+
+gboolean gst_v4l2_object_set_property_helper (GstV4l2Object *v4l2object,
+ guint prop_id, const GValue * value,
+ GParamSpec * pspec);
+gboolean gst_v4l2_object_get_property_helper (GstV4l2Object *v4l2object,
+ guint prop_id, GValue * value,
+ GParamSpec * pspec);
+/* starting/stopping */
+gboolean gst_v4l2_object_start (GstV4l2Object *v4l2object);
+gboolean gst_v4l2_object_stop (GstV4l2Object *v4l2object);
+
+/* probing */
+const GList* gst_v4l2_probe_get_properties (GstPropertyProbe * probe);
+
+void gst_v4l2_probe_probe_property (GstPropertyProbe * probe, guint prop_id,
+ const GParamSpec * pspec,
+ GList ** klass_devices);
+gboolean gst_v4l2_probe_needs_probe (GstPropertyProbe * probe, guint prop_id,
+ const GParamSpec * pspec,
+ GList ** klass_devices);
+GValueArray* gst_v4l2_probe_get_values (GstPropertyProbe * probe, guint prop_id,
+ const GParamSpec * pspec,
+ GList ** klass_devices);
#define GST_IMPLEMENT_V4L2_PROBE_METHODS(Type_Class, interface_as_function) \
\
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 0e5300e29..dc1893a33 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -67,6 +67,7 @@ GST_ELEMENT_DETAILS ("Video (video4linux2/raw) Source",
GST_DEBUG_CATEGORY (v4l2src_debug);
#define GST_CAT_DEFAULT v4l2src_debug
+#define DEFAULT_PROP_USE_FIXED_FPS TRUE
enum
{
@@ -276,6 +277,7 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass)
basesrc_class = GST_BASE_SRC_CLASS (klass);
pushsrc_class = GST_PUSH_SRC_CLASS (klass);
+ gobject_class->dispose = gst_v4l2src_dispose;
gobject_class->set_property = gst_v4l2src_set_property;
gobject_class->get_property = gst_v4l2src_get_property;
@@ -286,7 +288,7 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass)
g_param_spec_boolean ("use-fixed-fps", "Use Fixed FPS",
"Drop/Insert frames to reach a certain FPS (TRUE) "
"or adapt FPS to suit the number of frabbed frames",
- TRUE, G_PARAM_READWRITE));
+ DEFAULT_PROP_USE_FIXED_FPS, G_PARAM_READWRITE));
basesrc_class->get_caps = gst_v4l2src_get_caps;
basesrc_class->set_caps = gst_v4l2src_set_caps;
@@ -294,8 +296,6 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass)
basesrc_class->stop = gst_v4l2src_stop;
pushsrc_class->create = gst_v4l2src_create;
-
- gobject_class->dispose = gst_v4l2src_dispose;
}
static void
@@ -311,7 +311,7 @@ gst_v4l2src_init (GstV4l2Src * v4l2src, GstV4l2SrcClass * klass)
/* fps */
v4l2src->fps_n = 0;
v4l2src->fps_d = 1;
- v4l2src->use_fixed_fps = TRUE;
+ v4l2src->use_fixed_fps = DEFAULT_PROP_USE_FIXED_FPS;
v4l2src->is_capturing = FALSE;
diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h
index a8edda76b..21b290de5 100644
--- a/sys/v4l2/gstv4l2src.h
+++ b/sys/v4l2/gstv4l2src.h
@@ -24,7 +24,6 @@
#ifndef __GST_V4L2SRC_H__
#define __GST_V4L2SRC_H__
-
#include <gstv4l2object.h>
GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
@@ -69,15 +68,6 @@ struct _GstV4l2Buffer
GstV4l2BufferPool *pool;
};
-enum
-{
- QUEUE_STATE_ERROR = -1,
- QUEUE_STATE_READY_FOR_QUEUE, /* the frame is ready to be queued for capture */
- QUEUE_STATE_QUEUED, /* the frame is queued for capture */
- QUEUE_STATE_SYNCED /* the frame is captured */
-};
-
-
struct _GstV4l2Src
{
GstPushSrc pushsrc;
@@ -111,11 +101,10 @@ struct _GstV4l2SrcClass
GstPushSrcClass parent_class;
GList *v4l2_class_devices;
-
};
-
GType gst_v4l2src_get_type (void);
G_END_DECLS
+
#endif /* __GST_V4L2SRC_H__ */
diff --git a/sys/v4l2/gstv4l2tuner.h b/sys/v4l2/gstv4l2tuner.h
index 1021b08cb..40d2e1fc4 100644
--- a/sys/v4l2/gstv4l2tuner.h
+++ b/sys/v4l2/gstv4l2tuner.h
@@ -79,38 +79,34 @@ typedef struct _GstV4l2TunerNormClass {
GstTunerNormClass parent;
} GstV4l2TunerNormClass;
-extern gboolean
-gst_v4l2_tuner_set_channel (GstV4l2Object * v4l2object, GstTunerChannel * channel);
-extern gboolean
-gst_v4l2_tuner_set_norm (GstV4l2Object * v4l2object, GstTunerNorm * norm);
-extern gboolean
-gst_v4l2_tuner_set_frequency (GstV4l2Object * v4l2object,
- GstTunerChannel * channel, gulong frequency);
-
GType gst_v4l2_tuner_channel_get_type (void);
GType gst_v4l2_tuner_norm_get_type (void);
-extern const GList *
-gst_v4l2_tuner_list_channels (GstV4l2Object * v4l2object);
-extern void
-gst_v4l2_tuner_set_channel_and_notify (GstV4l2Object * v4l2object, GstTunerChannel * channel);
-extern GstTunerChannel *
-gst_v4l2_tuner_get_channel (GstV4l2Object * v4l2object);
-
-extern const GList *
-gst_v4l2_tuner_list_norms (GstV4l2Object * v4l2object);
-extern void
-gst_v4l2_tuner_set_norm_and_notify (GstV4l2Object * v4l2object, GstTunerNorm * norm);
-extern GstTunerNorm *
-gst_v4l2_tuner_get_norm (GstV4l2Object * v4l2object);
-
-extern void
-gst_v4l2_tuner_set_frequency_and_notify (GstV4l2Object * v4l2object,
- GstTunerChannel * channel, gulong frequency);
-extern gulong
-gst_v4l2_tuner_get_frequency (GstV4l2Object * v4l2object, GstTunerChannel * channel);
-extern gint
-gst_v4l2_tuner_signal_strength (GstV4l2Object * v4l2object, GstTunerChannel * channel);
+/* channels */
+const GList* gst_v4l2_tuner_list_channels (GstV4l2Object * v4l2object);
+void gst_v4l2_tuner_set_channel_and_notify (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel);
+GstTunerChannel* gst_v4l2_tuner_get_channel (GstV4l2Object * v4l2object);
+gboolean gst_v4l2_tuner_set_channel (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel);
+/* norms */
+const GList* gst_v4l2_tuner_list_norms (GstV4l2Object * v4l2object);
+void gst_v4l2_tuner_set_norm_and_notify (GstV4l2Object * v4l2object,
+ GstTunerNorm * norm);
+GstTunerNorm* gst_v4l2_tuner_get_norm (GstV4l2Object * v4l2object);
+gboolean gst_v4l2_tuner_set_norm (GstV4l2Object * v4l2object,
+ GstTunerNorm * norm);
+/* frequency */
+void gst_v4l2_tuner_set_frequency_and_notify (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel,
+ gulong frequency);
+gint gst_v4l2_tuner_signal_strength (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel);
+gulong gst_v4l2_tuner_get_frequency (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel);
+gboolean gst_v4l2_tuner_set_frequency (GstV4l2Object * v4l2object,
+ GstTunerChannel * channel,
+ gulong frequency);
#define GST_IMPLEMENT_V4L2_TUNER_METHODS(Type, interface_as_function) \
\
diff --git a/sys/v4l2/gstv4l2vidorient.h b/sys/v4l2/gstv4l2vidorient.h
index fecaee56c..965fc0597 100644
--- a/sys/v4l2/gstv4l2vidorient.h
+++ b/sys/v4l2/gstv4l2vidorient.h
@@ -30,27 +30,17 @@
G_BEGIN_DECLS
-extern gboolean
-gst_v4l2_video_orientation_get_hflip (GstV4l2Object *v4l2object, gboolean *flip);
-extern gboolean
-gst_v4l2_video_orientation_get_vflip (GstV4l2Object *v4l2object, gboolean *flip);
-extern gboolean
-gst_v4l2_video_orientation_get_hcenter (GstV4l2Object *v4l2object, gint *center);
-extern gboolean
-gst_v4l2_video_orientation_get_vcenter (GstV4l2Object *v4l2object, gint *center);
+void gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * klass);
-extern gboolean
-gst_v4l2_video_orientation_set_hflip (GstV4l2Object *v4l2object, gboolean flip);
-extern gboolean
-gst_v4l2_video_orientation_set_vflip (GstV4l2Object *v4l2object, gboolean flip);
-extern gboolean
-gst_v4l2_video_orientation_set_hcenter (GstV4l2Object *v4l2object, gint center);
-extern gboolean
-gst_v4l2_video_orientation_set_vcenter (GstV4l2Object *v4l2object, gint center);
+gboolean gst_v4l2_video_orientation_get_hflip (GstV4l2Object *v4l2object, gboolean *flip);
+gboolean gst_v4l2_video_orientation_get_vflip (GstV4l2Object *v4l2object, gboolean *flip);
+gboolean gst_v4l2_video_orientation_get_hcenter (GstV4l2Object *v4l2object, gint *center);
+gboolean gst_v4l2_video_orientation_get_vcenter (GstV4l2Object *v4l2object, gint *center);
-
-extern void
-gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * klass);
+gboolean gst_v4l2_video_orientation_set_hflip (GstV4l2Object *v4l2object, gboolean flip);
+gboolean gst_v4l2_video_orientation_set_vflip (GstV4l2Object *v4l2object, gboolean flip);
+gboolean gst_v4l2_video_orientation_set_hcenter (GstV4l2Object *v4l2object, gint center);
+gboolean gst_v4l2_video_orientation_set_vcenter (GstV4l2Object *v4l2object, gint center);
#define GST_IMPLEMENT_V4L2_VIDORIENT_METHODS(Type, interface_as_function) \
\
diff --git a/sys/v4l2/gstv4l2xoverlay.h b/sys/v4l2/gstv4l2xoverlay.h
index e832d19db..8eac0e2c7 100644
--- a/sys/v4l2/gstv4l2xoverlay.h
+++ b/sys/v4l2/gstv4l2xoverlay.h
@@ -36,8 +36,7 @@ G_BEGIN_DECLS
void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
-extern void
-gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
+void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
#define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function) \
\
diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h
index f9f9ed200..5000cf214 100644
--- a/sys/v4l2/v4l2_calls.h
+++ b/sys/v4l2/v4l2_calls.h
@@ -43,7 +43,7 @@
#define GST_V4L2_CHECK_OPEN(v4l2object) \
if (!GST_V4L2_IS_OPEN(v4l2object)) \
{ \
- GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, TOO_LAZY, \
+ GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
(_("Device is not open.")), (NULL)); \
return FALSE; \
}
@@ -52,7 +52,7 @@
#define GST_V4L2_CHECK_NOT_OPEN(v4l2object) \
if (GST_V4L2_IS_OPEN(v4l2object)) \
{ \
- GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, TOO_LAZY, \
+ GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
(_("Device is open.")), (NULL)); \
return FALSE; \
}
@@ -61,7 +61,7 @@
#define GST_V4L2_CHECK_OVERLAY(v4l2object) \
if (!GST_V4L2_IS_OVERLAY(v4l2object)) \
{ \
- GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, TOO_LAZY, \
+ GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
(NULL), ("Device cannot handle overlay")); \
return FALSE; \
}
diff --git a/sys/v4l2/v4l2src_calls.h b/sys/v4l2/v4l2src_calls.h
index 437c45f52..ea752ae7d 100644
--- a/sys/v4l2/v4l2src_calls.h
+++ b/sys/v4l2/v4l2src_calls.h
@@ -27,45 +27,41 @@
#include "gstv4l2src.h"
#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,
+ guint *fps_n, guint * fps_d);
-gboolean gst_v4l2src_get_capture (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_set_capture (GstV4l2Src * v4l2src,
- struct v4l2_fmtdesc *fmt,
- gint * width, gint * height,
- guint *fps_n, guint * fps_d);
-gboolean gst_v4l2src_capture_init (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_capture_start (GstV4l2Src * v4l2src);
-gint gst_v4l2src_grab_frame (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_capture_init (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_capture_start (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i);
-gboolean gst_v4l2src_capture_stop (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_capture_deinit (GstV4l2Src * v4l2src);
+gint gst_v4l2src_grab_frame (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i);
-gboolean gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src);
-gboolean gst_v4l2src_clear_format_list (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_capture_stop (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_capture_deinit (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);
+gboolean gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src);
+gboolean gst_v4l2src_clear_format_list (GstV4l2Src * v4l2src);
-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);
+/* buffers */
+GstBuffer* gst_v4l2src_buffer_new (GstV4l2Src * v4l2src,
+ guint size, guint8 * data,
+ GstV4l2Buffer * srcbuf);
+void gst_v4l2src_free_buffer (GstBuffer * buffer);
-extern gboolean
-gst_v4l2src_update_fps (GstV4l2Object * v4l2object);
+/* FPS stuff */
+gboolean gst_v4l2src_update_fps (GstV4l2Object * v4l2object);
+gboolean gst_v4l2src_get_fps (GstV4l2Src * v4l2src,
+ guint * fps_n, guint * fps_d);
+gboolean gst_v4l2src_set_fps (GstV4l2Src * v4l2src,
+ guint * fps_n, guint * fps_d);
+GValue* gst_v4l2src_get_fps_list (GstV4l2Src * v4l2src);
-extern gboolean
-gst_v4l2src_get_fps (GstV4l2Src * v4l2src, guint * fps_n, guint * fps_d);
-
-
-extern gboolean
-gst_v4l2src_set_fps (GstV4l2Src * v4l2src, guint * fps_n, guint * fps_d);
-
-GValue *gst_v4l2src_get_fps_list (GstV4l2Src * v4l2src);
-
-GstBuffer *gst_v4l2src_buffer_new (GstV4l2Src * v4l2src,
- guint size, guint8 * data,
- GstV4l2Buffer * srcbuf);
#endif /* __V4L2SRC_CALLS_H__ */