From 936d87f64b2d6cc66d689910dd5a8cbd3d63b055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Wed, 26 Aug 2009 01:18:00 +0100 Subject: [PATCH] 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. --- configure.ac | 55 +++++++++++++++++++++-------- sys/directdraw/Makefile.am | 24 ++++++------- sys/directsound/Makefile.am | 24 ++++++------- sys/directsound/gstdirectsoundsrc.c | 8 ----- 4 files changed, 65 insertions(+), 46 deletions(-) diff --git a/configure.ac b/configure.ac index e25b93dd0a..423a3ea09a 100644 --- a/configure.ac +++ b/configure.ac @@ -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 +#include +#include -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) diff --git a/sys/directdraw/Makefile.am b/sys/directdraw/Makefile.am index 647d58ac27..559db9b367 100644 --- a/sys/directdraw/Makefile.am +++ b/sys/directdraw/Makefile.am @@ -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 diff --git a/sys/directsound/Makefile.am b/sys/directsound/Makefile.am index 319940148e..cd1e059445 100644 --- a/sys/directsound/Makefile.am +++ b/sys/directsound/Makefile.am @@ -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 diff --git a/sys/directsound/gstdirectsoundsrc.c b/sys/directsound/gstdirectsoundsrc.c index fce9d5c8ca..76a3dcf4be 100755 --- a/sys/directsound/gstdirectsoundsrc.c +++ b/sys/directsound/gstdirectsoundsrc.c @@ -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,