mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst/wavparse/gstwavparse.c: Hack to make wavparse work with spider (always -> sometimes pad).
Original commit message from CVS: * gst/wavparse/gstwavparse.c: (gst_wavparse_init), (gst_wavparse_destroy_sourcepad), (gst_wavparse_create_sourcepad), (gst_wavparse_parse_fmt), (gst_wavparse_change_state): Hack to make wavparse work with spider (always -> sometimes pad). Fixes #135862 && #140411.
This commit is contained in:
parent
38d20a00da
commit
2cb68dcdc1
2 changed files with 44 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-04-18 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* gst/wavparse/gstwavparse.c: (gst_wavparse_init),
|
||||||
|
(gst_wavparse_destroy_sourcepad), (gst_wavparse_create_sourcepad),
|
||||||
|
(gst_wavparse_parse_fmt), (gst_wavparse_change_state):
|
||||||
|
Hack to make wavparse work with spider (always -> sometimes pad).
|
||||||
|
Fixes #135862 && #140411.
|
||||||
|
|
||||||
2004-04-18 Benjamin Otte <otte@gnome.org>
|
2004-04-18 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* sys/oss/gstosselement.c: (gst_osselement_sync_parms),
|
* sys/oss/gstosselement.c: (gst_osselement_sync_parms),
|
||||||
|
|
|
@ -63,7 +63,7 @@ GST_STATIC_PAD_TEMPLATE ("wavparse_sink",
|
||||||
static GstStaticPadTemplate src_template_factory =
|
static GstStaticPadTemplate src_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("wavparse_src",
|
GST_STATIC_PAD_TEMPLATE ("wavparse_src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_SOMETIMES, /* FIXME: spider */
|
||||||
GST_STATIC_CAPS ("audio/x-raw-int, "
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||||
"endianness = (int) little_endian, "
|
"endianness = (int) little_endian, "
|
||||||
"signed = (boolean) { true, false }, "
|
"signed = (boolean) { true, false }, "
|
||||||
|
@ -171,7 +171,7 @@ gst_wavparse_init (GstWavParse * wavparse)
|
||||||
gst_pad_set_query_type_function (wavparse->sinkpad,
|
gst_pad_set_query_type_function (wavparse->sinkpad,
|
||||||
gst_wavparse_get_query_types);
|
gst_wavparse_get_query_types);
|
||||||
gst_pad_set_query_function (wavparse->sinkpad, gst_wavparse_pad_query);
|
gst_pad_set_query_function (wavparse->sinkpad, gst_wavparse_pad_query);
|
||||||
|
#if 0
|
||||||
/* source */
|
/* source */
|
||||||
wavparse->srcpad =
|
wavparse->srcpad =
|
||||||
gst_pad_new_from_template (gst_static_pad_template_get
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
@ -186,7 +186,7 @@ gst_wavparse_init (GstWavParse * wavparse)
|
||||||
gst_pad_set_event_function (wavparse->srcpad, gst_wavparse_srcpad_event);
|
gst_pad_set_event_function (wavparse->srcpad, gst_wavparse_srcpad_event);
|
||||||
gst_pad_set_event_mask_function (wavparse->srcpad,
|
gst_pad_set_event_mask_function (wavparse->srcpad,
|
||||||
gst_wavparse_get_event_masks);
|
gst_wavparse_get_event_masks);
|
||||||
|
#endif
|
||||||
gst_element_set_loop_function (GST_ELEMENT (wavparse), gst_wavparse_loop);
|
gst_element_set_loop_function (GST_ELEMENT (wavparse), gst_wavparse_loop);
|
||||||
|
|
||||||
wavparse->state = GST_WAVPARSE_UNKNOWN;
|
wavparse->state = GST_WAVPARSE_UNKNOWN;
|
||||||
|
@ -195,6 +195,35 @@ gst_wavparse_init (GstWavParse * wavparse)
|
||||||
wavparse->seek_offset = 0;
|
wavparse->seek_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_wavparse_destroy_sourcepad (GstWavParse * wavparse)
|
||||||
|
{
|
||||||
|
gst_element_remove_pad (GST_ELEMENT (wavparse), wavparse->srcpad);
|
||||||
|
wavparse->srcpad = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_wavparse_create_sourcepad (GstWavParse * wavparse)
|
||||||
|
{
|
||||||
|
if (wavparse->srcpad)
|
||||||
|
gst_wavparse_destroy_sourcepad (wavparse);
|
||||||
|
|
||||||
|
/* source */
|
||||||
|
wavparse->srcpad =
|
||||||
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
(&src_template_factory), "src");
|
||||||
|
gst_pad_use_explicit_caps (wavparse->srcpad);
|
||||||
|
/*gst_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad); */
|
||||||
|
gst_pad_set_formats_function (wavparse->srcpad, gst_wavparse_get_formats);
|
||||||
|
gst_pad_set_convert_function (wavparse->srcpad, gst_wavparse_pad_convert);
|
||||||
|
gst_pad_set_query_type_function (wavparse->srcpad,
|
||||||
|
gst_wavparse_get_query_types);
|
||||||
|
gst_pad_set_query_function (wavparse->srcpad, gst_wavparse_pad_query);
|
||||||
|
gst_pad_set_event_function (wavparse->srcpad, gst_wavparse_srcpad_event);
|
||||||
|
gst_pad_set_event_mask_function (wavparse->srcpad,
|
||||||
|
gst_wavparse_get_event_masks);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_wavparse_get_property (GObject * object,
|
gst_wavparse_get_property (GObject * object,
|
||||||
guint prop_id, GValue * value, GParamSpec * pspec)
|
guint prop_id, GValue * value, GParamSpec * pspec)
|
||||||
|
@ -597,6 +626,8 @@ gst_wavparse_parse_fmt (GstWavParse * wavparse, guint size)
|
||||||
wavparse->width = GUINT16_FROM_LE (format->wBitsPerSample);
|
wavparse->width = GUINT16_FROM_LE (format->wBitsPerSample);
|
||||||
wavparse->format = GINT16_FROM_LE (format->wFormatTag);
|
wavparse->format = GINT16_FROM_LE (format->wFormatTag);
|
||||||
|
|
||||||
|
gst_wavparse_create_sourcepad (wavparse);
|
||||||
|
|
||||||
/* set the caps on the src pad */
|
/* set the caps on the src pad */
|
||||||
/* FIXME: handle all of the other formats as well */
|
/* FIXME: handle all of the other formats as well */
|
||||||
switch (wavparse->format) {
|
switch (wavparse->format) {
|
||||||
|
@ -655,6 +686,7 @@ gst_wavparse_parse_fmt (GstWavParse * wavparse, guint size)
|
||||||
gst_pad_set_explicit_caps (wavparse->srcpad, caps);
|
gst_pad_set_explicit_caps (wavparse->srcpad, caps);
|
||||||
gst_caps_free (caps);
|
gst_caps_free (caps);
|
||||||
}
|
}
|
||||||
|
gst_element_add_pad (GST_ELEMENT (wavparse), wavparse->srcpad);
|
||||||
|
|
||||||
GST_DEBUG ("frequency %d, channels %d", wavparse->rate, wavparse->channels);
|
GST_DEBUG ("frequency %d, channels %d", wavparse->rate, wavparse->channels);
|
||||||
}
|
}
|
||||||
|
@ -1118,6 +1150,7 @@ gst_wavparse_change_state (GstElement * element)
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
|
gst_wavparse_destroy_sourcepad (wavparse);
|
||||||
gst_bytestream_destroy (wavparse->bs);
|
gst_bytestream_destroy (wavparse->bs);
|
||||||
wavparse->state = GST_WAVPARSE_UNKNOWN;
|
wavparse->state = GST_WAVPARSE_UNKNOWN;
|
||||||
wavparse->bps = 0;
|
wavparse->bps = 0;
|
||||||
|
|
Loading…
Reference in a new issue