make 8bit modplug use the right caps. 8bit sounds really crappy tho

Original commit message from CVS:
make 8bit modplug use the right caps. 8bit sounds really crappy tho
This commit is contained in:
Benjamin Otte 2003-01-30 18:03:47 +00:00
parent 58825247e6
commit 0d1b9d28be

View File

@ -80,7 +80,7 @@ GST_PAD_TEMPLATE_FACTORY (modplug_src_template_factory,
"src", "src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_CAPS_NEW ( GST_CAPS_NEW ( /* use16bit = TRUE */
"modplug_src", "modplug_src",
"audio/raw", "audio/raw",
"format", GST_PROPS_STRING ("int"), "format", GST_PROPS_STRING ("int"),
@ -91,6 +91,18 @@ GST_PAD_TEMPLATE_FACTORY (modplug_src_template_factory,
"depth", GST_PROPS_INT (16), "depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT_RANGE (11025, 44100), "rate", GST_PROPS_INT_RANGE (11025, 44100),
"channels", GST_PROPS_INT_RANGE (1, 2) "channels", GST_PROPS_INT_RANGE (1, 2)
),
GST_CAPS_NEW ( /* use16bit = FALSE */
"modplug_src",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (FALSE),
"width", GST_PROPS_INT (8),
"depth", GST_PROPS_INT (8),
"rate", GST_PROPS_INT_RANGE (11025, 44100),
"channels", GST_PROPS_INT_RANGE (1, 2)
) )
) )
@ -544,15 +556,19 @@ gst_modplug_update_metadata (GstModPlug *modplug)
static gboolean static gboolean
modplug_negotiate (GstModPlug *modplug) modplug_negotiate (GstModPlug *modplug)
{ {
gboolean sign;
modplug->length = 1152 * modplug->channel; modplug->length = 1152 * modplug->channel;
if (modplug->_16bit) if (modplug->_16bit)
{ {
modplug->length *= 2; modplug->length *= 2;
modplug->bitsPerSample = 16; modplug->bitsPerSample = 16;
sign = TRUE;
} }
else else {
modplug->bitsPerSample = 8; modplug->bitsPerSample = 8;
sign = FALSE;
}
if (!GST_PAD_CAPS (modplug->srcpad)) { if (!GST_PAD_CAPS (modplug->srcpad)) {
if (!gst_pad_try_set_caps (modplug->srcpad, if (!gst_pad_try_set_caps (modplug->srcpad,
@ -562,7 +578,7 @@ modplug_negotiate (GstModPlug *modplug)
"format", GST_PROPS_STRING ("int"), "format", GST_PROPS_STRING ("int"),
"law", GST_PROPS_INT (0), "law", GST_PROPS_INT (0),
"endianness", GST_PROPS_INT (G_BYTE_ORDER), "endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE), "signed", GST_PROPS_BOOLEAN (sign),
"width", GST_PROPS_INT (modplug->bitsPerSample), "width", GST_PROPS_INT (modplug->bitsPerSample),
"depth", GST_PROPS_INT (modplug->bitsPerSample), "depth", GST_PROPS_INT (modplug->bitsPerSample),
"rate", GST_PROPS_INT (modplug->frequency), "rate", GST_PROPS_INT (modplug->frequency),