Add build files and fix build for gst-plugins-bad dshowsrcwrapper plugin
authorLoic Le Page <llepage@fluendo.com>
Wed, 26 Jan 2022 20:03:10 +0000 (21:03 +0100)
committerLoïc Le Page <llepage@fluendo.com>
Fri, 18 Feb 2022 13:59:25 +0000 (14:59 +0100)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>

subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/BUILD.txt [deleted file]
subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/CMakeLists.txt [deleted file]
subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp
subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build [new file with mode: 0644]
subprojects/gst-plugins-bad/sys/directshow/meson.build

diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/BUILD.txt b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/BUILD.txt
deleted file mode 100644 (file)
index 994b9f4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-== Dependencies ==
-
- * CMake (tested with 3.9, likely >=3.0 will work)
-
- * GStreamer (1.8 or newer)
-
- * Microsoft SDK
-   (http://www.microsoft.com/en-us/download/details.aspx?id=8279). Don't
-   use any after 7.1, they don't include the samples. You can uncheck
-   the .NET stuff.
-
- * Visual Studio, in theory any version will do; tested with 2013
-   Express
-   (http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx).
-
-== Build ==
-
-First build the SDK "baseclasses" sample; they should have been
-installed in <SDK>/Samples/multimedia/directshow/baseclasses. Just
-open the SLN and build both Debug_MBCS and Release_MBCS.
-
-If you get a build error "ctype.h: no such file or directory", try
-retargetting the solution from the Project menu.
-
-Then go to sys/dshowsrcwrapper and use CMake to generate the project
-file for your chosen version of Visual Studio. There are two influential
-variables:
-
- * GST_INSTALL_BASE: your GStreamer installation directory
-   (default C:\gstreamer\1.0\x86 or C:\gstreamer\1.0\x86_64)
-
- * SDK_INSTALL_BASE: the Windows SDK installation path (default
-   C:\Program Files\Microsoft SDKs\Windows\v7.0).
-
-mkdir build
-cd build
-cmake -G "Visual Studio 12" ..
-
-Open the SLN and build the project. Copy the DLL to the GStreamer
-plugins directory.
diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/CMakeLists.txt b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/CMakeLists.txt
deleted file mode 100644 (file)
index 57c3114..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-
-CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
-
-PROJECT(dshowsrcwrapper)
-
-IF ("${CMAKE_GENERATOR}" MATCHES "Win64")
-  SET(ARCH_ "x86_64")
-ELSE ()
-  SET(ARCH_ "x86")
-ENDIF ()
-SET(GST_INSTALL_BASE "C:\\gstreamer\\1.0\\${ARCH_}" CACHE PATH "Path to the GStreamer install base")
-SET(SDK_INSTALL_BASE "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1" CACHE PATH "Path to the Windows SDK root")
-
-SET_PROPERTY(
-  DIRECTORY
-  APPEND PROPERTY COMPILE_DEFINITIONS
-  HAVE_CONFIG_H
-)
-
-INCLUDE_DIRECTORIES(
-  ${GST_INSTALL_BASE}/include
-  ${GST_INSTALL_BASE}/include/gstreamer-1.0
-  ${GST_INSTALL_BASE}/include/glib-2.0
-  ${GST_INSTALL_BASE}/lib/glib-2.0/include
-  ${GST_INSTALL_BASE}/lib/gstreamer-1.0/include
-  ${SDK_INSTALL_BASE}/Samples/multimedia/directshow/baseclasses
-
-  # When building from the Cerbero build dir, this is where config.h is.
-  ${PROJECT_SOURCE_DIR}/../../_builddir
-)
-
-IF ("${CMAKE_GENERATOR}" MATCHES "Win64")
-  SET(ARCH_ "x64/")
-ELSE ()
-  SET(ARCH_ "")
-ENDIF ()
-
-LINK_DIRECTORIES(
-  ${GST_INSTALL_BASE}/lib
-  ${SDK_INSTALL_BASE}/Samples/multimedia/directshow/baseclasses/${ARCH_}Release_MBCS
-  ${SDK_INSTALL_BASE}/Samples/multimedia/directshow/baseclasses/${ARCH_}Debug_MBCS
-)
-
-SET(CMAKE_SHARED_LINKER_FLAGS "${CMALE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
-
-ADD_LIBRARY(libgstdshowsrcwrapper SHARED
-  dshowdeviceprovider.cpp
-  dshowdeviceprovider.h
-  gstdshow.cpp
-  gstdshow.h
-  gstdshowfakesink.cpp
-  gstdshowfakesink.h
-  gstdshowaudiosrc.cpp
-  gstdshowaudiosrc.h
-  gstdshowvideosrc.cpp
-  gstdshowvideosrc.h
-  gstdshowsrcwrapper.cpp
-)
-
-TARGET_LINK_LIBRARIES(libgstdshowsrcwrapper
-  gstreamer-1.0
-  gstaudio-1.0
-  gstvideo-1.0
-  gstbase-1.0
-  glib-2.0
-  gobject-2.0
-  debug strmbasd
-  optimized strmbase
-  rpcrt4
-  uuid
-  winmm
-)
index 483c29d..dc0d5d6 100644 (file)
@@ -456,6 +456,8 @@ gst_dshowvideosrc_change_state (GstElement * element, GstStateChange transition)
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
       break;
+    default:
+      break;
   }
 
   return GST_ELEMENT_CLASS(gst_dshowvideosrc_parent_class)->change_state(element, transition);
diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build
new file mode 100644 (file)
index 0000000..2a64ce8
--- /dev/null
@@ -0,0 +1,43 @@
+dshowsrcwrapper_sources = [
+  'dshowdeviceprovider.cpp',
+  'gstdshow.cpp',
+  'gstdshowfakesink.cpp',
+  'gstdshowaudiosrc.cpp',
+  'gstdshowvideosrc.cpp',
+  'gstdshowsrcwrapper.cpp'
+]
+
+if not strmbase_dep.found()
+  message('strmbase not found, not building dshowsrcwrapper')
+  subdir_done()
+endif
+
+winmm_dep = cxx.find_library('winmm', required: get_option('directshow'))
+if not winmm_dep.found()
+  message('winmm not found, not building dshowsrcwrapper')
+  subdir_done()
+endif
+
+rpcrt4_dep = cxx.find_library('rpcrt4', required: get_option('directshow'))
+if not rpcrt4_dep.found()
+  message('rpcrt4 not found, not building dshowsrcwrapper')
+  subdir_done()
+endif
+
+gstdshowsrcwrapper = library('gstdshowsrcwrapper',
+  dshowsrcwrapper_sources,
+  cpp_args : gst_plugins_bad_args,
+  include_directories : [configinc],
+  dependencies : [
+    gstaudio_dep,
+    gstvideo_dep,
+    strmbase_dep,
+    winmm_dep,
+    rpcrt4_dep
+  ],
+  install : true,
+  install_dir : plugins_install_dir,
+  override_options : ['cpp_std=none'])
+
+pkgconfig.generate(gstdshowsrcwrapper, install_dir : plugins_pkgconfig_install_dir)
+plugins += [gstdshowsrcwrapper]
index b84d249..b06f112 100644 (file)
@@ -22,5 +22,5 @@ endif
 
 subdir('strmbase')
 subdir('dshowdecwrapper')
-#subdir('dshowsrcwrapper')
+subdir('dshowsrcwrapper')
 #subdir('dshowvideosink')