From b355345ef57746b49b9859b7c25feba4d139984d Mon Sep 17 00:00:00 2001 From: Loic Le Page Date: Wed, 26 Jan 2022 21:03:10 +0100 Subject: [PATCH] Add build files and fix build for gst-plugins-bad dshowsrcwrapper plugin Part-of: --- .../sys/directshow/dshowsrcwrapper/BUILD.txt | 41 ----------- .../directshow/dshowsrcwrapper/CMakeLists.txt | 72 ------------------- .../dshowsrcwrapper/gstdshowvideosrc.cpp | 2 + .../directshow/dshowsrcwrapper/meson.build | 43 +++++++++++ .../sys/directshow/meson.build | 2 +- 5 files changed, 46 insertions(+), 114 deletions(-) delete mode 100644 subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/BUILD.txt delete mode 100644 subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/CMakeLists.txt create mode 100644 subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/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 index 994b9f4743..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/BUILD.txt +++ /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 /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 index 57c3114fdd..0000000000 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/CMakeLists.txt +++ /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 -) diff --git a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp index 483c29d8dc..dc0d5d6ef9 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp +++ b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/gstdshowvideosrc.cpp @@ -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 index 0000000000..2a64ce85b1 --- /dev/null +++ b/subprojects/gst-plugins-bad/sys/directshow/dshowsrcwrapper/meson.build @@ -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] diff --git a/subprojects/gst-plugins-bad/sys/directshow/meson.build b/subprojects/gst-plugins-bad/sys/directshow/meson.build index b84d249bfb..b06f112c68 100644 --- a/subprojects/gst-plugins-bad/sys/directshow/meson.build +++ b/subprojects/gst-plugins-bad/sys/directshow/meson.build @@ -22,5 +22,5 @@ endif subdir('strmbase') subdir('dshowdecwrapper') -#subdir('dshowsrcwrapper') +subdir('dshowsrcwrapper') #subdir('dshowvideosink')