summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2004-03-09 21:09:11 +0000
committerBenjamin Otte <otte@gnome.org>2004-03-09 21:09:11 +0000
commit9a4a0725e10c13546e9d43ab10c88d884349a5bf (patch)
tree364f3c92beaa319a6063ec8c1a1ae3b61afba188 /gst
parent8782f54d7d0d3644dce91ed530962cda4d55af5c (diff)
downloadgst-plugins-bad-9a4a0725e10c13546e9d43ab10c88d884349a5bf.tar.gz
gst-plugins-bad-9a4a0725e10c13546e9d43ab10c88d884349a5bf.tar.bz2
gst-plugins-bad-9a4a0725e10c13546e9d43ab10c88d884349a5bf.zip
ext/mikmod/gstmikmod.*: make mikmod's loop function not loop infinitely and call gst_element_yield anymore
Original commit message from CVS: * ext/mikmod/gstmikmod.c: (gst_mikmod_init), (gst_mikmod_loop), (gst_mikmod_change_state): * ext/mikmod/gstmikmod.h: make mikmod's loop function not loop infinitely and call gst_element_yield anymore * gst/modplug/gstmodplug.cc: fix pad negotiation
Diffstat (limited to 'gst')
-rw-r--r--gst/modplug/gstmodplug.cc60
1 files changed, 20 insertions, 40 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index 12151afb..9ebd8563 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -74,7 +74,21 @@ GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS)
+ GST_STATIC_CAPS (
+ "audio/x-raw-int, "
+ "endianness = (int) BYTE_ORDER, "
+ "signed = (boolean) TRUE, "
+ "width = (int) 16, "
+ "depth = (int) 16, "
+ "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */
+ "channels = (int) [ 1, 2 ]; "
+ "audio/x-raw-int, "
+ "signed = (boolean) FALSE, "
+ "width = (int) 8, "
+ "depth = (int) 8, "
+ "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */
+ "channels = (int) [ 1, 2 ]"
+ )
);
static GstStaticPadTemplate modplug_sink_template_factory =
@@ -426,43 +440,6 @@ gst_modplug_update_metadata (GstModPlug *modplug)
}
#endif
-
-static GstPadLinkReturn
-modplug_negotiate (GstModPlug *modplug)
-{
- GstPadLinkReturn ret = GST_PAD_LINK_OK;
- gboolean sign;
- modplug->length = 1152 * modplug->channel;
-
- if (modplug->_16bit)
- {
- modplug->length *= 2;
- modplug->bitsPerSample = 16;
- sign = TRUE;
- }
- else {
- modplug->bitsPerSample = 8;
- sign = FALSE;
- }
-
- if ((ret = gst_pad_try_set_caps (modplug->srcpad,
- gst_caps_new_simple ("audio/x-raw-int",
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, sign,
- "width", G_TYPE_INT, modplug->bitsPerSample,
- "depth", G_TYPE_INT, modplug->bitsPerSample,
- "rate", G_TYPE_INT, modplug->frequency,
- "channels", G_TYPE_INT, modplug->channel,
- NULL))) <= 0) {
- return ret;
- }
-
- gst_modplug_setup (modplug);
-
- return ret;
-}
-
-
static GstPadLinkReturn
gst_modplug_srclink (GstPad *pad, const GstCaps *caps)
{
@@ -479,7 +456,10 @@ gst_modplug_srclink (GstPad *pad, const GstCaps *caps)
gst_structure_get_int (structure, "channels", &modplug->channel);
gst_structure_get_int (structure, "rate", &modplug->frequency);
- return modplug_negotiate(modplug);
+ modplug->length = 1152 * modplug->channel * depth / 8;
+ gst_modplug_setup (modplug);
+
+ return GST_PAD_LINK_OK;
}
static void
@@ -574,7 +554,7 @@ gst_modplug_loop (GstElement *element)
modplug->mSoundFile = new CSoundFile;
if (!GST_PAD_CAPS (modplug->srcpad) &&
- modplug_negotiate (modplug) <= 0) {
+ GST_PAD_LINK_FAILED (gst_pad_renegotiate (modplug->srcpad))) {
GST_ELEMENT_ERROR (modplug, CORE, NEGOTIATION, (NULL), (NULL));
return;
}