From 8a48802decd4cf355cc0646ad3cd12af40af0bc8 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Fri, 6 Dec 2013 10:20:29 +0100 Subject: [PATCH] Enable GStreamer 1.x support by default. GStreamer 1.x is universally available, and with 0.10 being deprecated, there should be no reason to default to 0.10 stil. --- CMakeLists.txt | 2 +- cmake/OpenCVFindLibsVideo.cmake | 44 ++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45e5b91..2e27852 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,7 @@ OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON) OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 ) OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS)) OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) -OCV_OPTION(WITH_GSTREAMER_1_X "Include Gstreamer 1.x support" OFF) +OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF ) OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) ) OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) ) diff --git a/cmake/OpenCVFindLibsVideo.cmake b/cmake/OpenCVFindLibsVideo.cmake index 737331e..807f4fb 100644 --- a/cmake/OpenCVFindLibsVideo.cmake +++ b/cmake/OpenCVFindLibsVideo.cmake @@ -12,28 +12,8 @@ endif(WITH_VFW) # --- GStreamer --- ocv_clear_vars(HAVE_GSTREAMER) -# try to find gstreamer 0.10 first -if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_1_X) - CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE) - CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO) - CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP) - CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF) - CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS) - - if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS) - set(HAVE_GSTREAMER TRUE) - set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-0.10_VERSION}) - set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-0.10_VERSION}) - set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-0.10_VERSION}) - set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION}) - set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION}) - endif() - -endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_1_X) - -# if gstreamer 0.10 was not found, or we specified we wanted 1.x, try to find it -if(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER) - #check for 1.x +# try to find gstreamer 1.x first +if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10) CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE) CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO) CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP) @@ -49,7 +29,25 @@ if(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER) set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-1.0_VERSION}) endif() -endif(WITH_GSTREAMER_1_X OR NOT HAVE_GSTREAMER) +endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10) + +# if gstreamer 1.x was not found, or we specified we wanted 0.10, try to find it +if(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER) + CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE) + CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO) + CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP) + CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF) + CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS) + + if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS) + set(HAVE_GSTREAMER TRUE) + set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-0.10_VERSION}) + set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-0.10_VERSION}) + set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-0.10_VERSION}) + set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION}) + set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION}) + endif() +endif(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER) # --- unicap --- ocv_clear_vars(HAVE_UNICAP) -- 2.7.4