mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 03:56:16 +00:00
make 8 bit output use the right caps
Original commit message from CVS: make 8 bit output use the right caps
This commit is contained in:
parent
b0e9998114
commit
7e4720f88c
1 changed files with 36 additions and 19 deletions
|
@ -71,19 +71,33 @@ mikmod_src_factory (void)
|
||||||
"src",
|
"src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
gst_caps_new (
|
gst_caps_new ( /* use16bit = TRUE */
|
||||||
"mikmod_src",
|
"mikmod_src",
|
||||||
"audio/raw",
|
"audio/raw",
|
||||||
gst_props_new (
|
gst_props_new (
|
||||||
"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 (TRUE),
|
||||||
"width", GST_PROPS_INT (16),
|
"width", GST_PROPS_INT (16),
|
||||||
"depth", GST_PROPS_INT (16),
|
"depth", GST_PROPS_INT (16),
|
||||||
"rate", GST_PROPS_INT_RANGE (8000, 48000),
|
"rate", GST_PROPS_INT_RANGE (8000, 48000),
|
||||||
"channels", GST_PROPS_INT_RANGE (1, 2),
|
"channels", GST_PROPS_INT_RANGE (1, 2),
|
||||||
NULL)),NULL);
|
NULL)),
|
||||||
|
gst_caps_new ( /* use16bit = FALSE */
|
||||||
|
"mikmod_src",
|
||||||
|
"audio/raw",
|
||||||
|
gst_props_new (
|
||||||
|
"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 (8000, 48000),
|
||||||
|
"channels", GST_PROPS_INT_RANGE (1, 2),
|
||||||
|
NULL)),
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
@ -264,7 +278,7 @@ gst_mikmod_loop (GstElement *element)
|
||||||
{
|
{
|
||||||
GstMikMod *mikmod;
|
GstMikMod *mikmod;
|
||||||
GstBuffer *buffer_in;
|
GstBuffer *buffer_in;
|
||||||
gint mode16bits;
|
gint width, sign;
|
||||||
|
|
||||||
g_return_if_fail (element != NULL);
|
g_return_if_fail (element != NULL);
|
||||||
g_return_if_fail (GST_IS_MIKMOD (element));
|
g_return_if_fail (GST_IS_MIKMOD (element));
|
||||||
|
@ -291,10 +305,13 @@ gst_mikmod_loop (GstElement *element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mikmod->_16bit )
|
if ( mikmod->_16bit ) {
|
||||||
mode16bits = 16;
|
width = 16;
|
||||||
else
|
sign = TRUE;
|
||||||
mode16bits = 8;
|
} else {
|
||||||
|
width = 8;
|
||||||
|
sign = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gst_mikmod_setup( mikmod );
|
gst_mikmod_setup( mikmod );
|
||||||
|
|
||||||
|
@ -317,9 +334,9 @@ gst_mikmod_loop (GstElement *element)
|
||||||
"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 (mode16bits),
|
"width", GST_PROPS_INT (width),
|
||||||
"depth", GST_PROPS_INT (mode16bits),
|
"depth", GST_PROPS_INT (width),
|
||||||
"rate", GST_PROPS_INT (mikmod->mixfreq),
|
"rate", GST_PROPS_INT (mikmod->mixfreq),
|
||||||
"channels", GST_PROPS_INT (2)));
|
"channels", GST_PROPS_INT (2)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue