1
0
Эх сурвалжийг харах

moved and split up the linux xshm and pulseaudio capture plugins

fryshorts 11 жил өмнө
parent
commit
c0ab8fadda

+ 2 - 2
obs/obs-app.cpp

@@ -188,8 +188,8 @@ void OBSApp::OBSInit()
 #define INPUT_AUDIO_SOURCE  "wasapi_input_capture"
 #define OUTPUT_AUDIO_SOURCE "wasapi_output_capture"
 #else
-#define INPUT_AUDIO_SOURCE  ""
-#define OUTPUT_AUDIO_SOURCE ""
+#define INPUT_AUDIO_SOURCE  "pulse_input_capture"
+#define OUTPUT_AUDIO_SOURCE "pulse_output_capture"
 #endif
 
 const char *OBSApp::InputAudioSource() const

+ 3 - 0
obs/window-basic-main.cpp

@@ -172,6 +172,9 @@ void OBSBasic::OBSInit()
 #elif _WIN32
 	obs_load_module("win-wasapi");
 	obs_load_module("win-capture");
+#else
+	obs_load_module("linux-xshm");
+	obs_load_module("linux-pulseaudio");
 #endif
 
 	ResetAudioDevices();

+ 3 - 0
plugins/CMakeLists.txt

@@ -6,6 +6,9 @@ if(WIN32)
 	add_subdirectory(win-capture)
 elseif(APPLE)
 	add_subdirectory(mac-capture)
+elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+	add_subdirectory(linux-xshm)
+	add_subdirectory(linux-pulseaudio)
 endif()
 
 add_subdirectory(obs-ffmpeg)

+ 18 - 0
plugins/linux-pulseaudio/CMakeLists.txt

@@ -0,0 +1,18 @@
+find_package(PulseAudio REQUIRED)
+
+include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
+
+set(linux-pulseaudio_SOURCES
+	linux-pulseaudio.c
+	pulse-input.c
+)
+    
+add_library(linux-pulseaudio MODULE
+	${linux-pulseaudio_SOURCES}
+)
+target_link_libraries(linux-pulseaudio
+	libobs
+	${PULSEAUDIO_LIBRARY}
+)
+
+install_obs_plugin(linux-pulseaudio)

+ 0 - 2
test/linux/linux.c → plugins/linux-pulseaudio/linux-pulseaudio.c

@@ -18,14 +18,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 OBS_DECLARE_MODULE()
 
-extern struct obs_source_info xshm_input;
 extern struct obs_source_info pulse_input_capture;
 extern struct obs_source_info pulse_output_capture;
 
 bool obs_module_load(uint32_t obs_version)
 {
 	UNUSED_PARAMETER(obs_version);
-	obs_register_source(&xshm_input);
 	obs_register_source(&pulse_input_capture);
 	obs_register_source(&pulse_output_capture);
 	return true;

+ 0 - 0
test/linux/pulse-input.c → plugins/linux-pulseaudio/pulse-input.c


+ 25 - 0
plugins/linux-xshm/CMakeLists.txt

@@ -0,0 +1,25 @@
+find_package(X11 REQUIRED)
+
+include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
+
+set(linux-xshm_SOURCES
+	linux-xshm.c
+	xcursor.c
+	xshm-input.c
+)
+set(linux-xshm_HEADERS
+	xcursor.h
+)
+    
+add_library(linux-xshm MODULE
+	${linux-xshm_SOURCES}
+	${linux-xshm_HEADERS}
+)
+target_link_libraries(linux-xshm
+	libobs
+	${X11_LIBRARIES}
+	${X11_XShm_LIB}
+	${X11_Xfixes_LIB}
+)
+
+install_obs_plugin(linux-xshm)

+ 28 - 0
plugins/linux-xshm/linux-xshm.c

@@ -0,0 +1,28 @@
+/*
+Copyright (C) 2014 by Leonhard Oelke <[email protected]>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <obs-module.h>
+
+OBS_DECLARE_MODULE()
+
+extern struct obs_source_info xshm_input;
+
+bool obs_module_load(uint32_t obs_version)
+{
+	UNUSED_PARAMETER(obs_version);
+	obs_register_source(&xshm_input);
+	return true;
+}

+ 0 - 0
test/linux/xcursor.c → plugins/linux-xshm/xcursor.c


+ 0 - 0
test/linux/xcursor.h → plugins/linux-xshm/xcursor.h


+ 0 - 0
test/linux/xshm-input.c → plugins/linux-xshm/xshm-input.c


+ 0 - 4
test/CMakeLists.txt

@@ -8,7 +8,3 @@ endif()
 if(APPLE AND UNIX)
 	add_subdirectory(osx)
 endif()
-
-if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
-    add_subdirectory(linux)
-endif()

+ 0 - 30
test/linux/CMakeLists.txt

@@ -1,30 +0,0 @@
-project(linux)
-
-find_package(X11 REQUIRED)
-find_package(PulseAudio REQUIRED)
-
-include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
-
-set(linux_SOURCES
-    linux.c
-    xcursor.c
-    xshm-input.c
-    pulse-input.c
-)
-set(linux_HEADERS
-    xcursor.h
-)
-    
-add_library(linux MODULE
-    ${linux_SOURCES}
-    ${linux_HEADERS}
-)
-target_link_libraries(linux
-    libobs
-    ${X11_LIBRARIES}
-    ${X11_XShm_LIB}
-    ${X11_Xfixes_LIB}
-    ${PULSEAUDIO_LIBRARY}
-)
-
-install_obs_plugin(linux)