--- gst-plugins-bad-0.10.21.orig/configure.ac	2011-01-21 16:38:58.000000000 +0300
+++ gst-plugins-bad-0.10.21/configure.ac	2012-03-14 12:15:47.014851308 +0400
@@ -479,6 +479,40 @@
   AC_SUBST(HAVE_DIRECTDRAW)
 ])
 
+dnl Direct3D9
+AM_CONDITIONAL(USE_DIRECT3D9, true)
+AG_GST_CHECK_FEATURE(DIRECT3D9, [Direct3D9], winscreencap, [
+  HAVE_DIRECT3D="no"
+
+  save_LIBS="$LIBS"
+
+  LIBS="$LIBS -ld3d9 -lgdi32"
+  AC_MSG_CHECKING(for Direct3D9 LDFLAGS)
+  AC_LINK_IFELSE([
+#include <windows.h>
+#include <d3d9.h>
+
+int main ()
+{
+  Direct3DCreate9 (D3D_SDK_VERSION);
+
+  return 0;
+}
+],
+    [HAVE_DIRECT3D9="yes"],
+    [HAVE_DIRECT3D9="no"])
+  AC_MSG_RESULT($HAVE_DIRECT3D9)
+
+  LIBS=$save_LIBS
+
+  if test "x$HAVE_DIRECT3D9" = "xyes";  then
+
+    DIRECT3D9_LIBS="-ld3d9 -lgdi32"
+    AC_SUBST(DIRECT3D9_LIBS)
+  fi
+  AC_SUBST(HAVE_DIRECT3D9)
+])
+
 dnl *** AppleMedia (OS X and iOS) ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
 HAVE_APPLE_MEDIA="no"
