summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-12-18 08:38:33 +0000
committerDavid Schleef <ds@schleef.org>2003-12-18 08:38:33 +0000
commit70a4a0e00218745b2bf7ad0b145fe9a967981cb4 (patch)
treeb053dbe2c3629c6380fe87478fa588e92773dde1
parent55ad1b72402100a5107d112996e0477ad65ff4ba (diff)
downloadgstreamer-plugins-bad-70a4a0e00218745b2bf7ad0b145fe9a967981cb4.tar.gz
Merge HEAD from CAPS-ROOT to CAPS-MERGE-3
Original commit message from CVS: Merge HEAD from CAPS-ROOT to CAPS-MERGE-3
m---------common0
-rw-r--r--gst/cdxaparse/gstcdxaparse.c1
-rw-r--r--gst/chart/gstchart.c1
-rw-r--r--gst/deinterlace/gstdeinterlace.c1
-rw-r--r--gst/festival/gstfestival.c1
-rw-r--r--gst/filter/gstfilter.c1
-rw-r--r--gst/flx/gstflxdec.c1
-rw-r--r--gst/mixmatrix/mixmatrix.c1
-rw-r--r--gst/modplug/gstmodplug.cc2
-rw-r--r--gst/mpeg1sys/gstmpeg1systemencode.c1
-rw-r--r--gst/mpeg1videoparse/gstmp1videoparse.c1
-rw-r--r--gst/mpeg2sub/gstmpeg2subt.c2
-rw-r--r--gst/mpegaudioparse/gstmpegaudioparse.c1
-rw-r--r--gst/overlay/gstoverlay.c1
-rw-r--r--gst/passthrough/gstpassthrough.c1
-rw-r--r--gst/playondemand/gstplayondemand.c1
-rw-r--r--gst/qtdemux/qtdemux.c1
-rw-r--r--gst/rtjpeg/gstrtjpeg.c1
-rw-r--r--gst/smooth/gstsmooth.c1
-rw-r--r--gst/smpte/gstsmpte.c1
-rw-r--r--gst/spectrum/gstspectrum.c1
-rw-r--r--gst/speed/gstspeed.c1
-rw-r--r--gst/stereo/gststereo.c1
-rw-r--r--gst/switch/Makefile.am9
-rw-r--r--gst/switch/gstswitch.c337
-rw-r--r--gst/switch/gstswitch.h67
-rw-r--r--gst/vbidec/gstvbidec.c1
-rw-r--r--gst/videocrop/gstvideocrop.c1
-rw-r--r--gst/videodrop/gstvideodrop.c107
-rw-r--r--gst/videodrop/gstvideodrop.h5
-rw-r--r--gst/y4m/gsty4mencode.c1
-rw-r--r--sys/cdrom/gstcdplayer.c1
-rw-r--r--sys/dxr3/dxr3init.c1
-rw-r--r--sys/glsink/gstglsink.c1
-rw-r--r--sys/qcam/gstqcamsrc.c1
-rw-r--r--sys/v4l2/gstv4l2.c1
-rw-r--r--sys/v4l2/gstv4l2element.c8
-rw-r--r--sys/vcd/vcdsrc.c1
38 files changed, 512 insertions, 54 deletions
diff --git a/common b/common
-Subproject 9f37b3e515260c7b294222a502b2cc75dd0983b
+Subproject cd5507ae3df8dc48c07df9e37878846b6b79faa
diff --git a/gst/cdxaparse/gstcdxaparse.c b/gst/cdxaparse/gstcdxaparse.c
index c8771dac6..0cfa010e1 100644
--- a/gst/cdxaparse/gstcdxaparse.c
+++ b/gst/cdxaparse/gstcdxaparse.c
@@ -328,7 +328,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN)
diff --git a/gst/chart/gstchart.c b/gst/chart/gstchart.c
index 2406db0dc..c3c672288 100644
--- a/gst/chart/gstchart.c
+++ b/gst/chart/gstchart.c
@@ -403,6 +403,5 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN)
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index e58e1dbf7..2a73ab01e 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -377,7 +377,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
);
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c
index ad3a0c5c6..d59a85186 100644
--- a/gst/festival/gstfestival.c
+++ b/gst/festival/gstfestival.c
@@ -450,7 +450,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
);
diff --git a/gst/filter/gstfilter.c b/gst/filter/gstfilter.c
index 85c158764..7a5d4248b 100644
--- a/gst/filter/gstfilter.c
+++ b/gst/filter/gstfilter.c
@@ -78,7 +78,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
);
diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c
index e7088d61c..3fb0598c8 100644
--- a/gst/flx/gstflxdec.c
+++ b/gst/flx/gstflxdec.c
@@ -651,7 +651,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/mixmatrix/mixmatrix.c b/gst/mixmatrix/mixmatrix.c
index 6bbdf1d78..726f9e020 100644
--- a/gst/mixmatrix/mixmatrix.c
+++ b/gst/mixmatrix/mixmatrix.c
@@ -516,7 +516,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index a6a4f2c92..75acae236 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -807,8 +807,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- "(c) 2001 Kenton Varda <temporal@gauge3d.org>\n"
- "(c) 2001 Olivier Lapicque <olivierl@jps.net>",
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/mpeg1sys/gstmpeg1systemencode.c b/gst/mpeg1sys/gstmpeg1systemencode.c
index 94f01d1d8..52f88b448 100644
--- a/gst/mpeg1sys/gstmpeg1systemencode.c
+++ b/gst/mpeg1sys/gstmpeg1systemencode.c
@@ -567,7 +567,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"GPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/mpeg1videoparse/gstmp1videoparse.c b/gst/mpeg1videoparse/gstmp1videoparse.c
index c37ce61f7..51a29a4e5 100644
--- a/gst/mpeg1videoparse/gstmp1videoparse.c
+++ b/gst/mpeg1videoparse/gstmp1videoparse.c
@@ -507,7 +507,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/mpeg2sub/gstmpeg2subt.c b/gst/mpeg2sub/gstmpeg2subt.c
index 46681c6e6..c98d9beed 100644
--- a/gst/mpeg2sub/gstmpeg2subt.c
+++ b/gst/mpeg2sub/gstmpeg2subt.c
@@ -439,8 +439,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- "(c) 2001 Samuel Hocevar <sam@via.ecp.fr>\n"
- "(c) 2001 Michel Lespinasse <walken@via.ecp.fr>",
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c
index 193673fca..cc56bb013 100644
--- a/gst/mpegaudioparse/gstmpegaudioparse.c
+++ b/gst/mpegaudioparse/gstmpegaudioparse.c
@@ -583,7 +583,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/overlay/gstoverlay.c b/gst/overlay/gstoverlay.c
index 8c7cb59b3..a027ab89b 100644
--- a/gst/overlay/gstoverlay.c
+++ b/gst/overlay/gstoverlay.c
@@ -357,7 +357,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/passthrough/gstpassthrough.c b/gst/passthrough/gstpassthrough.c
index 4f0b1a1d1..9e1e6fa5b 100644
--- a/gst/passthrough/gstpassthrough.c
+++ b/gst/passthrough/gstpassthrough.c
@@ -322,7 +322,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/playondemand/gstplayondemand.c b/gst/playondemand/gstplayondemand.c
index 8ad1abc99..3f01165a9 100644
--- a/gst/playondemand/gstplayondemand.c
+++ b/gst/playondemand/gstplayondemand.c
@@ -568,7 +568,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 541817592..2bbe5819c 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -252,7 +252,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/rtjpeg/gstrtjpeg.c b/gst/rtjpeg/gstrtjpeg.c
index e51542916..2b9ff37d3 100644
--- a/gst/rtjpeg/gstrtjpeg.c
+++ b/gst/rtjpeg/gstrtjpeg.c
@@ -44,7 +44,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"GPL",
- "(c) 2000 Justin Schoeman <justin@suntiger.ee.up.ac.za>",
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c
index be41e88ea..c30507d62 100644
--- a/gst/smooth/gstsmooth.c
+++ b/gst/smooth/gstsmooth.c
@@ -350,7 +350,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c
index a318bdc34..ebd5d3f12 100644
--- a/gst/smpte/gstsmpte.c
+++ b/gst/smpte/gstsmpte.c
@@ -482,7 +482,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"LGPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c
index 4b45ad7b0..920d69ee2 100644
--- a/gst/spectrum/gstspectrum.c
+++ b/gst/spectrum/gstspectrum.c
@@ -212,7 +212,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c
index a8fa40f7c..1b7bcf690 100644
--- a/gst/speed/gstspeed.c
+++ b/gst/speed/gstspeed.c
@@ -317,7 +317,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/stereo/gststereo.c b/gst/stereo/gststereo.c
index 0e315c7ce..f2e9a79d4 100644
--- a/gst/stereo/gststereo.c
+++ b/gst/stereo/gststereo.c
@@ -233,7 +233,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/switch/Makefile.am b/gst/switch/Makefile.am
new file mode 100644
index 000000000..fcac882e2
--- /dev/null
+++ b/gst/switch/Makefile.am
@@ -0,0 +1,9 @@
+
+plugin_LTLIBRARIES = libgstswitch.la
+
+libgstswitch_la_SOURCES = gstswitch.c
+libgstswitch_la_CFLAGS = $(GST_CFLAGS)
+libgstswitch_la_LIBADD =
+libgstswitch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+
+noinst_HEADERS = gstswitch.h
diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c
new file mode 100644
index 000000000..6b6ad06ca
--- /dev/null
+++ b/gst/switch/gstswitch.c
@@ -0,0 +1,337 @@
+/* GStreamer
+ * Copyright (C) 2003 Julien Moutte <julien@moutte.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
+
+/* Object header */
+#include "gstswitch.h"
+
+enum {
+ ARG_0,
+ ARG_NB_SOURCES,
+ ARG_ACTIVE_SOURCE
+};
+
+/* ElementFactory information */
+static GstElementDetails gst_switch_details = GST_ELEMENT_DETAILS (
+ "Switch",
+ "Generic",
+ "N-to-1 input switching",
+ "Julien Moutte <julien@moutte.net>"
+);
+
+static GstStaticPadTemplate gst_switch_sink_factory =
+GST_STATIC_PAD_TEMPLATE (
+ "sink%d",
+ GST_PAD_SINK,
+ GST_PAD_REQUEST,
+ GST_STATIC_CAPS2_ANY
+);
+
+static GstElementClass *parent_class = NULL;
+
+/* ============================================================= */
+/* */
+/* Private Methods */
+/* */
+/* ============================================================= */
+
+static GstPad*
+gst_switch_request_new_pad (GstElement *element,
+ GstPadTemplate *templ,
+ const gchar *unused)
+{
+ char *name = NULL;
+ GstPad *sinkpad = NULL;
+ GstSwitch *gstswitch = NULL;
+ GstSwitchPad *switchpad = NULL;
+
+ g_return_val_if_fail (GST_IS_SWITCH (element), NULL);
+
+ if (templ->direction != GST_PAD_SINK) {
+ g_warning ("gstswitch: requested a non sink pad\n");
+ return NULL;
+ }
+
+ gstswitch = GST_SWITCH (element);
+
+ name = g_strdup_printf ("sink%d", gstswitch->nb_sinkpads);
+
+ sinkpad = gst_pad_new_from_template (templ, name);
+
+ if (name)
+ g_free (name);
+
+ gst_element_add_pad (GST_ELEMENT (gstswitch), sinkpad);
+
+ switchpad = g_new0 (GstSwitchPad, 1);
+ if (!switchpad)
+ return NULL;
+
+ switchpad->sinkpad = sinkpad;
+ switchpad->data = NULL;
+ switchpad->forwarded = FALSE;
+
+ gstswitch->sinkpads = g_list_insert (gstswitch->sinkpads, switchpad,
+ gstswitch->nb_sinkpads);
+ gstswitch->nb_sinkpads++;
+
+ return sinkpad;
+}
+
+static gboolean
+gst_switch_poll_sinkpads (GstSwitch *gstswitch)
+{
+ GList *pads;
+
+ g_return_val_if_fail (gstswitch != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_SWITCH (gstswitch), FALSE);
+
+ pads = gstswitch->sinkpads;
+
+ while (pads) {
+ GstSwitchPad *switchpad = pads->data;
+ GstData *data = gst_pad_pull (switchpad->sinkpad);
+ if (GST_IS_EVENT (data) &&
+ (GST_EVENT_TYPE (GST_EVENT (data)) == GST_EVENT_EOS)) {
+ /* If that data was not forwarded we unref it */
+ if (!switchpad->forwarded && switchpad->data) {
+ gst_data_unref (switchpad->data);
+ switchpad->data = NULL;
+ }
+ gst_event_unref (GST_EVENT (data));
+ }
+ else {
+ /* If that data was not forwarded we unref it */
+ if (!switchpad->forwarded && switchpad->data) {
+ gst_data_unref (switchpad->data);
+ switchpad->data = NULL;
+ }
+ switchpad->data = data;
+ switchpad->forwarded = FALSE;
+ }
+ pads = g_list_next (pads);
+ }
+
+ return TRUE;
+}
+
+static void
+gst_switch_loop (GstElement *element)
+{
+ GstSwitch *gstswitch = NULL;
+ GstSwitchPad *switchpad = NULL;
+
+ g_return_if_fail (element != NULL);
+ g_return_if_fail (GST_IS_SWITCH (element));
+
+ gstswitch = GST_SWITCH (element);
+
+ /* We poll all our sinkpads */
+ gst_switch_poll_sinkpads (gstswitch);
+
+ /* We get the active sinkpad */
+ switchpad = g_list_nth_data (gstswitch->sinkpads, gstswitch->active_sinkpad);
+
+ if (switchpad) {
+ /* Pushing active sinkpad data to srcpad */
+ gst_pad_push (gstswitch->srcpad, switchpad->data);
+ /* Mark this data as forwarded so that it won't get unrefed on next poll */
+ switchpad->forwarded = TRUE;
+ }
+}
+
+/* =========================================== */
+/* */
+/* Properties */
+/* */
+/* =========================================== */
+
+static void
+gst_switch_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ GstSwitch *gstswitch = NULL;
+
+ g_return_if_fail (GST_IS_SWITCH (object));
+
+ gstswitch = GST_SWITCH (object);
+
+ switch (prop_id) {
+ case ARG_ACTIVE_SOURCE:
+ gstswitch->active_sinkpad = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_switch_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
+{
+ GstSwitch *gstswitch = NULL;
+
+ g_return_if_fail (GST_IS_SWITCH (object));
+
+ gstswitch = GST_SWITCH (object);
+
+ switch (prop_id) {
+ case ARG_ACTIVE_SOURCE:
+ g_value_set_int (value, gstswitch->active_sinkpad);
+ break;
+ case ARG_NB_SOURCES:
+ g_value_set_int (value, gstswitch->nb_sinkpads);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/* =========================================== */
+/* */
+/* Init & Class init */
+/* */
+/* =========================================== */
+
+static void
+gst_switch_dispose (GObject *object)
+{
+ GstSwitch *gstswitch = NULL;
+
+ gstswitch = GST_SWITCH (object);
+
+ if (gstswitch->sinkpads) {
+ g_list_free (gstswitch->sinkpads);
+ gstswitch->sinkpads = NULL;
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gst_switch_init (GstSwitch *gstswitch)
+{
+ gstswitch->srcpad = gst_pad_new ("src", GST_PAD_SRC);
+ gst_element_add_pad (GST_ELEMENT (gstswitch), gstswitch->srcpad);
+
+ gst_element_set_loop_function (GST_ELEMENT (gstswitch), gst_switch_loop);
+
+ gstswitch->sinkpads = NULL;
+ gstswitch->active_sinkpad = 0;
+ gstswitch->nb_sinkpads = 0;
+}
+
+static void
+gst_switch_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (element_class, &gst_switch_details);
+
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_switch_sink_factory));
+}
+
+static void
+gst_switch_class_init (GstSwitchClass *klass)
+{
+ GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
+
+ gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
+
+ parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
+
+ g_object_class_install_property (gobject_class,
+ ARG_NB_SOURCES,
+ g_param_spec_int ("nb_sources",
+ "number of sources",
+ "number of sources",
+ G_MININT, G_MAXINT, 0,
+ G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class,
+ ARG_ACTIVE_SOURCE,
+ g_param_spec_int ("active_source",
+ "active source",
+ "active source",
+ G_MININT, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ gobject_class->dispose = gst_switch_dispose;
+ gobject_class->set_property = gst_switch_set_property;
+ gobject_class->get_property = gst_switch_get_property;
+
+ gstelement_class->request_new_pad = gst_switch_request_new_pad;
+}
+
+/* ============================================================= */
+/* */
+/* Public Methods */
+/* */
+/* ============================================================= */
+
+GType
+gst_switch_get_type (void)
+{
+ static GType switch_type = 0;
+
+ if (!switch_type) {
+ static const GTypeInfo switch_info = {
+ sizeof(GstSwitchClass),
+ gst_switch_base_init,
+ NULL,
+ (GClassInitFunc) gst_switch_class_init,
+ NULL,
+ NULL,
+ sizeof(GstSwitch),
+ 0,
+ (GInstanceInitFunc) gst_switch_init,
+ };
+
+ switch_type = g_type_register_static (GST_TYPE_ELEMENT,
+ "GstSwitch", &switch_info, 0);
+ }
+
+ return switch_type;
+}
+
+static gboolean
+plugin_init (GstPlugin *plugin)
+{
+ return gst_element_register (plugin, "switch", GST_RANK_NONE,
+ GST_TYPE_SWITCH);
+}
+
+GST_PLUGIN_DEFINE (
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "switch",
+ "N-to-1 input switching",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
diff --git a/gst/switch/gstswitch.h b/gst/switch/gstswitch.h
new file mode 100644
index 000000000..202565034
--- /dev/null
+++ b/gst/switch/gstswitch.h
@@ -0,0 +1,67 @@
+/* GStreamer
+ * Copyright (C) 2003 Julien Moutte <julien@moutte.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_SWITCH_H__
+#define __GST_SWITCH_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_SWITCH \
+ (gst_switch_get_type())
+#define GST_SWITCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_SWITCH, GstSwitch))
+#define GST_SWITCH_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_SWITCH, GstSwitch))
+#define GST_IS_SWITCH(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SWITCH))
+#define GST_IS_SWITCH_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SWITCH))
+
+typedef struct _GstSwitchPad GstSwitchPad;
+
+typedef struct _GstSwitch GstSwitch;
+typedef struct _GstSwitchClass GstSwitchClass;
+
+struct _GstSwitchPad {
+ GstPad *sinkpad;
+ GstData *data;
+ gboolean forwarded;
+};
+
+struct _GstSwitch {
+ GstElement element;
+
+ GList *sinkpads;
+ GstPad *srcpad;
+
+ guint nb_sinkpads;
+ guint active_sinkpad;
+};
+
+struct _GstSwitchClass {
+ GstElementClass parent_class;
+};
+
+GType gst_switch_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_SWITCH_H__ */
diff --git a/gst/vbidec/gstvbidec.c b/gst/vbidec/gstvbidec.c
index c5c0bd6dd..8ceaee5b5 100644
--- a/gst/vbidec/gstvbidec.c
+++ b/gst/vbidec/gstvbidec.c
@@ -375,7 +375,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"GPL",
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index acb049cd7..b8bece149 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -421,7 +421,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/videodrop/gstvideodrop.c b/gst/videodrop/gstvideodrop.c
index bf8371266..481e535fd 100644
--- a/gst/videodrop/gstvideodrop.c
+++ b/gst/videodrop/gstvideodrop.c
@@ -40,6 +40,7 @@ enum {
enum {
ARG_0,
+ ARG_SPEED
/* FILL ME */
};
@@ -68,6 +69,18 @@ static void gst_videodrop_class_init (GstVideodropClass *klass);
static void gst_videodrop_init (GstVideodrop *videodrop);
static void gst_videodrop_chain (GstPad *pad, GstData *_data);
+static void gst_videodrop_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gst_videodrop_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static GstElementStateReturn
+ gst_videodrop_change_state (GstElement *element);
+
static GstElementClass *parent_class = NULL;
/*static guint gst_videodrop_signals[LAST_SIGNAL] = { 0 }; */
@@ -112,7 +125,20 @@ gst_videodrop_base_init (gpointer g_class)
static void
gst_videodrop_class_init (GstVideodropClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
parent_class = g_type_class_peek_parent (klass);
+
+ g_object_class_install_property (object_class, ARG_SPEED,
+ g_param_spec_float ("speed", "Speed",
+ "Output speed (relative to input)",
+ 0.01, 100, 1, G_PARAM_READWRITE));
+
+ object_class->set_property = gst_videodrop_set_property;
+ object_class->get_property = gst_videodrop_get_property;
+
+ element_class->change_state = gst_videodrop_change_state;
}
#define gst_caps_get_float_range(caps, name, min, max) \
@@ -161,38 +187,90 @@ gst_videodrop_init (GstVideodrop *videodrop)
videodrop->inited = FALSE;
videodrop->total = videodrop->pass = 0;
+ videodrop->speed = 1.;
}
static void
-gst_videodrop_chain (GstPad *pad, GstData *_data)
+gst_videodrop_chain (GstPad *pad, GstData *data)
{
- GstBuffer *buf = GST_BUFFER (_data);
- GstVideodrop *videodrop;
-
- GST_DEBUG ("gst_videodrop_chain");
+ GstVideodrop *videodrop = GST_VIDEODROP (gst_pad_get_parent (pad));
+ GstBuffer *buf;
- g_return_if_fail (pad != NULL);
- g_return_if_fail (GST_IS_PAD (pad));
- g_return_if_fail (buf != NULL);
-
- videodrop = GST_VIDEODROP (gst_pad_get_parent (pad));
-
- if (GST_IS_EVENT (buf)) {
- gst_pad_push (videodrop->srcpad, GST_DATA (buf));
+ if (GST_IS_EVENT (data)) {
+ gst_pad_event_default (videodrop->srcpad, GST_EVENT (data));
return;
}
+ buf = GST_BUFFER (data);
+
videodrop->total++;
- while (videodrop->to_fps / videodrop->from_fps >
+ while (videodrop->to_fps / (videodrop->from_fps * videodrop->speed) >
(gfloat) videodrop->pass / videodrop->total) {
videodrop->pass++;
gst_buffer_ref (buf);
+ GST_BUFFER_TIMESTAMP (buf) /= videodrop->speed;
gst_pad_push (videodrop->srcpad, GST_DATA (buf));
}
gst_buffer_unref (buf);
}
+static void
+gst_videodrop_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GstVideodrop *videodrop = GST_VIDEODROP (object);
+
+ switch (prop_id) {
+ case ARG_SPEED:
+ videodrop->speed = g_value_get_float (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_videodrop_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GstVideodrop *videodrop = GST_VIDEODROP (object);
+
+ switch (prop_id) {
+ case ARG_SPEED:
+ g_value_set_float (value, videodrop->speed);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static GstElementStateReturn
+gst_videodrop_change_state (GstElement *element)
+{
+ GstVideodrop *videodrop = GST_VIDEODROP (element);
+
+ switch (GST_STATE_TRANSITION (element)) {
+ case GST_STATE_PAUSED_TO_READY:
+ videodrop->inited = FALSE;
+ videodrop->total = videodrop->pass = 0;
+ break;
+ default:
+ break;
+ }
+
+ if (parent_class->change_state)
+ return parent_class->change_state (element);
+
+ return GST_STATE_SUCCESS;
+}
+
static gboolean
plugin_init (GstPlugin *plugin)
{
@@ -207,7 +285,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/gst/videodrop/gstvideodrop.h b/gst/videodrop/gstvideodrop.h
index f5209842a..429be2c48 100644
--- a/gst/videodrop/gstvideodrop.h
+++ b/gst/videodrop/gstvideodrop.h
@@ -45,8 +45,9 @@ struct _GstVideodrop {
/* video state */
gboolean inited;
- float from_fps,
- to_fps;
+ gfloat from_fps,
+ to_fps;
+ gfloat speed;
guint64 pass, total;
};
diff --git a/gst/y4m/gsty4mencode.c b/gst/y4m/gsty4mencode.c
index 4f6276ed6..2c0cb5989 100644
--- a/gst/y4m/gsty4mencode.c
+++ b/gst/y4m/gsty4mencode.c
@@ -298,7 +298,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/sys/cdrom/gstcdplayer.c b/sys/cdrom/gstcdplayer.c
index dccf4cba4..b0c768b28 100644
--- a/sys/cdrom/gstcdplayer.c
+++ b/sys/cdrom/gstcdplayer.c
@@ -367,7 +367,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE, /* ? */
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
);
diff --git a/sys/dxr3/dxr3init.c b/sys/dxr3/dxr3init.c
index 341523a4a..fc4413568 100644
--- a/sys/dxr3/dxr3init.c
+++ b/sys/dxr3/dxr3init.c
@@ -48,7 +48,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
"GPL",
- "(c) 2003 Martin Soto <martinsoto@users.sourceforge.net>",
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/sys/glsink/gstglsink.c b/sys/glsink/gstglsink.c
index 54d2938fa..15e8926e5 100644
--- a/sys/glsink/gstglsink.c
+++ b/sys/glsink/gstglsink.c
@@ -782,7 +782,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
);
diff --git a/sys/qcam/gstqcamsrc.c b/sys/qcam/gstqcamsrc.c
index 4cd68842d..4f213f531 100644
--- a/sys/qcam/gstqcamsrc.c
+++ b/sys/qcam/gstqcamsrc.c
@@ -436,7 +436,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c
index 0054d939c..f91e10cec 100644
--- a/sys/v4l2/gstv4l2.c
+++ b/sys/v4l2/gstv4l2.c
@@ -51,7 +51,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c
index 53893face..d99f6d6d0 100644
--- a/sys/v4l2/gstv4l2element.c
+++ b/sys/v4l2/gstv4l2element.c
@@ -78,8 +78,8 @@ static guint gst_v4l2element_signals[LAST_SIGNAL] = { 0 };
static gboolean
-gst_v4l2_iface_supported (GstInterface *iface,
- GType iface_type)
+gst_v4l2_iface_supported (GstImplementsInterface *iface,
+ GType iface_type)
{
GstV4l2Element *v4l2element = GST_V4L2ELEMENT (iface);
@@ -99,7 +99,7 @@ gst_v4l2_iface_supported (GstInterface *iface,
static void
-gst_v4l2_interface_init (GstInterfaceClass *klass)
+gst_v4l2_interface_init (GstImplementsInterfaceClass *klass)
{
/* default virtual functions */
klass->supported = gst_v4l2_iface_supported;
@@ -315,7 +315,7 @@ gst_v4l2element_get_type (void)
"GstV4l2Element", &v4l2element_info, 0);
g_type_add_interface_static (v4l2element_type,
- GST_TYPE_INTERFACE,
+ GST_TYPE_IMPLEMENTS_INTERFACE,
&v4l2iface_info);
g_type_add_interface_static (v4l2element_type,
GST_TYPE_TUNER,
diff --git a/sys/vcd/vcdsrc.c b/sys/vcd/vcdsrc.c
index 0f559a8a4..04db4410f 100644
--- a/sys/vcd/vcdsrc.c
+++ b/sys/vcd/vcdsrc.c
@@ -410,7 +410,6 @@ GST_PLUGIN_DEFINE (
plugin_init,
VERSION,
GST_LICENSE,
- GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)