mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
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
This commit is contained in:
parent
c946b4fe6f
commit
34315d2c4b
7 changed files with 43 additions and 30 deletions
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit a5b66304e7abe1440a0f8b0ed232ffbc56e8f3de
|
Subproject commit 6811863fce665ce0a466bc03ee2ac5e2d5f47d28
|
|
@ -33,7 +33,13 @@
|
||||||
#endif
|
#endif
|
||||||
#include "gstv4l2colorbalance.h"
|
#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)
|
gst_v4l2_probe_get_properties (GstPropertyProbe * probe)
|
||||||
{
|
{
|
||||||
GObjectClass *klass = G_OBJECT_GET_CLASS (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;
|
static GList *devices = NULL;
|
||||||
|
|
||||||
if (!init && !check) {
|
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;
|
gint base, n, fd;
|
||||||
|
|
||||||
while (devices) {
|
while (devices) {
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GST_V4L2OBJECT(obj) (GstV4l2Object *)(obj)
|
||||||
|
|
||||||
typedef struct _GstV4l2Object GstV4l2Object;
|
typedef struct _GstV4l2Object GstV4l2Object;
|
||||||
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
|
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
|
||||||
typedef struct _GstV4l2Xv GstV4l2Xv;
|
typedef struct _GstV4l2Xv GstV4l2Xv;
|
||||||
|
@ -110,17 +112,14 @@ struct _GstV4l2ObjectClassHelper {
|
||||||
GType gst_v4l2object_get_type(void);
|
GType gst_v4l2object_get_type(void);
|
||||||
|
|
||||||
|
|
||||||
#define OPEN_V4L2OBJECT_PROPS \
|
#define V4L2_STD_OBJECT_PROPS \
|
||||||
enum { \
|
PROP_DEVICE, \
|
||||||
PROP_0, \
|
|
||||||
PROP_DEVICE, \
|
|
||||||
PROP_DEVICE_NAME, \
|
PROP_DEVICE_NAME, \
|
||||||
PROP_FLAGS, \
|
PROP_FLAGS, \
|
||||||
PROP_STD, \
|
PROP_STD, \
|
||||||
PROP_INPUT, \
|
PROP_INPUT, \
|
||||||
PROP_FREQUENCY
|
PROP_FREQUENCY
|
||||||
|
|
||||||
#define CLOSE_V4L2OBJECT_PROPS };
|
|
||||||
|
|
||||||
extern GstV4l2Object *
|
extern GstV4l2Object *
|
||||||
gst_v4l2object_new (GstElement * element,
|
gst_v4l2object_new (GstElement * element,
|
||||||
|
|
|
@ -67,8 +67,14 @@ GST_DEBUG_CATEGORY (v4l2src_debug);
|
||||||
#define GST_CAT_DEFAULT v4l2src_debug
|
#define GST_CAT_DEFAULT v4l2src_debug
|
||||||
|
|
||||||
|
|
||||||
OPEN_V4L2OBJECT_PROPS, PROP_USE_FIXED_FPS
|
enum
|
||||||
CLOSE_V4L2OBJECT_PROPS static guint32 gst_v4l2_formats[] = {
|
{
|
||||||
|
PROP_0,
|
||||||
|
V4L2_STD_OBJECT_PROPS,
|
||||||
|
PROP_USE_FIXED_FPS
|
||||||
|
};
|
||||||
|
|
||||||
|
static const guint32 gst_v4l2_formats[] = {
|
||||||
/* from Linux 2.6.15 videodev2.h */
|
/* from Linux 2.6.15 videodev2.h */
|
||||||
V4L2_PIX_FMT_RGB332,
|
V4L2_PIX_FMT_RGB332,
|
||||||
V4L2_PIX_FMT_RGB555,
|
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))
|
#define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats))
|
||||||
|
|
||||||
GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src)
|
GST_IMPLEMENT_V4L2_PROBE_METHODS (GstV4l2SrcClass, gst_v4l2src);
|
||||||
|
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src);
|
||||||
GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS (GstV4l2Src, gst_v4l2src)
|
GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src);
|
||||||
|
|
||||||
GST_IMPLEMENT_V4L2_TUNER_METHODS (GstV4l2Src, gst_v4l2src)
|
|
||||||
#ifdef HAVE_XVIDEO
|
#ifdef HAVE_XVIDEO
|
||||||
GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src)
|
GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Src, gst_v4l2src);
|
||||||
#endif
|
#endif
|
||||||
static gboolean
|
|
||||||
gst_v4l2src_iface_supported (GstImplementsInterface * iface,
|
static gboolean
|
||||||
GType iface_type)
|
gst_v4l2src_iface_supported (GstImplementsInterface * iface, GType iface_type)
|
||||||
{
|
{
|
||||||
GstV4l2Object *v4l2object = GST_V4L2SRC (iface)->v4l2object;
|
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_fixate (GstPad * pad, GstCaps * caps);
|
||||||
|
|
||||||
static void
|
static void gst_v4l2src_set_property (GObject * object, guint prop_id,
|
||||||
gst_v4l2src_set_property (GObject * object,
|
const GValue * value, GParamSpec * pspec);
|
||||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
|
||||||
static void gst_v4l2src_get_property (GObject * object, guint prop_id,
|
static void gst_v4l2src_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
|
||||||
#define GST_V4L2_MIN_BUFFERS 2
|
#define GST_V4L2_MIN_BUFFERS 2
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_TYPE_V4L2SRC \
|
#define GST_TYPE_V4L2SRC \
|
||||||
(gst_v4l2src_get_type())
|
(gst_v4l2src_get_type())
|
||||||
#define GST_V4L2SRC(obj) \
|
#define GST_V4L2SRC(obj) \
|
||||||
|
@ -41,8 +42,9 @@ G_BEGIN_DECLS
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4L2SRC,GstV4l2SrcClass))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4L2SRC,GstV4l2SrcClass))
|
||||||
#define GST_IS_V4L2SRC(obj) \
|
#define GST_IS_V4L2SRC(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4L2SRC))
|
(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))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC))
|
||||||
|
|
||||||
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
|
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
|
||||||
typedef struct _GstV4l2Buffer GstV4l2Buffer;
|
typedef struct _GstV4l2Buffer GstV4l2Buffer;
|
||||||
typedef struct _GstV4l2Src GstV4l2Src;
|
typedef struct _GstV4l2Src GstV4l2Src;
|
||||||
|
|
|
@ -46,6 +46,11 @@ struct _GstV4l2Xv
|
||||||
GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
|
GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
|
||||||
#define GST_CAT_DEFAULT v4l2xv_debug
|
#define GST_CAT_DEFAULT v4l2xv_debug
|
||||||
|
|
||||||
|
static void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object,
|
||||||
|
XID xwindow_id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass)
|
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass)
|
||||||
{
|
{
|
||||||
|
@ -92,9 +97,9 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fstat (v4l2object->video_fd, &s) < 0) {
|
if (fstat (v4l2object->video_fd, &s) < 0) {
|
||||||
GST_ELEMENT_ERROR (v4l2object, RESOURCE, GST_RESOURCE_ERROR_NOT_FOUND,
|
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
|
||||||
(_("Cannot identify '%s': %d, %s\n"),
|
(_("Cannot identify '%s': %d, %s\n"), v4l2object->videodev, errno,
|
||||||
v4l2object->videodev, errno, strerror (errno)), GST_ERROR_SYSTEM);
|
strerror (errno)), (NULL));
|
||||||
XCloseDisplay (dpy);
|
XCloseDisplay (dpy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -112,7 +117,8 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
|
||||||
XvFreeAdaptorInfo (ai);
|
XvFreeAdaptorInfo (ai);
|
||||||
|
|
||||||
if (id == 0) {
|
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);
|
XCloseDisplay (dpy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,6 @@ G_BEGIN_DECLS
|
||||||
void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
|
void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
|
||||||
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
|
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
|
||||||
|
|
||||||
extern void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object *v4l2object,
|
|
||||||
XID xwindow_id);
|
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
|
gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue