mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
sf's back
Original commit message from CVS: sf's back
This commit is contained in:
parent
c4ba06ace6
commit
509a2d42b1
3 changed files with 75 additions and 51 deletions
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit f0da7b89bea3eb2ed1d149166f28afa5e670dec2
|
||||
Subproject commit bca2dfba7bfc36020b5ba26b640ebde4cc76a5f0
|
|
@ -647,7 +647,7 @@ gst_avi_demux_parse_index (GstAviDemux *avi_demux,
|
|||
GstEvent *event;
|
||||
|
||||
gst_bytestream_get_status (avi_demux->bs, &remaining, &event);
|
||||
gst_event_unref (event);
|
||||
gst_data_unref (GST_DATA (event));
|
||||
|
||||
got_bytes = gst_bytestream_read (avi_demux->bs, &buf, 8);
|
||||
}
|
||||
|
|
|
@ -100,50 +100,45 @@ static GstElementClass *parent_class = NULL;
|
|||
/*static guint gst_filter_signals[LAST_SIGNAL] = { 0 }; */
|
||||
|
||||
GType
|
||||
gst_level_get_type(void) {
|
||||
gst_level_get_type (void)
|
||||
{
|
||||
static GType level_type = 0;
|
||||
|
||||
if (!level_type) {
|
||||
static const GTypeInfo level_info = {
|
||||
sizeof(GstLevelClass), NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gst_level_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(GstLevel),
|
||||
0,
|
||||
(GInstanceInitFunc)gst_level_init,
|
||||
if (!level_type)
|
||||
{
|
||||
static const GTypeInfo level_info =
|
||||
{
|
||||
sizeof (GstLevelClass), NULL, NULL,
|
||||
(GClassInitFunc) gst_level_class_init, NULL, NULL,
|
||||
sizeof (GstLevel), 0,
|
||||
(GInstanceInitFunc) gst_level_init
|
||||
};
|
||||
level_type = g_type_register_static(GST_TYPE_ELEMENT, "GstLevel", &level_info, 0);
|
||||
level_type = g_type_register_static (GST_TYPE_ELEMENT, "GstLevel",
|
||||
&level_info, 0);
|
||||
}
|
||||
return level_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_level_class_init (GstLevelClass *klass)
|
||||
static GstPadConnectReturn
|
||||
gst_level_connect (GstPad *pad, GstCaps *caps)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
GstLevel *filter;
|
||||
GstPad *otherpad;
|
||||
|
||||
gobject_class = (GObjectClass*)klass;
|
||||
gstelement_class = (GstElementClass*)klass;
|
||||
filter = GST_LEVEL (gst_pad_get_parent (pad));
|
||||
g_return_val_if_fail (filter != NULL, GST_PAD_CONNECT_REFUSED);
|
||||
g_return_val_if_fail (GST_IS_LEVEL (filter), GST_PAD_CONNECT_REFUSED);
|
||||
otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad);
|
||||
|
||||
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
|
||||
if (GST_CAPS_IS_FIXED (caps))
|
||||
{
|
||||
if (/* !volume_parse_caps (filter, caps) || */
|
||||
!gst_pad_try_set_caps (otherpad, caps))
|
||||
return GST_PAD_CONNECT_REFUSED;
|
||||
|
||||
gobject_class->set_property = gst_level_set_property;
|
||||
gobject_class->get_property = gst_level_get_property;
|
||||
return GST_PAD_CONNECT_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_level_init (GstLevel *filter)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_template(level_sink_factory (),"sink");
|
||||
filter->srcpad = gst_pad_new_from_template(level_src_factory (),"src");
|
||||
|
||||
gst_element_add_pad(GST_ELEMENT(filter),filter->sinkpad);
|
||||
gst_pad_set_chain_function(filter->sinkpad,gst_level_chain);
|
||||
filter->srcpad = gst_pad_new("src",GST_PAD_SRC);
|
||||
gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad);
|
||||
return GST_PAD_CONNECT_DELAYED;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -170,7 +165,7 @@ gst_level_chain (GstPad *pad,GstBuffer *buf)
|
|||
if (caps == NULL)
|
||||
{
|
||||
/* FIXME : Please change this to a better warning method ! */
|
||||
printf ("WARNING : chain : Could not get caps of pad !\n");
|
||||
g_error ("WARNING: level: Could not get pad caps - caps nego failed !\n");
|
||||
}
|
||||
|
||||
gst_caps_get_int (caps, "width", &width);
|
||||
|
@ -235,6 +230,35 @@ gst_level_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_level_class_init (GstLevelClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
|
||||
gobject_class = (GObjectClass*) klass;
|
||||
gstelement_class = (GstElementClass*) klass;
|
||||
|
||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
||||
|
||||
gobject_class->set_property = gst_level_set_property;
|
||||
gobject_class->get_property = gst_level_get_property;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_level_init (GstLevel *filter)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_template (level_sink_factory (), "sink");
|
||||
gst_pad_set_connect_function (filter->sinkpad, gst_level_connect);
|
||||
filter->srcpad = gst_pad_new_from_template (level_src_factory (), "src");
|
||||
gst_pad_set_connect_function (filter->srcpad, gst_level_connect);
|
||||
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
||||
gst_pad_set_chain_function (filter->sinkpad, gst_level_chain);
|
||||
filter->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
plugin_init (GModule *module, GstPlugin *plugin)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue