We are currently experiencing downtime impacting viewing & cloning the Mesa repo, and some GitLab pages returning 503. Please see #freedesktop on IRC for more updates.

Commit 34315d2c authored by Stefan Kost's avatar Stefan Kost

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
parent c946b4fe
common @ 6811863f
Subproject commit a5b66304e7abe1440a0f8b0ed232ffbc56e8f3de
Subproject commit 6811863fce665ce0a466bc03ee2ac5e2d5f47d28
......@@ -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) {
......
......@@ -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,
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment