directdraw, directsound: unify CFLAGS and fix configure checks for DirectX-based plugins

One set of CFLAGS for all DirectX-based plugins. Correct header/library
checks for DirectX-based-plugins. Remove unused variable and label in
directsoundsrc.

Fixes #593068.
This commit is contained in:
Руслан Ижбулатов 2009-08-26 01:18:00 +01:00 committed by Tim-Philipp Müller
parent f1c4bdf5be
commit 936d87f64b
4 changed files with 65 additions and 46 deletions

View file

@ -355,17 +355,44 @@ dnl *** sys plug-ins ***
dnl DirectSound
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], [directsound], [
AC_CHECK_HEADER(dsound.h, HAVE_DIRECTSOUND="yes", HAVE_DIRECTSOUND="no")
])
AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
HAVE_DIRECTSOUND="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -ldsound -ldxerr9 -luser32"
AC_MSG_CHECKING(for DirectSound LDFLAGS)
AC_LINK_IFELSE([
#include <windows.h>
#include <dxerr9.h>
#include <dsound.h>
AC_CHECK_LIB( dsound, DXGetErrorString9, [
echo "Errorstrings in DirectSoundSink - enabled"
AM_CONDITIONAL( DSOUND9, true )
], [
echo "Errorstrings in DirectSoundSink - disabled"
AM_CONDITIONAL( DSOUND9, false )
] )
int main ()
{
DXGetErrorString9 (0);
DirectSoundCreate(NULL, NULL, NULL);
return 0;
}
],
[HAVE_DIRECTSOUND="yes"],
[HAVE_DIRECTSOUND="no"])
AC_MSG_RESULT($HAVE_DIRECTSOUND)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_DIRECTSOUND" = "xyes"; then
dnl this is much more than we want
DIRECTSOUND_LIBS="-ldsound -ldxerr9 -luser32"
AC_SUBST(DIRECTX_CFLAGS)
AC_SUBST(DIRECTX_LDFLAGS)
AC_SUBST(DIRECTSOUND_LIBS)
fi
AC_SUBST(HAVE_DIRECTSOUND)
])
dnl DirectDraw
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTDRAW, true)
@ -374,8 +401,8 @@ AG_GST_CHECK_FEATURE(DIRECTDRAW, [DirectDraw plug-in], directdrawsink, [
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTDRAW_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTDRAW_LDFLAGS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -lddraw -lgdi32"
AC_MSG_CHECKING(for DirectDraw LDFLAGS)
AC_LINK_IFELSE([
@ -400,8 +427,8 @@ int main ()
if test "x$HAVE_DIRECTDRAW" = "xyes"; then
dnl this is much more than we want
DIRECTDRAW_LIBS="-lddraw -ldxguid -lgdi32"
AC_SUBST(DIRECTDRAW_CFLAGS)
AC_SUBST(DIRECTDRAW_LDFLAGS)
AC_SUBST(DIRECTX_CFLAGS)
AC_SUBST(DIRECTX_LDFLAGS)
AC_SUBST(DIRECTDRAW_LIBS)
fi
AC_SUBST(HAVE_DIRECTDRAW)

View file

@ -1,12 +1,12 @@
plugin_LTLIBRARIES = libgstdirectdrawsink.la
libgstdirectdrawsink_la_SOURCES = gstdirectdrawsink.c gstdirectdrawplugin.c
libgstdirectdrawsink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTDRAW_CFLAGS)
libgstdirectdrawsink_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR)
libgstdirectdrawsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTDRAW_LDFLAGS)
libgstdirectdrawsink_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS= gstdirectdrawsink.h
plugin_LTLIBRARIES = libgstdirectdrawsink.la
libgstdirectdrawsink_la_SOURCES = gstdirectdrawsink.c gstdirectdrawplugin.c
libgstdirectdrawsink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
libgstdirectdrawsink_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR)
libgstdirectdrawsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS)
libgstdirectdrawsink_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS= gstdirectdrawsink.h

View file

@ -1,12 +1,12 @@
plugin_LTLIBRARIES = libgstdirectsoundsrc.la
libgstdirectsoundsrc_la_SOURCES = gstdirectsoundsrc.c gstdirectsoundplugin.c
libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS)
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR) -ldsound
libgstdirectsoundsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTDRAW_LDFLAGS)
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS= gstdirectsoundsrc.h
plugin_LTLIBRARIES = libgstdirectsoundsrc.la
libgstdirectsoundsrc_la_SOURCES = gstdirectsoundsrc.c gstdirectsoundplugin.c
libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR) -ldsound
libgstdirectsoundsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS)
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS= gstdirectsoundsrc.h

View file

@ -365,8 +365,6 @@ gst_directsound_src_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
HRESULT hRes; /* Result for windows functions */
DSCBUFFERDESC descSecondary; /* Capturebuffer decsiption */
int fmt = 0; /* audio format */
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
GST_DEBUG ("initializing directsoundsrc\n");
@ -473,12 +471,6 @@ WAVEFORMATEX.nBlockAlign: %d, WAVEFORMATEX.nAvgBytesPerSec: %ld\n", spec->channe
return TRUE;
wrong_format:
{
GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,
("Unable to get format %d", spec->format), (NULL));
return FALSE;
}
capture_buffer:
{
GST_ELEMENT_ERROR (dsoundsrc, RESOURCE, OPEN_READ,