Commit c092981b authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

Remove v4l plugin

The old v4l interface has been deprecated for years and even
been removed from the kernel headers. If anyone still needs
this plugin, they can resurrect it in gst-plugins-bad, there's
no reason for it to be in -base.
parent 2a94b0eb
......@@ -79,6 +79,9 @@ CRUFT_FILES = \
$(top_builddir)/gst-libs/gst/audio/testchannels \
$(top_builddir)/tools/gst-discoverer
CRUFT_DIRS = \
$(top_srcdir)/sys/v4l \
$(top_srcdir)/tests/examples/v4l
include $(top_srcdir)/common/cruft.mak
......
......@@ -568,51 +568,6 @@ AG_GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], , [
AC_SUBST(XSHM_LIBS)
])
dnl v4l/v4l2 checks have been moved down because they require X
dnl *** Video 4 Linux ***
dnl for information about the header/define, see sys/v4l/gstv4lelement.h
dnl renamed to GST_V4L in accordance with V4L2 below
translit(dnm, m, l) AM_CONDITIONAL(USE_GST_V4L, true)
AG_GST_CHECK_FEATURE(GST_V4L, [Video 4 Linux], video4linux, [
AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_GST_V4L="yes", HAVE_GST_V4L="no", [
#include <sys/types.h>
#define _LINUX_TIME_H
#define __user
#include <linux/videodev.h>
])
dnl we can build v4l without Xv, but then we won't have XOverlay support
if test "x$HAVE_GST_V4L" = "xyes" -a "x$HAVE_XVIDEO" != "xyes"
then
AC_MSG_NOTICE([NO XVIDEO FOUND, VIDEO4LINUX WILL BE BUILT])
AC_MSG_NOTICE([WITHOUT XOVERLAY SUPPORT])
fi
])
# Optional gudev for device probing
AC_ARG_WITH([gudev],
AC_HELP_STRING([--with-gudev],
[device detection with gudev]),
[],
[with_gudev=check])
if test x$HAVE_GST_V4L = xyes; then
if test x$with_gudev != xno; then
PKG_CHECK_MODULES(GUDEV, [ gudev-1.0 >= 143 ],
[ have_gudev=yes
AC_DEFINE(HAVE_GUDEV, 1,
[Whether gudev is available for device detection])
AC_DEFINE([G_UDEV_API_IS_SUBJECT_TO_CHANGE], 1, [I know the API is subject to change.])
], [
have_gudev=no
])
else
have_gudev=no
fi
fi
AC_SUBST(GUDEV_CFLAGS)
AC_SUBST(GUDEV_LIBS)
dnl *** ext plug-ins ***
dnl keep this list sorted alphabetically !
......@@ -938,7 +893,6 @@ gst/volume/Makefile
sys/Makefile
sys/ximage/Makefile
sys/xvimage/Makefile
sys/v4l/Makefile
ext/Makefile
ext/alsa/Makefile
ext/cdparanoia/Makefile
......@@ -1011,7 +965,6 @@ tests/examples/seek/Makefile
tests/examples/snapshot/Makefile
tests/examples/playrec/Makefile
tests/examples/volume/Makefile
tests/examples/v4l/Makefile
tests/files/Makefile
tests/icles/Makefile
tests/icles/playback/Makefile
......
......@@ -95,7 +95,6 @@
<xi:include href="xml/plugin-theora.xml" />
<xi:include href="xml/plugin-typefindfunctions.xml" />
<xi:include href="xml/plugin-uridecodebin.xml" />
<xi:include href="xml/plugin-video4linux.xml" />
<xi:include href="xml/plugin-videorate.xml" />
<xi:include href="xml/plugin-videoscale.xml" />
<xi:include href="xml/plugin-videotestsrc.xml" />
......
<plugin>
<name>video4linux</name>
<description>elements for Video 4 Linux</description>
<filename>../../sys/v4l/.libs/libgstvideo4linux.so</filename>
<basename>libgstvideo4linux.so</basename>
<version>0.10.32.1</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>v4lsrc</name>
<longname>Video (video4linux/raw) Source</longname>
<class>Source/Video</class>
<description>Reads raw frames from a video4linux device</description>
<author>GStreamer maintainers &lt;gstreamer-devel@lists.sourceforge.net&gt;</author>
<pads>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
......@@ -114,7 +114,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/gstreamer-%{majorminor}/libgstvideorate.so
%{_libdir}/gstreamer-%{majorminor}/libgstvideoscale.so
%{_libdir}/gstreamer-%{majorminor}/libgsttcp.so
%{_libdir}/gstreamer-%{majorminor}/libgstvideo4linux.so
%{_libdir}/gstreamer-%{majorminor}/libgstaudioresample.so
%{_libdir}/gstreamer-%{majorminor}/libgstaudiotestsrc.so
%{_libdir}/gstreamer-%{majorminor}/libgstgdp.so
......
......@@ -59,7 +59,7 @@
* ]| Decode an Ogg/Theora file and adjust the framerate to 15 fps before playing.
* To create the test Ogg/Theora file refer to the documentation of theoraenc.
* |[
* gst-launch -v v4lsrc ! videorate ! video/x-raw-yuv,framerate=25/2 ! theoraenc ! oggmux ! filesink location=v4l.ogg
* gst-launch -v v4l2src ! videorate ! video/x-raw-yuv,framerate=25/2 ! theoraenc ! oggmux ! filesink location=recording.ogg
* ]| Capture video from a V4L device, and adjust the stream to 12.5 fps before
* encoding to Ogg/Theora.
* </refsect2>
......
......@@ -20,4 +20,3 @@ gst-libs/gst/tag/tags.c
gst-libs/gst/cdda/gstcddabasesrc.c
gst-libs/gst/pbutils/descriptions.c
gst-libs/gst/pbutils/missing-plugins.c
sys/v4l/v4l_calls.c
if USE_GST_V4L
V4L_DIR=v4l
else
V4L_DIR=
endif
if USE_X
XIMAGE_DIR=ximage
else
......@@ -18,11 +12,9 @@ endif
SUBDIRS = \
$(XIMAGE_DIR) \
$(XVIMAGE_DIR) \
$(V4L_DIR)
$(XVIMAGE_DIR)
DIST_SUBDIRS = \
v4l \
ximage \
xvimage
......
gstv4lelement-marshal.h
gstv4lelement-marshal.c
plugin_LTLIBRARIES = libgstvideo4linux.la
if USE_XVIDEO
xv_source = gstv4lxoverlay.c
xv_libs = $(X_LIBS) $(XVIDEO_LIBS)
else
xv_source =
xv_libs =
endif
libgstvideo4linux_la_SOURCES = \
gstv4l.c \
gstv4lcolorbalance.c \
gstv4lelement.c \
gstv4lsrc.c \
gstv4ltuner.c \
v4l_calls.c \
v4lsrc_calls.c $(xv_source)
# gstv4ljpegsrc.c \
# gstv4lmjpegsrc.c v4lmjpegsrc_calls.c \
# gstv4lmjpegsink.c v4lmjpegsink_calls.c
libgstvideo4linux_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(X_CFLAGS) \
$(GUDEV_CFLAGS)
libgstvideo4linux_la_LIBADD = \
$(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
$(GST_BASE_LIBS) $(GST_LIBS) $(xv_libs) \
$(GUDEV_LIBS)
libgstvideo4linux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvideo4linux_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstv4lelement.h v4l_calls.h \
gstv4lsrc.h v4lsrc_calls.h \
gstv4ljpegsrc.h \
gstv4lmjpegsrc.h v4lmjpegsrc_calls.h \
gstv4lmjpegsink.h v4lmjpegsink_calls.h \
videodev_mjpeg.h \
gstv4ltuner.h gstv4lxoverlay.h \
gstv4lcolorbalance.h
General Idea:
=============
_____/ gstv4lsrc.[ch]
_____/ \ v4lsrc_calls.[ch]
/
gstv4lelement.[ch] _/____________/ gstv4lmjpegsrc.[ch]
v4l_calls.[ch] \ \ v4lmjpegsrc_calls.[ch]
\_____
\_____/ gstv4lmjpegsink.[ch]
\ v4lmjpegsink_calls.[ch]
I.e., all the files on the right are child classes of
the v4lelement 'parent' on the left.
* v4lelement handles generic v4l stuff (picture settings,
audio, norm/input setting, open()/close())
* v4lsrc, v4lmjpegsrc handle the capture specific
functions. Maybe we'd need a v4lmpegsrc too
* v4lmjpegsink handles mjpeg hardware playback of video
Useful Documentation:
=====================
MJPEG/V4L API : ./videodev_mjpeg.h
V4L API : /usr/include/linux/videodev.h or
/usr/src/linux/Documentation/video4linux/API.html or
http://linux.bytesex.org/v4l2/API.html
V4L2 API : /usr/include/linux/videodev2.h or
http://v4l2spec.bytesex.org/
BSD/Meteor API: /usr/include/machine/ioctl_meteor.h
mjpegtools : http://www.sourceforge.net/projects/mjpeg
TODO list (short term):
=======================
* v4lsrc/v4lmjpegsrc/v4l2src: fix interlacing (not handled at all...)
TODO list (long term):
======================
* v4lmpegsrc (*hint* MPEG card needed *hint*)
* v4l2sink
* BSD-videosrc (bktr)
Useful Documentation:
=====================
MJPEG/V4L API : ./videodev_mjpeg.h
V4L API : /usr/include/linux/videodev.h or
/usr/src/linux/Documentation/video4linux/API.html or
http://linux.bytesex.org/v4l2/API.html
V4L2 API : /usr/include/linux/videodev2.h or
http://v4l2spec.bytesex.org/
BSD/Meteor API: /usr/include/machine/ioctl_meteor.h
mjpegtools : http://www.sourceforge.net/projects/mjpeg
Capturing:
==========
* sound is the master clock
* it's probably a good idea to create an audiosource element:
- autodetect alsa/oss
- first try alsa, then oss... they work the same internally
* same for videosource:
- autodetect v4l/v4l2 + mjpeg capabilities
- for this, just open device using v4l2element. On success:
+ use v4l2
- on failure:
+ use v4lelement and query for MJPEG capabilities
+ if that's available, combine caps of v4lmjpegsrc and v4lsrc
* both sources run in their own GstThread with a high priority
* an encoder element takes care of encoding + muxing. A toplevel element
(reverse of spider) is probably a good idea here. How? Don't know...
* format negotiation via filtered caps
* statistics via listening to the frame_{lost,inserted,deleted,captures}
signals and GST_PAD_QUERY_POSITION (gst_pad_query())
/* GStreamer
*
* gstv4l.c: plugin for v4l elements
*
* Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gst/gst-i18n-plugin.h"
#include <gst/gst.h>
#include "gstv4lelement.h"
#include "gstv4lsrc.h"
/* #include "gstv4ljpegsrc.h" */
/* #include "gstv4lmjpegsrc.h" */
/* #include "gstv4lmjpegsink.h" */
GST_DEBUG_CATEGORY (v4l_debug); /* used in v4l_calls.c and v4lsrc_calls.c */
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (v4l_debug, "v4l", 0, "V4L API calls");
if (!gst_element_register (plugin, "v4lsrc", GST_RANK_MARGINAL,
GST_TYPE_V4LSRC))
/* !gst_element_register (plugin, "v4ljpegsrc", */
/* GST_RANK_NONE, GST_TYPE_V4LJPEGSRC) || */
/* !gst_element_register (plugin, "v4lmjpegsrc", */
/* GST_RANK_NONE, GST_TYPE_V4LMJPEGSRC) || */
/* !gst_element_register (plugin, "v4lmjpegsink", */
/* GST_RANK_NONE, GST_TYPE_V4LMJPEGSINK)) */
return FALSE;
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"video4linux",
"elements for Video 4 Linux",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
/* GStreamer
*
* gstv4lcolorbalance.c: color balance interface implementation for V4L
*
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include "gstv4lcolorbalance.h"
#include "gstv4lelement.h"
static void
gst_v4l_color_balance_channel_class_init (GstV4lColorBalanceChannelClass *
klass);
static void gst_v4l_color_balance_channel_init (GstV4lColorBalanceChannel *
channel);
static const GList *gst_v4l_color_balance_list_channels (GstColorBalance *
balance);
static void gst_v4l_color_balance_set_value (GstColorBalance * balance,
GstColorBalanceChannel * channel, gint value);
static gint gst_v4l_color_balance_get_value (GstColorBalance * balance,
GstColorBalanceChannel * channel);
static GstColorBalanceChannelClass *parent_class = NULL;
GType
gst_v4l_color_balance_channel_get_type (void)
{
static GType gst_v4l_color_balance_channel_type = 0;
if (!gst_v4l_color_balance_channel_type) {
static const GTypeInfo v4l_tuner_channel_info = {
sizeof (GstV4lColorBalanceChannelClass),
NULL,
NULL,
(GClassInitFunc) gst_v4l_color_balance_channel_class_init,
NULL,
NULL,
sizeof (GstV4lColorBalanceChannel),
0,
(GInstanceInitFunc) gst_v4l_color_balance_channel_init,
NULL
};
gst_v4l_color_balance_channel_type =
g_type_register_static (GST_TYPE_COLOR_BALANCE_CHANNEL,
"GstV4lColorBalanceChannel", &v4l_tuner_channel_info, 0);
}
return gst_v4l_color_balance_channel_type;
}
static void
gst_v4l_color_balance_channel_class_init (GstV4lColorBalanceChannelClass *
klass)
{
parent_class = g_type_class_peek_parent (klass);
}
static void
gst_v4l_color_balance_channel_init (GstV4lColorBalanceChannel * channel)
{
channel->index = 0;
}
void
gst_v4l_color_balance_interface_init (GstColorBalanceClass * klass)
{
GST_COLOR_BALANCE_TYPE (klass) = GST_COLOR_BALANCE_HARDWARE;
/* default virtual functions */
klass->list_channels = gst_v4l_color_balance_list_channels;
klass->set_value = gst_v4l_color_balance_set_value;
klass->get_value = gst_v4l_color_balance_get_value;
}
static G_GNUC_UNUSED gboolean
gst_v4l_color_balance_contains_channel (GstV4lElement * v4lelement,
GstV4lColorBalanceChannel * v4lchannel)
{
const GList *item;
for (item = v4lelement->colors; item != NULL; item = item->next)
if (item->data == v4lchannel)
return TRUE;
return FALSE;
}
static const GList *
gst_v4l_color_balance_list_channels (GstColorBalance * balance)
{
return GST_V4LELEMENT (balance)->colors;
}
static void
gst_v4l_color_balance_set_value (GstColorBalance * balance,
GstColorBalanceChannel * channel, gint value)
{
GstV4lElement *v4lelement = GST_V4LELEMENT (balance);
GstV4lColorBalanceChannel *v4lchannel =
GST_V4L_COLOR_BALANCE_CHANNEL (channel);
/* assert that we're opened and that we're using a known item */
g_return_if_fail (GST_V4L_IS_OPEN (v4lelement));
g_return_if_fail (gst_v4l_color_balance_contains_channel (v4lelement,
v4lchannel));
gst_v4l_set_picture (v4lelement, v4lchannel->index, value);
}
static gint
gst_v4l_color_balance_get_value (GstColorBalance * balance,
GstColorBalanceChannel * channel)
{
GstV4lElement *v4lelement = GST_V4LELEMENT (balance);
GstV4lColorBalanceChannel *v4lchannel =
GST_V4L_COLOR_BALANCE_CHANNEL (channel);
gint value;
/* assert that we're opened and that we're using a known item */
g_return_val_if_fail (GST_V4L_IS_OPEN (v4lelement), 0);
g_return_val_if_fail (gst_v4l_color_balance_contains_channel (v4lelement,
v4lchannel), 0);
if (!gst_v4l_get_picture (v4lelement, v4lchannel->index, &value))
return 0;
return value;
}
/* GStreamer
*
* gstv4lcolorbalance.h: color balance interface implementation for V4L
*
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_V4L_COLOR_BALANCE_H__
#define __GST_V4L_COLOR_BALANCE_H__
#include <gst/gst.h>
#include <gst/interfaces/colorbalance.h>
#include "v4l_calls.h"
G_BEGIN_DECLS
#define GST_TYPE_V4L_COLOR_BALANCE_CHANNEL \
(gst_v4l_color_balance_channel_get_type ())
#define GST_V4L_COLOR_BALANCE_CHANNEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L_COLOR_BALANCE_CHANNEL, \
GstV4lColorBalanceChannel))
#define GST_V4L_COLOR_BALANCE_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_V4L_COLOR_BALANCE_CHANNEL, \
GstV4lColorBalanceChannelClass))
#define GST_IS_V4L_COLOR_BALANCE_CHANNEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L_COLOR_BALANCE_CHANNEL))
#define GST_IS_V4L_COLOR_BALANCE_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L_COLOR_BALANCE_CHANNEL))
typedef struct _GstV4lColorBalanceChannel {
GstColorBalanceChannel parent;
GstV4lPictureType index;
} GstV4lColorBalanceChannel;
typedef struct _GstV4lColorBalanceChannelClass {
GstColorBalanceChannelClass parent;
} GstV4lColorBalanceChannelClass;
GType gst_v4l_color_balance_channel_get_type (void);
void gst_v4l_color_balance_interface_init (GstColorBalanceClass *klass);
#endif /* __GST_V4L_COLOR_BALANCE_H__ */
This diff is collapsed.
/* GStreamer
*
* gstv4lelement.h: base class for V4L elements
*
* Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_V4LELEMENT_H__
#define __GST_V4LELEMENT_H__
/* Because of some really cool feature in video4linux1, also known as
* 'not including sys/types.h and sys/time.h', we had to include it
* ourselves. In all their intelligence, these people decided to fix
* this in the next version (video4linux2) in such a cool way that it
* breaks all compilations of old stuff...
* The real problem is actually that linux/time.h doesn't use proper
* macro checks before defining types like struct timeval. The proper
* fix here is to either fuck the kernel header (which is what we do
* by defining _LINUX_TIME_H, an innocent little hack) or by fixing it
* upstream, which I'll consider doing later on. If you get compiler
* errors here, check your linux/time.h && sys/time.h header setup.
*/
#include <sys/types.h>
#define _LINUX_TIME_H
#include <linux/videodev.h>
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
G_BEGIN_DECLS
#define GST_TYPE_V4LELEMENT \
(gst_v4lelement_get_type())
#define GST_V4LELEMENT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4LELEMENT,GstV4lElement))
#define GST_V4LELEMENT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4LELEMENT,GstV4lElementClass))
#define GST_IS_V4LELEMENT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4LELEMENT))
#define GST_IS_V4LELEMENT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4LELEMENT))
#define GST_V4LELEMENT_GET_CLASS(klass) \
(G_TYPE_INSTANCE_GET_CLASS ((klass), GST_TYPE_V4LELEMENT, GstV4lElementClass))
typedef struct _GstV4lElement GstV4lElement;
typedef struct _GstV4lElementClass GstV4lElementClass;
typedef struct _GstV4lXv GstV4lXv;
struct _GstV4lElement {
GstPushSrc element;
/* the video device */
char *videodev;
/* the video-device's file descriptor */
gint video_fd;
/* the video buffer (mmap()'ed) */
guint8 *buffer;
/* the video device's capabilities */
struct video_capability vcap;
/* the video device's window properties */
struct video_window vwin;
/* some more info about the current input's capabilities */
struct video_channel vchan;
/* lists... */
GList *colors;
GList *norms;
GList *channels;
/* X-overlay */
GstV4lXv *xv;
gulong xwindow_id;
};
struct _GstV4lElementClass {
GstPushSrcClass parent_class;
/* probed devices */
GList *devices;
/* actions */
gboolean (*get_attribute) (GstElement *element,
const gchar *attr_name,
int *value);
gboolean (*set_attribute) (GstElement *element,
const gchar *attr_name,
const int value);
};
GType gst_v4lelement_get_type(void);
G_END_DECLS
#endif /* __GST_V4LELEMENT_H__ */
/* GStreamer
*
* gstv4ljpegsrc.c: V4L source element for JPEG cameras
*
* Copyright (C) 2004-2005 Jan Schmidt <thaytan@mad.scientist.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
e Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <sys/time.h>
#include "gstv4ljpegsrc.h"
#include "v4lsrc_calls.h"
GST_DEBUG_CATEGORY_STATIC (v4ljpegsrc_debug);
#define GST_CAT_DEFAULT v4ljpegsrc_debug
/* init functions */
static void gst_v4ljpegsrc_base_init (gpointer g_class);
static void gst_v4ljpegsrc_class_init (GstV4lJpegSrcClass * klass);
static void gst_v4ljpegsrc_init (GstV4lJpegSrc * v4ljpegsrc);
/* buffer functions */
static GstPadLinkReturn gst_v4ljpegsrc_src_link (GstPad * pad,
const GstCaps * caps);
static GstCaps *gst_v4ljpegsrc_getcaps (GstPad * pad);
static GstData *gst_v4ljpegsrc_get (GstPad * pad);
static GstElementClass *parent_class = NULL;
GType
gst_v4ljpegsrc_get_type (void)
{
static GType v4ljpegsrc_type = 0;
if (!v4ljpegsrc_type) {
static const GTypeInfo v4ljpegsrc_info = {
sizeof (GstV4lJpegSrcClass),
gst_v4ljpegsrc_base_init,
NULL,
(GClassInitFunc) gst_v4ljpegsrc_class_init,
NULL,
NULL,
sizeof (GstV4lJpegSrc),
0,
(GInstanceInitFunc) gst_v4ljpegsrc_init,
NULL
};
v4ljpegsrc_type =
g_type_register_static (GST_TYPE_V4LSRC, "GstV4lJpegSrc",