2004-02-22 20:52:15 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2004 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include "gstxine.h"
|
|
|
|
#include <xine/input_plugin.h>
|
|
|
|
#include <xine/xine_internal.h>
|
|
|
|
#include <xine/plugin_catalog.h>
|
|
|
|
|
|
|
|
#define GST_TYPE_XINE_INPUT \
|
|
|
|
(gst_xine_input_get_type())
|
|
|
|
#define GST_XINE_INPUT(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XINE_INPUT,GstXineInput))
|
|
|
|
#define GST_XINE_INPUT_GET_CLASS(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XINE_INPUT, GstXineInputClass))
|
|
|
|
#define GST_XINE_INPUT_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_XINE_INPUT,GstXineInputClass))
|
|
|
|
#define GST_IS_XINE_INPUT(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XINE_INPUT))
|
2006-09-16 22:14:36 +00:00
|
|
|
#define GST_IS_XINE_INPUT_CLASS(klass) \
|
2004-02-22 20:52:15 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XINE_INPUT))
|
|
|
|
|
|
|
|
GType gst_xine_input_get_type (void);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
typedef struct _GstXineInput GstXineInput;
|
2004-02-22 20:52:15 +00:00
|
|
|
typedef struct _GstXineInputClass GstXineInputClass;
|
|
|
|
|
|
|
|
struct _GstXineInput
|
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXine parent;
|
2004-02-22 20:52:15 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GstPad *srcpad;
|
2004-02-22 20:52:15 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
input_plugin_t *input;
|
|
|
|
gchar *location;
|
|
|
|
guint blocksize;
|
2004-02-22 20:52:15 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
struct _GstXineInputClass
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXineClass parent_class;
|
2004-02-22 20:52:15 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
plugin_node_t *plugin_node;
|
2004-02-22 20:52:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** GstXineInput ***********************************************************/
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-02-22 20:52:15 +00:00
|
|
|
ARG_0,
|
|
|
|
ARG_LOCATION
|
|
|
|
};
|
|
|
|
|
2006-05-06 00:15:59 +00:00
|
|
|
GST_BOILERPLATE (GstXineInput, gst_xine_input, GstXine, GST_TYPE_XINE);
|
2004-02-22 20:52:15 +00:00
|
|
|
|
2006-05-06 00:15:59 +00:00
|
|
|
static void gst_xine_input_dispose (GObject * object);
|
|
|
|
static void gst_xine_input_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
const GValue * value, GParamSpec * pspec);
|
2006-05-06 00:15:59 +00:00
|
|
|
static void gst_xine_input_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
GValue * value, GParamSpec * pspec);
|
2006-05-06 00:15:59 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_xine_input_change_state (GstElement * element, GstStateChange transition);
|
2004-02-22 20:52:15 +00:00
|
|
|
|
2006-05-06 00:15:59 +00:00
|
|
|
static void
|
|
|
|
gst_xine_input_base_init (gpointer g_class)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_class_init (GstXineInputClass * klass)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element = GST_ELEMENT_CLASS (klass);
|
|
|
|
GObjectClass *object = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
element->change_state = gst_xine_input_change_state;
|
|
|
|
|
|
|
|
object->set_property = gst_xine_input_set_property;
|
|
|
|
object->get_property = gst_xine_input_get_property;
|
|
|
|
object->dispose = gst_xine_input_dispose;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object, ARG_LOCATION,
|
|
|
|
g_param_spec_string ("location", "location", "location",
|
2004-03-15 19:32:27 +00:00
|
|
|
NULL, G_PARAM_READWRITE));
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-08-28 17:59:20 +00:00
|
|
|
gst_xine_input_init (GstXineInput * xine, GstXineInputClass * g_class)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_dispose (GObject * object)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstXineInput *xine = GST_XINE_INPUT (object);
|
|
|
|
|
|
|
|
g_free (xine->location);
|
|
|
|
xine->location = NULL;
|
ext/xine/xineinput.c: call parent dispose.
Original commit message from CVS:
2004-02-23 Benjamin Otte <otte@gnome.org>
* ext/xine/xineinput.c: (gst_xine_input_dispose):
(gst_xine_input_subclass_init):
call parent dispose.
change pad template for CD reader correctly
* ext/xine/Makefile.am:
* ext/xine/gstxine.h:
* ext/xine/xine.c: (plugin_init):
* ext/xine/xineaudiosink.c:
wrap audio sinks, too
* gst-libs/gst/resample/private.h:
* gst-libs/gst/resample/resample.c: (gst_resample_init),
(gst_resample_reinit), (gst_resample_scale),
(gst_resample_nearest_s16), (gst_resample_bilinear_s16),
(gst_resample_sinc_slow_s16), (gst_resample_sinc_s16),
(gst_resample_sinc_ft_s16), (gst_resample_nearest_float),
(gst_resample_bilinear_float), (gst_resample_sinc_slow_float),
(gst_resample_sinc_float), (gst_resample_sinc_ft_float):
* gst-libs/gst/resample/resample.h:
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(gst_audioscale_class_init), (gst_audioscale_link),
(gst_audioscale_get_buffer), (gst_audioscale_init),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property):
* gst/audioscale/gstaudioscale.h:
s/resample_*/gst_resample_*/i to not clobber namespaces
2004-02-23 22:21:30 +00:00
|
|
|
|
|
|
|
GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstXineInput *xine = GST_XINE_INPUT (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_LOCATION:
|
|
|
|
if (gst_element_get_state (GST_ELEMENT (xine)) != GST_STATE_NULL)
|
2004-03-15 19:32:27 +00:00
|
|
|
return;
|
2004-02-22 20:52:15 +00:00
|
|
|
if (xine->location)
|
2004-03-15 19:32:27 +00:00
|
|
|
g_free (xine->location);
|
2004-02-22 20:52:15 +00:00
|
|
|
xine->location = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
return;
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstXineInput *xine = GST_XINE_INPUT (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_LOCATION:
|
|
|
|
g_value_set_string (value, xine->location);
|
|
|
|
break;
|
2004-03-14 22:34:33 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
return;
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-15 19:32:27 +00:00
|
|
|
#define BUFFER_SIZE 4096 /* FIXME: what size? */
|
2004-02-22 20:52:15 +00:00
|
|
|
static GstData *
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_get (GstPad * pad)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstXineInput *xine =
|
|
|
|
GST_XINE_INPUT (gst_object_get_parent (GST_OBJECT (pad)));
|
2004-02-22 20:52:15 +00:00
|
|
|
GstBuffer *buf;
|
|
|
|
gint real_size, position;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
/* FIXME: how does xine figure out EOS? */
|
|
|
|
position = xine->input->get_current_pos (xine->input);
|
|
|
|
if (position > 0 && position == xine->input->get_length (xine->input)) {
|
|
|
|
gst_element_set_eos (GST_ELEMENT (xine));
|
|
|
|
return GST_DATA (gst_event_new (GST_EVENT_EOS));
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
buf =
|
2005-12-05 13:04:22 +00:00
|
|
|
gst_pad_alloc_buffer_and_set_caps (xine->srcpad, GST_BUFFER_OFFSET_NONE,
|
2004-03-14 22:34:33 +00:00
|
|
|
xine->blocksize);
|
2004-02-22 20:52:15 +00:00
|
|
|
GST_BUFFER_OFFSET (buf) = position;
|
2004-03-14 22:34:33 +00:00
|
|
|
real_size =
|
|
|
|
xine->input->read (xine->input, GST_BUFFER_DATA (buf),
|
|
|
|
GST_BUFFER_MAXSIZE (buf));
|
2004-02-22 20:52:15 +00:00
|
|
|
GST_BUFFER_SIZE (buf) = real_size;
|
|
|
|
if (real_size < 0) {
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xine, RESOURCE, READ, (NULL), ("error %d reading data",
|
2004-03-15 19:32:27 +00:00
|
|
|
real_size));
|
2004-02-22 20:52:15 +00:00
|
|
|
gst_data_unref (GST_DATA (buf));
|
|
|
|
return NULL;
|
|
|
|
} else if (real_size == 0) {
|
|
|
|
buf_element_t *element;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
if (xine->input->get_capabilities (xine->input) & INPUT_CAP_BLOCK)
|
2004-03-14 22:34:33 +00:00
|
|
|
element =
|
2004-03-15 19:32:27 +00:00
|
|
|
xine->input->read_block (xine->input,
|
|
|
|
gst_xine_get_stream (GST_XINE (xine))->audio_fifo, xine->blocksize);
|
2004-02-22 20:52:15 +00:00
|
|
|
if (element == NULL) {
|
|
|
|
/* FIXME: is this EOS? */
|
|
|
|
gst_element_set_eos (GST_ELEMENT (xine));
|
2004-03-14 22:34:33 +00:00
|
|
|
return GST_DATA (gst_event_new (GST_EVENT_EOS));
|
2004-02-22 20:52:15 +00:00
|
|
|
} else {
|
|
|
|
GST_BUFFER_SIZE (buf) = element->size;
|
|
|
|
/* FIXME: put buf_element_t data in buffer */
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), element->mem, element->size);
|
|
|
|
element->free_buffer (element);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GST_BUFFER_OFFSET_END (buf) = xine->input->get_current_pos (xine->input);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
return GST_DATA (buf);
|
|
|
|
}
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_xine_input_change_state (GstElement * element, GstStateChange transition)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstXineInput *xine = GST_XINE_INPUT (element);
|
2004-03-14 22:34:33 +00:00
|
|
|
input_class_t *input =
|
|
|
|
(input_class_t *) GST_XINE_INPUT_GET_CLASS (xine)->plugin_node->
|
|
|
|
plugin_class;
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2004-03-14 22:34:33 +00:00
|
|
|
xine->input =
|
2004-03-15 19:32:27 +00:00
|
|
|
input->get_instance (input, gst_xine_get_stream (GST_XINE (xine)),
|
|
|
|
xine->location);
|
2004-02-22 20:52:15 +00:00
|
|
|
if (!xine->input)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-02-22 20:52:15 +00:00
|
|
|
if (xine->input->open (xine->input) == 0)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-02-22 20:52:15 +00:00
|
|
|
xine->blocksize = xine->input->get_blocksize (xine->input);
|
|
|
|
if (xine->blocksize == 0)
|
2004-03-15 19:32:27 +00:00
|
|
|
xine->blocksize = BUFFER_SIZE;
|
2004-02-22 20:52:15 +00:00
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2004-02-22 20:52:15 +00:00
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2004-02-22 20:52:15 +00:00
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2004-02-22 20:52:15 +00:00
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2004-02-22 20:52:15 +00:00
|
|
|
/* FIXME: reset stream */
|
|
|
|
break;
|
2005-09-05 17:20:29 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2004-02-22 20:52:15 +00:00
|
|
|
xine->input->dispose (xine->input);
|
|
|
|
xine->input = NULL;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_ERROR_OBJECT (element, "invalid state change");
|
|
|
|
break;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
|
2005-09-05 17:20:29 +00:00
|
|
|
(element), GST_STATE_CHANGE_SUCCESS);
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** GstXineInput subclasses ************************************************/
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static GstStaticPadTemplate any_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate cdda_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"endianness = (int) LITTLE_ENDIAN, "
|
|
|
|
"signed = (boolean) true, "
|
|
|
|
"width = (int) 16, "
|
|
|
|
"depth = (int) 16, " "rate = (int) 44100, " "channels = (int) 2")
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
2004-02-22 20:52:15 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xine_input_subclass_init (gpointer g_class, gpointer class_data)
|
|
|
|
{
|
|
|
|
GstXineInputClass *xine_class = GST_XINE_INPUT_CLASS (g_class);
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-03-14 22:34:33 +00:00
|
|
|
GstElementDetails details = GST_ELEMENT_DETAILS (NULL,
|
|
|
|
"Source",
|
|
|
|
NULL,
|
|
|
|
"Benjamin Otte <otte@gnome.org>");
|
2004-02-22 20:52:15 +00:00
|
|
|
input_class_t *input;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
xine_class->plugin_node = class_data;
|
|
|
|
input = (input_class_t *) xine_class->plugin_node->plugin_class;
|
2004-03-14 22:34:33 +00:00
|
|
|
details.longname =
|
|
|
|
g_strdup_printf ("%s xine input", input->get_identifier (input));
|
2004-02-22 20:52:15 +00:00
|
|
|
details.description = g_strdup_printf ("%s", input->get_description (input));
|
|
|
|
gst_element_class_set_details (element_class, &details);
|
|
|
|
g_free (details.longname);
|
|
|
|
g_free (details.description);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
/* FIXME: this is pretty hackish, anyone knows a better idea (xine doesn't) */
|
ext/xine/xineinput.c: call parent dispose.
Original commit message from CVS:
2004-02-23 Benjamin Otte <otte@gnome.org>
* ext/xine/xineinput.c: (gst_xine_input_dispose):
(gst_xine_input_subclass_init):
call parent dispose.
change pad template for CD reader correctly
* ext/xine/Makefile.am:
* ext/xine/gstxine.h:
* ext/xine/xine.c: (plugin_init):
* ext/xine/xineaudiosink.c:
wrap audio sinks, too
* gst-libs/gst/resample/private.h:
* gst-libs/gst/resample/resample.c: (gst_resample_init),
(gst_resample_reinit), (gst_resample_scale),
(gst_resample_nearest_s16), (gst_resample_bilinear_s16),
(gst_resample_sinc_slow_s16), (gst_resample_sinc_s16),
(gst_resample_sinc_ft_s16), (gst_resample_nearest_float),
(gst_resample_bilinear_float), (gst_resample_sinc_slow_float),
(gst_resample_sinc_float), (gst_resample_sinc_ft_float):
* gst-libs/gst/resample/resample.h:
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(gst_audioscale_class_init), (gst_audioscale_link),
(gst_audioscale_get_buffer), (gst_audioscale_init),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property):
* gst/audioscale/gstaudioscale.h:
s/resample_*/gst_resample_*/i to not clobber namespaces
2004-02-23 22:21:30 +00:00
|
|
|
if (strcmp (input->get_identifier (input), "cdda") == 0) {
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_static_pad_template_get (&cdda_template));
|
2004-02-22 20:52:15 +00:00
|
|
|
} else {
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_static_pad_template_get (&any_template));
|
2004-02-22 20:52:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_sub_init (GTypeInstance * instance, gpointer g_class)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
|
|
|
GstElementClass *klass = GST_ELEMENT_GET_CLASS (instance);
|
|
|
|
GstXineInput *xine = GST_XINE_INPUT (instance);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
xine->srcpad =
|
|
|
|
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
|
2004-03-15 19:32:27 +00:00
|
|
|
"src"), "src");
|
2004-02-22 20:52:15 +00:00
|
|
|
gst_pad_set_get_function (xine->srcpad, gst_xine_input_get);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (xine), xine->srcpad);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_xine_input_init_plugin (GstPlugin * plugin)
|
2004-02-22 20:52:15 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GTypeInfo plugin_info = {
|
2004-02-22 20:52:15 +00:00
|
|
|
sizeof (GstXineInputClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
gst_xine_input_subclass_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstXineInput),
|
|
|
|
0,
|
|
|
|
gst_xine_input_sub_init,
|
|
|
|
};
|
|
|
|
plugin_node_t *node;
|
|
|
|
GstXineClass *klass;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
klass = g_type_class_ref (GST_TYPE_XINE);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
node = xine_list_first_content (klass->xine->plugin_catalog->input);
|
|
|
|
while (node) {
|
|
|
|
gchar *plugin_name = g_strdup_printf ("xinesrc_%s", node->info->id);
|
|
|
|
gchar *type_name = g_strdup_printf ("GstXineInput%s", node->info->id);
|
|
|
|
GType type;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-02-22 20:52:15 +00:00
|
|
|
plugin_info.class_data = node;
|
2004-03-14 22:34:33 +00:00
|
|
|
type =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_type_register_static (GST_TYPE_XINE_INPUT, type_name, &plugin_info,
|
|
|
|
0);
|
2004-02-22 20:52:15 +00:00
|
|
|
g_free (type_name);
|
2004-03-14 22:34:33 +00:00
|
|
|
if (!gst_element_register (plugin, plugin_name, GST_RANK_MARGINAL, type)) {
|
2004-02-22 20:52:15 +00:00
|
|
|
g_free (plugin_name);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
g_free (plugin_name);
|
|
|
|
|
|
|
|
node = xine_list_next_content (klass->xine->plugin_catalog->input);
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
g_type_class_unref (klass);
|
2004-02-22 20:52:15 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|