Skip to content

Commit

Permalink
Add mac-syphon plugin
Browse files Browse the repository at this point in the history
Allows adding Syphon servers as sources, and provides game-capture if
used with SyphonInject (specifically the scripting additions have to be
installed for SyphonInject to work from within OBS)
  • Loading branch information
palana committed Oct 4, 2014
1 parent 0f15cc1 commit 019a70f
Show file tree
Hide file tree
Showing 8 changed files with 1,263 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "plugins/win-dshow/libdshowcapture"]
path = plugins/win-dshow/libdshowcapture
url = https://github.com/jp9000/libdshowcapture.git

[submodule "plugins/mac-syphon/syphon-framework"]
path = plugins/mac-syphon/syphon-framework
url = https://github.com/palana/Syphon-Framework.git
1 change: 1 addition & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if(WIN32)
elseif(APPLE)
add_subdirectory(mac-avcapture)
add_subdirectory(mac-capture)
add_subdirectory(mac-syphon)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
add_subdirectory(linux-capture)
add_subdirectory(linux-pulseaudio)
Expand Down
84 changes: 84 additions & 0 deletions plugins/mac-syphon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
project(mac-syphon)

find_library(COCOA Cocoa)
find_library(IOSURF IOSurface)
find_library(SCRIPTINGBRIDGE ScriptingBridge)
find_package(OpenGL REQUIRED)

include_directories(${COCOA}
${IOSURF}
${SCRIPTINGBIRDGE}
${OPENGL_INCLUDE_DIR})

set(syphon_HEADERS
syphon-framework/Syphon_Prefix.pch
syphon-framework/Syphon.h
syphon-framework/SyphonBuildMacros.h
syphon-framework/SyphonCFMessageReceiver.h
syphon-framework/SyphonCFMessageSender.h
syphon-framework/SyphonClient.h
syphon-framework/SyphonClientConnectionManager.h
syphon-framework/SyphonDispatch.h
syphon-framework/SyphonIOSurfaceImage.h
syphon-framework/SyphonImage.h
syphon-framework/SyphonMachMessageReceiver.h
syphon-framework/SyphonMachMessageSender.h
syphon-framework/SyphonMessageQueue.h
syphon-framework/SyphonMessageReceiver.h
syphon-framework/SyphonMessageSender.h
syphon-framework/SyphonMessaging.h
syphon-framework/SyphonOpenGLFunctions.h
syphon-framework/SyphonPrivate.h
syphon-framework/SyphonServer.h
syphon-framework/SyphonServerConnectionManager.h
syphon-framework/SyphonServerDirectory.h
)

set(syphon_SOURCES
syphon-framework/SyphonCFMessageReceiver.m
syphon-framework/SyphonCFMessageSender.m
syphon-framework/SyphonClient.m
syphon-framework/SyphonClientConnectionManager.m
syphon-framework/SyphonDispatch.c
syphon-framework/SyphonImage.m
syphon-framework/SyphonIOSurfaceImage.m
syphon-framework/SyphonMachMessageReceiver.m
syphon-framework/SyphonMachMessageSender.m
syphon-framework/SyphonMessageQueue.m
syphon-framework/SyphonMessageReceiver.m
syphon-framework/SyphonMessageSender.m
syphon-framework/SyphonMessaging.m
syphon-framework/SyphonOpenGLFunctions.c
syphon-framework/SyphonPrivate.m
syphon-framework/SyphonServer.m
syphon-framework/SyphonServerConnectionManager.m
syphon-framework/SyphonServerDirectory.m
)

set(mac-syphon_HEADERS
)

set(mac-syphon_SOURCES
syphon.m
plugin-main.c)

set_source_files_properties(${mac-syphon_SOURCES} ${syphon_SOURCES}
PROPERTIES LANGUAGE C)

add_definitions(-DSYPHON_UNIQUE_CLASS_NAME_PREFIX=OBS_ -include
${PROJECT_SOURCE_DIR}/syphon-framework/Syphon_Prefix.pch)

add_library(mac-syphon MODULE
${mac-syphon_SOURCES}
${mac-syphon_HEADERS}
${syphon_HEADERS}
${syphon_SOURCES})

target_link_libraries(mac-syphon
libobs
${COCOA}
${IOSURF}
${SCRIPTINGBRIDGE}
${OPENGL_gl_LIBRARY})

install_obs_plugin_with_data(mac-syphon data)
10 changes: 10 additions & 0 deletions plugins/mac-syphon/data/locale/en-US.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source="Source"
LaunchSyphonInject="Launch SyphonInject"
Inject="Inject"
Application="Application"
SyphonLicense="Syphon License"
Crop="Crop"
Crop.origin.x="Crop left"
Crop.origin.y="Crop top"
Crop.size.width="Crop right"
Crop.size.height="Crop bottom"
26 changes: 26 additions & 0 deletions plugins/mac-syphon/data/syphon_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Syphon

Copyright 2010-2011 bangnoise (Tom Butterworth) & vade (Anton Marini).
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

12 changes: 12 additions & 0 deletions plugins/mac-syphon/plugin-main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <obs-module.h>

OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("syphon", "en-US")

extern struct obs_source_info syphon_info;

bool obs_module_load(void)
{
obs_register_source(&syphon_info);
return true;
}
1 change: 1 addition & 0 deletions plugins/mac-syphon/syphon-framework
Submodule syphon-framework added at 01b144
Loading

0 comments on commit 019a70f

Please sign in to comment.