summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2006-05-18 19:34:47 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2006-05-18 19:34:47 +0000
commit957ad05fa6c44ef11181ffcaee1ccc4a03e5cb30 (patch)
tree22fcffeca841381e9e1f59141e378c8547f7e068 /sys
parentfb76f0b1b59c1862521c174a57786b4e9373f415 (diff)
downloadgst-plugins-bad-957ad05fa6c44ef11181ffcaee1ccc4a03e5cb30.tar.gz
gst-plugins-bad-957ad05fa6c44ef11181ffcaee1ccc4a03e5cb30.tar.bz2
gst-plugins-bad-957ad05fa6c44ef11181ffcaee1ccc4a03e5cb30.zip
configure.ac: Check for X11
Original commit message from CVS: * configure.ac: Check for X11 * sys/v4l2/gstv4l2object.c: (gst_v4l2_class_probe_devices): * sys/v4l2/gstv4l2object.h: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_iface_supported): * sys/v4l2/gstv4l2src.h: * sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open): * sys/v4l2/gstv4l2xoverlay.h: Code cleanups, fix debug macros
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c10
-rw-r--r--sys/v4l2/gstv4l2object.h9
-rw-r--r--sys/v4l2/gstv4l2src.c31
-rw-r--r--sys/v4l2/gstv4l2src.h4
-rw-r--r--sys/v4l2/gstv4l2xoverlay.c14
-rw-r--r--sys/v4l2/gstv4l2xoverlay.h3
6 files changed, 42 insertions, 29 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 941f9a6a..e7485ebf 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -33,7 +33,13 @@
#endif
#include "gstv4l2colorbalance.h"
-OPEN_V4L2OBJECT_PROPS CLOSE_V4L2OBJECT_PROPS const GList *
+enum
+{
+ PROP_0,
+ V4L2_STD_OBJECT_PROPS,
+};
+
+const GList *
gst_v4l2_probe_get_properties (GstPropertyProbe * probe)
{
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
@@ -60,7 +66,7 @@ gst_v4l2_class_probe_devices (GstElementClass * klass, gboolean check,
static GList *devices = NULL;
if (!init && !check) {
- gchar *dev_base[] = { "/dev/video", "/dev/v4l2/video", NULL };
+ const gchar *dev_base[] = { "/dev/video", "/dev/v4l2/video", NULL };
gint base, n, fd;
while (devices) {
diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
index 37552185..5692b26e 100644
--- a/sys/v4l2/gstv4l2object.h
+++ b/sys/v4l2/gstv4l2object.h
@@ -49,6 +49,8 @@
G_BEGIN_DECLS
+#define GST_V4L2OBJECT(obj) (GstV4l2Object *)(obj)
+
typedef struct _GstV4l2Object GstV4l2Object;
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
typedef struct _GstV4l2Xv GstV4l2Xv;
@@ -110,17 +112,14 @@ struct _GstV4l2ObjectClassHelper {
GType gst_v4l2object_get_type(void);
-#define OPEN_V4L2OBJECT_PROPS \
- enum { \
- PROP_0, \
- PROP_DEVICE, \
+#define V4L2_STD_OBJECT_PROPS \
+ PROP_DEVICE, \
PROP_DEVICE_NAME, \
PROP_FLAGS, \
PROP_STD, \
PROP_INPUT, \
PROP_FREQUENCY
-#define CLOSE_V4L2OBJECT_PROPS };
extern GstV4l2Object *
gst_v4l2object_new (GstElement * element,
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index b38d34ea..6dfbf0b3 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -67,8 +67,14 @@ GST_DEBUG_CATEGORY (v4l2src_debug);
#define GST_CAT_DEFAULT v4l2src_debug
-OPEN_V4L2OBJECT_PROPS, PROP_USE_FIXED_FPS
- CLOSE_V4L2OBJECT_PROPS static guint32 gst_v4l2_formats[] = {
+enum
+{
+ PROP_0,
+ V4L2_STD_OBJECT_PROPS,
+ PROP_USE_FIXED_FPS
+};
+
+static const guint32 gst_v4l2_formats[] = {
/* from Linux 2.6.15 videodev2.h */
V4L2_PIX_FMT_RGB332,
V4L2_PIX_FMT_RGB555,
@@ -126,17 +132,15 @@ OPEN_V4L2OBJECT_PROPS, PROP_USE_FIXED_FPS
#define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats))
-GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src)
-
- GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src)
-
- GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src)
+GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
+GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
+GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src);
#ifdef HAVE_XVIDEO
- GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src)
+GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src);
#endif
- static gboolean
- gst_v4l2src_iface_supported (GstImplementsInterface * iface,
- GType iface_type)
+
+static gboolean
+gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
{
GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object;
@@ -225,9 +229,8 @@ static GstFlowReturn gst_v4l2src_create (GstPushSrc * src, GstBuffer ** out);
static void gst_v4l2src_fixate (GstPad * pad, GstCaps * caps);
-static void
-gst_v4l2src_set_property (GObject * object,
- guint prop_id, const GValue * value, GParamSpec * pspec);
+static void gst_v4l2src_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
static void gst_v4l2src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h
index 54500ac0..c20ee22c 100644
--- a/sys/v4l2/gstv4l2src.h
+++ b/sys/v4l2/gstv4l2src.h
@@ -33,6 +33,7 @@ GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
#define GST_V4L2_MIN_BUFFERS 2
G_BEGIN_DECLS
+
#define GST_TYPE_V4L2SRC \
(gst_v4l2src_get_type())
#define GST_V4L2SRC(obj) \
@@ -41,8 +42,9 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4L2SRC,GstV4l2SrcClass))
#define GST_IS_V4L2SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4L2SRC))
-#define GST_IS_V4L2SRC_CLASS(obj) \
+#define GST_IS_V4L2SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC))
+
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
typedef struct _GstV4l2Buffer GstV4l2Buffer;
typedef struct _GstV4l2Src GstV4l2Src;
diff --git a/sys/v4l2/gstv4l2xoverlay.c b/sys/v4l2/gstv4l2xoverlay.c
index bcf095e7..fa2154fa 100644
--- a/sys/v4l2/gstv4l2xoverlay.c
+++ b/sys/v4l2/gstv4l2xoverlay.c
@@ -46,6 +46,11 @@ struct _GstV4l2Xv
GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
#define GST_CAT_DEFAULT v4l2xv_debug
+static void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object,
+ XID xwindow_id);
+
+
+
void
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass)
{
@@ -92,9 +97,9 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
return;
}
if (fstat (v4l2object->video_fd, &s) < 0) {
- GST_ELEMENT_ERROR (v4l2object, RESOURCE, GST_RESOURCE_ERROR_NOT_FOUND,
- (_("Cannot identify '%s': %d, %s\n"),
- v4l2object->videodev, errno, strerror (errno)), GST_ERROR_SYSTEM);
+ GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
+ (_("Cannot identify '%s': %d, %s\n"), v4l2object->videodev, errno,
+ strerror (errno)), (NULL));
XCloseDisplay (dpy);
return;
}
@@ -112,7 +117,8 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
XvFreeAdaptorInfo (ai);
if (id == 0) {
- GST_WARNING (v4l2object, "Did not find XvPortID for device - no overlay");
+ GST_WARNING_OBJECT (v4l2object->element,
+ "Did not find XvPortID for device - no overlay");
XCloseDisplay (dpy);
return;
}
diff --git a/sys/v4l2/gstv4l2xoverlay.h b/sys/v4l2/gstv4l2xoverlay.h
index 1f39cc75..d8add592 100644
--- a/sys/v4l2/gstv4l2xoverlay.h
+++ b/sys/v4l2/gstv4l2xoverlay.h
@@ -35,9 +35,6 @@ G_BEGIN_DECLS
void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
-extern void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object *v4l2object,
- XID xwindow_id);
-
extern void
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);