Advertisement
KukuRuzo

psimedia patch

Mar 30th, 2024
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.30 KB | None | 0 0
  1.  
  2.  
  3. diff --git a/plugins/generic/psimedia/CMakeLists.txt b/plugins/generic/psimedia/CMakeLists.txt
  4. index bc184283..6a789224 100644
  5. --- a/plugins/generic/psimedia/CMakeLists.txt
  6. +++ b/plugins/generic/psimedia/CMakeLists.txt
  7. @@ -17,23 +17,29 @@ if( (CMAKE_CROSSCOMPILING) AND (DEFINED MSYS) )
  8.      message(STATUS "MXE root path: ${CMAKE_PREFIX_PATH}")
  9.  endif()
  10.  
  11. +if(POLICY CMP0053)
  12. +    cmake_policy(SET CMP0053 NEW)
  13. +endif()
  14. +
  15.  # On Windows debug library should have 'd' postfix.
  16.  if(WIN32)
  17. +    unset(GST_SDK)
  18.      set(CMAKE_DEBUG_POSTFIX "d")
  19.      if(NOT USE_MXE)
  20.          if(CMAKE_SIZEOF_VOID_P MATCHES "8")
  21.              if(MSVC)
  22. -                set(GST_SDK $ENV{GSTREAMER_1_0_ROOT_MSVC_X86_64} CACHE STRING "Path to gstreamer SDK")
  23. +                set(GST_SDK_PATH $ENV{GSTREAMER_1_0_ROOT_MSVC_X86_64} CACHE STRING "Path to gstreamer SDK")
  24.              else()
  25. -                set(GST_SDK $ENV{GSTREAMER_1_0_ROOT_X86_64}  CACHE STRING "Path to gstreamer SDK")
  26. +                set(GST_SDK_PATH $ENV{GSTREAMER_1_0_ROOT_X86_64}  CACHE STRING "Path to gstreamer SDK")
  27.              endif()
  28.          else()
  29.              if(MSVC)
  30. -                set(GST_SDK $ENV{GSTREAMER_1_0_ROOT_MSVC_X86} CACHE STRING "Path to gstreamer SDK")
  31. +                set(GST_SDK_PATH $ENV{GSTREAMER_1_0_ROOT_MSVC_X86} CACHE STRING "Path to gstreamer SDK")
  32.              else()
  33. -                set(GST_SDK $ENV{GSTREAMER_1_0_ROOT_x86}  CACHE STRING "Path to gstreamer SDK")
  34. +                set(GST_SDK_PATH $ENV{GSTREAMER_1_0_ROOT_x86}  CACHE STRING "Path to gstreamer SDK")
  35.              endif()
  36.          endif()
  37. +        string(REPLACE "\\" "/" GST_SDK ${GST_SDK_PATH})
  38.          message(STATUS "GST_SDK: ${GST_SDK}")
  39.          if(GST_SDK)
  40.              set(ENV{PKG_CONFIG_PATH} "${GST_SDK}/lib/pkgconfig")
  41. @@ -125,8 +131,8 @@ endif()
  42.  if(BUILD_DEMO)
  43.      add_subdirectory(demo)
  44.      add_subdirectory(gstplugin)
  45. -    add_subdirectory(gstprovider)
  46.  endif()
  47.  if(BUILD_PSIPLUGIN)
  48.      add_subdirectory(psiplugin)
  49.  endif()
  50. +add_subdirectory(gstprovider)
  51. diff --git a/plugins/generic/psimedia/gstplugin/CMakeLists.txt b/plugins/generic/psimedia/gstplugin/CMakeLists.txt
  52. index e4414634..79e8fa33 100644
  53. --- a/plugins/generic/psimedia/gstplugin/CMakeLists.txt
  54. +++ b/plugins/generic/psimedia/gstplugin/CMakeLists.txt
  55. @@ -21,6 +21,8 @@ include_directories(
  56.      ${CMAKE_CURRENT_BINARY_DIR}
  57.      ${CMAKE_CURRENT_LIST_DIR}
  58.      ${ABS_GPLUG_PARENT_DIR}/psimedia
  59. +    ${ABS_GPLUG_PARENT_DIR}/gstprovider
  60. +    ${ABS_GPLUG_PARENT_DIR}/gstprovider/devices
  61.  )
  62.  
  63.  set(SOURCES
  64. @@ -42,5 +44,7 @@ target_link_libraries(
  65.      ${PLUGIN}
  66.      ${QT_DEPLIBS}
  67.  )
  68. +add_dependencies(${PLUGIN} gstprovidersrc)
  69.  target_link_libraries(${PLUGIN} gstprovidersrc)
  70.  install(TARGETS ${PLUGIN} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
  71. +
  72. diff --git a/plugins/generic/psimedia/gstprovider/CMakeLists.txt b/plugins/generic/psimedia/gstprovider/CMakeLists.txt
  73. index 585730fd..0590f48f 100644
  74. --- a/plugins/generic/psimedia/gstprovider/CMakeLists.txt
  75. +++ b/plugins/generic/psimedia/gstprovider/CMakeLists.txt
  76. @@ -128,6 +128,10 @@ endif()
  77.  set(PROVIDERLIB gstprovidersrc)
  78.  add_library(${PROVIDERLIB} STATIC ${SOURCES})
  79.  
  80. +if(UNIX AND ${QT_DEFAULT_MAJOR_VERSION} GREATER_EQUAL 6)
  81. +    add_definitions(-fPIC)
  82. +endif()
  83. +
  84.  target_include_directories(${PROVIDERLIB}
  85.                             PUBLIC
  86.                             ${CMAKE_CURRENT_SOURCE_DIR}
  87. diff --git a/plugins/generic/psimedia/gstprovider/devices.cpp b/plugins/generic/psimedia/gstprovider/devices.cpp
  88. index c404fca8..ce110b19 100644
  89. --- a/plugins/generic/psimedia/gstprovider/devices.cpp
  90. +++ b/plugins/generic/psimedia/gstprovider/devices.cpp
  91. @@ -188,7 +188,11 @@ public:
  92.          }
  93.  
  94.          gchar *name = gst_device_get_display_name(gdev);
  95. +#ifdef Q_OS_WINDOWS
  96. +        d.name      = QString::fromLocal8Bit(name);
  97. +#else
  98.          d.name      = QString::fromUtf8(name);
  99. +#endif
  100.          g_free(name);
  101.  
  102.          if (gst_device_has_classes(gdev, "Audio/Source")) {
  103. diff --git a/plugins/generic/psimedia/gstprovider/gstthread.cpp b/plugins/generic/psimedia/gstprovider/gstthread.cpp
  104. index 61664738..bc15cc1c 100644
  105. --- a/plugins/generic/psimedia/gstprovider/gstthread.cpp
  106. +++ b/plugins/generic/psimedia/gstprovider/gstthread.cpp
  107. @@ -242,10 +242,10 @@ public:
  108.  
  109.  class GstMainLoop::Private {
  110.  public:
  111. -    typedef struct {
  112. +    struct BridgeQueueSource{
  113.          GSource               parent;
  114.          GstMainLoop::Private *d = nullptr;
  115. -    } BridgeQueueSource;
  116. +    };
  117.  
  118.      GstMainLoop                                        *q = nullptr;
  119.      QString                                             pluginPath;
  120. diff --git a/plugins/generic/psimedia/psiplugin/CMakeLists.txt b/plugins/generic/psimedia/psiplugin/CMakeLists.txt
  121. index 5ea0f8bd..549a3868 100644
  122. --- a/plugins/generic/psimedia/psiplugin/CMakeLists.txt
  123. +++ b/plugins/generic/psimedia/psiplugin/CMakeLists.txt
  124. @@ -19,7 +19,6 @@ get_filename_component(ABS_PLUGINS_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOL
  125.  set(PLUGINS_ROOT_DIR "${ABS_PLUGINS_ROOT_DIR}" CACHE STRING "Plugins root path. Path where include directory placed")
  126.  
  127.  if(NOT BUILD_DEMO)
  128. -    include(${ABS_PLUGINS_ROOT_DIR}/gstprovider/CMakeLists.txt)
  129.      include_directories(
  130.          ${ABS_PLUGINS_ROOT_DIR}/gstprovider
  131.          ${ABS_PLUGINS_ROOT_DIR}/gstprovider/devices
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement