summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2009-08-26 01:18:00 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-26 01:18:00 +0100
commit936d87f64b2d6cc66d689910dd5a8cbd3d63b055 (patch)
treec31eecc344fda4f2cdeccec157df9d945bf08b79
parentf1c4bdf5be57c95defcbfe735c94664e0ec4db65 (diff)
downloadgstreamer-plugins-bad-936d87f64b2d6cc66d689910dd5a8cbd3d63b055.tar.gz
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.
-rw-r--r--configure.ac55
-rw-r--r--sys/directdraw/Makefile.am24
-rw-r--r--sys/directsound/Makefile.am24
-rwxr-xr-xsys/directsound/gstdirectsoundsrc.c8
4 files changed, 65 insertions, 46 deletions
diff --git a/configure.ac b/configure.ac
index e25b93dd0..423a3ea09 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 <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)
diff --git a/sys/directdraw/Makefile.am b/sys/directdraw/Makefile.am
index 647d58ac2..559db9b36 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 319940148..cd1e05944 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 fce9d5c8c..76a3dcf4b 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,