moved and split up the linux xshm and pulseaudio capture plugins

This commit is contained in:
fryshorts 2014-03-10 23:02:37 +01:00
parent f28912101e
commit c0ab8fadda
13 changed files with 79 additions and 38 deletions

View file

@ -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

View file

@ -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();

View file

@ -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)

View file

@ -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)

View file

@ -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;

View file

@ -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)

View file

@ -0,0 +1,28 @@
/*
Copyright (C) 2014 by Leonhard Oelke <leonhard@in-verted.de>
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;
}

View file

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

View file

@ -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)