Commit fc50d2dc authored by Jan Schmidt's avatar Jan Schmidt

ext/alsa/Makefile.am: There is no GST_PLUGINS_BASE_LIBS defined.

Original commit message from CVS:
* ext/alsa/Makefile.am:
There is no GST_PLUGINS_BASE_LIBS defined.
* ext/alsa/gstalsa.c:
* ext/alsa/gstalsasink.c: (gst_alsasink_delay):
* ext/alsa/gstalsasrc.c: (gst_alsasrc_delay):
Add support for ALSA 24-bit formats.
snd_pcm_delay can return an error code, especially
during XRUNS. In that case, the best we can do is assume
delay = 0.
* gst/audioconvert/Makefile.am:
Add flags from -base before any more-remote dependencies.
parent bad084b0
2007-08-24 Jan Schmidt <thaytan@mad.scientist.com>
* ext/alsa/Makefile.am:
There is no GST_PLUGINS_BASE_LIBS defined.
* ext/alsa/gstalsa.c:
* ext/alsa/gstalsasink.c: (gst_alsasink_delay):
* ext/alsa/gstalsasrc.c: (gst_alsasrc_delay):
Add support for ALSA 24-bit formats.
snd_pcm_delay can return an error code, especially
during XRUNS. In that case, the best we can do is assume
delay = 0.
* gst/audioconvert/Makefile.am:
Add flags from -base before any more-remote dependencies.
2007-08-23 Sebastian Dröge <slomo@circular-chaos.org>
Based on a patch by: Davyd <davyd at madeley dot id dot au>
Based on a patch by: Davyd Madeley <davyd at madeley dot id dot au>
* gst/volume/gstvolume.c: (volume_choose_func),
(volume_update_real_volume), (gst_volume_set_volume),
......@@ -17,7 +17,6 @@ libgstalsa_la_CFLAGS = \
$(GST_CFLAGS) \
$(ALSA_CFLAGS)
libgstalsa_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
$(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
$(top_builddir)/gst-libs/gst/audio/libgstaudio-$(GST_MAJORMINOR).la \
$(GST_BASE_LIBS) \
......
......@@ -84,14 +84,21 @@ max_rate_err:
static const struct
{
const int width;
const int depth;
const int sformat;
const int uformat;
} pcmformats[4] = {
} pcmformats[] = {
{
SND_PCM_FORMAT_S8, SND_PCM_FORMAT_U8}, {
SND_PCM_FORMAT_S16, SND_PCM_FORMAT_U16}, {
SND_PCM_FORMAT_UNKNOWN, SND_PCM_FORMAT_UNKNOWN}, {
SND_PCM_FORMAT_S32, SND_PCM_FORMAT_U32}
8, 8, SND_PCM_FORMAT_S8, SND_PCM_FORMAT_U8}, {
16, 16, SND_PCM_FORMAT_S16, SND_PCM_FORMAT_U16}, {
32, 24, SND_PCM_FORMAT_S24, SND_PCM_FORMAT_U24}, {
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN) /* no endian-unspecific enum available */
24, 24, SND_PCM_FORMAT_S24_3LE, SND_PCM_FORMAT_U24_3LE}, {
#else
24, 24, SND_PCM_FORMAT_S24_3BE, SND_PCM_FORMAT_U24_3BE},}
#endif
32, 32, SND_PCM_FORMAT_S32, SND_PCM_FORMAT_U32}
};
static GstCaps *
......@@ -110,16 +117,24 @@ gst_alsa_detect_formats (GstObject * obj, snd_pcm_hw_params_t * hw_params,
for (i = 0; i < gst_caps_get_size (in_caps); ++i) {
GstStructure *scopy;
gint w, width = 0;
gint w, width = 0, depth = 0;
s = gst_caps_get_structure (in_caps, i);
if (!gst_structure_has_name (s, "audio/x-raw-int")) {
GST_WARNING_OBJECT (obj, "skipping non-int format");
continue;
}
gst_structure_get_int (s, "width", &width);
g_assert (width != 0 && (width % 8) == 0);
w = (width / 8) - 1;
if (!gst_structure_get_int (s, "width", &width) ||
!gst_structure_get_int (s, "depth", &depth))
continue;
if (width == 0 || (width % 8) != 0)
continue; /* Only full byte widths are valid */
for (w = 0; w < G_N_ELEMENTS (pcmformats); w++)
if (pcmformats[w].width == width && pcmformats[w].depth == depth)
break;
if (w == G_N_ELEMENTS (pcmformats))
continue; /* Unknown format */
if (snd_pcm_format_mask_test (mask, pcmformats[w].sformat) &&
snd_pcm_format_mask_test (mask, pcmformats[w].uformat)) {
/* template contains { true, false } or just one, leave it as it is */
......
......@@ -122,6 +122,18 @@ static GstStaticPadTemplate alsasink_sink_factory =
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SINK_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 24, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SINK_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 32, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SINK_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
......@@ -815,10 +827,15 @@ gst_alsasink_delay (GstAudioSink * asink)
{
GstAlsaSink *alsa;
snd_pcm_sframes_t delay;
int res;
alsa = GST_ALSA_SINK (asink);
snd_pcm_delay (alsa->handle, &delay);
res = snd_pcm_delay (alsa->handle, &delay);
if (G_UNLIKELY (res < 0)) {
GST_DEBUG_OBJECT (alsa, "snd_pcm_delay returned %d", res);
delay = 0;
}
return delay;
}
......
......@@ -122,6 +122,18 @@ static GstStaticPadTemplate alsasrc_src_factory =
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 32, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 24, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
"audio/x-raw-int, "
"endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, MAX ]; "
......@@ -792,10 +804,15 @@ gst_alsasrc_delay (GstAudioSrc * asrc)
{
GstAlsaSrc *alsa;
snd_pcm_sframes_t delay;
int res;
alsa = GST_ALSA_SRC (asrc);
snd_pcm_delay (alsa->handle, &delay);
res = snd_pcm_delay (alsa->handle, &delay);
if (G_UNLIKELY (res < 0)) {
GST_DEBUG_OBJECT (alsa, "snd_pcm_delay returned %d", res);
delay = 0;
}
return CLAMP (delay, 0, alsa->buffer_size);
}
......
......@@ -11,7 +11,7 @@ libgstaudioconvert_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(G
libgstaudioconvert_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstaudioconvert_la_LIBADD = \
$(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \
$(GST_LIBS) $(GST_BASE_LIBS)
$(GST_BASE_LIBS) $(GST_LIBS)
noinst_HEADERS = \
gstaudioconvert.h \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment