3 * gstv4lelement.h: base class for V4L elements
5 * Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_V4LELEMENT_H__
24 #define __GST_V4LELEMENT_H__
26 /* Because of some really cool feature in video4linux1, also known as
27 * 'not including sys/types.h and sys/time.h', we had to include it
28 * ourselves. In all their intelligence, these people decided to fix
29 * this in the next version (video4linux2) in such a cool way that it
30 * breaks all compilations of old stuff...
31 * The real problem is actually that linux/time.h doesn't use proper
32 * macro checks before defining types like struct timeval. The proper
33 * fix here is to either fuck the kernel header (which is what we do
34 * by defining _LINUX_TIME_H, an innocent little hack) or by fixing it
35 * upstream, which I'll consider doing later on. If you get compiler
36 * errors here, check your linux/time.h && sys/time.h header setup.
38 #include <sys/types.h>
40 #include <linux/videodev.h>
43 #include <gst/base/gstpushsrc.h>
48 #define GST_TYPE_V4LELEMENT \
49 (gst_v4lelement_get_type())
50 #define GST_V4LELEMENT(obj) \
51 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4LELEMENT,GstV4lElement))
52 #define GST_V4LELEMENT_CLASS(klass) \
53 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4LELEMENT,GstV4lElementClass))
54 #define GST_IS_V4LELEMENT(obj) \
55 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4LELEMENT))
56 #define GST_IS_V4LELEMENT_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4LELEMENT))
58 #define GST_V4LELEMENT_GET_CLASS(klass) \
59 (G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_V4LELEMENT, GstV4lElementClass))
61 typedef struct _GstV4lElement GstV4lElement;
62 typedef struct _GstV4lElementClass GstV4lElementClass;
63 typedef struct _GstV4lXv GstV4lXv;
65 struct _GstV4lElement {
68 /* the video device */
71 /* the video-device's file descriptor */
74 /* the video buffer (mmap()'ed) */
77 /* the video device's capabilities */
78 struct video_capability vcap;
80 /* the video device's window properties */
81 struct video_window vwin;
83 /* some more info about the current input's capabilities */
84 struct video_channel vchan;
96 struct _GstV4lElementClass {
97 GstPushSrcClass parent_class;
103 gboolean (*get_attribute) (GstElement *element,
104 const gchar *attr_name,
106 gboolean (*set_attribute) (GstElement *element,
107 const gchar *attr_name,
111 GType gst_v4lelement_get_type(void);
116 #endif /* __GST_V4LELEMENT_H__ */