Skip to content

Commit

Permalink
Move mac display capture to mac-capture module
Browse files Browse the repository at this point in the history
It was kind of silly that it was residing within the test-input module.
  • Loading branch information
jp9000 committed Jul 11, 2014
1 parent 4cc1a42 commit 3394ac6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 32 deletions.
18 changes: 15 additions & 3 deletions plugins/mac-capture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ project(mac-capture)
find_library(COREAUDIO CoreAudio)
find_library(AUDIOUNIT AudioUnit)
find_library(COREFOUNDATION CoreFoundation)
find_library(IOSURF IOSurface)
find_library(COCOA Cocoa)

include_directories(${COREAUDIO}
${AUDIOUNIT}
${COREFOUNDATION})
${COREFOUNDATION}
${IOSURF}
${COCOA})

set(mac-capture_HEADERS
audio-device-enum.h
Expand All @@ -15,15 +19,23 @@ set(mac-capture_HEADERS
set(mac-capture_SOURCES
plugin-main.c
audio-device-enum.c
mac-audio.c)
mac-audio.c
mac-screen-capture.m)

set_source_files_properties(mac-screen-capture.m
PROPERTIES LANGUAGE C
COMPILE_FLAGS "-fobjc-arc")

add_library(mac-capture MODULE
${mac-capture_SOURCES}
${mac-capture_HEADERS})
target_link_libraries(mac-capture
libobs
${COREAUDIO}
${AUDIOUNIT}
${COREFOUNDATION})
${COREFOUNDATION}
${IOSURF}
${COCOA})

install_obs_plugin(mac-capture)
install_obs_plugin_data(mac-capture ../../build/data/obs-plugins/mac-capture)
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ static bool init_display_stream(struct display_capture *dc)
if (!dc->sampler)
goto fail;

char *effect_file = obs_find_plugin_file("test-input/draw_rect.effect");
char *effect_file = obs_find_plugin_file(
"mac-capture/draw_rect.effect");
dc->draw_effect = gs_create_effect_from_file(effect_file, NULL);
bfree(effect_file);
if (!dc->draw_effect)
Expand Down
2 changes: 2 additions & 0 deletions plugins/mac-capture/plugin-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ OBS_DECLARE_MODULE()

extern struct obs_source_info coreaudio_input_capture_info;
extern struct obs_source_info coreaudio_output_capture_info;
extern struct obs_source_info display_capture_info;

bool obs_module_load(uint32_t libobs_version)
{
obs_register_source(&coreaudio_input_capture_info);
obs_register_source(&coreaudio_output_capture_info);
obs_register_source(&display_capture_info);

UNUSED_PARAMETER(libobs_version);
return true;
Expand Down
21 changes: 1 addition & 20 deletions test/test-input/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,7 @@ project(test-input)

include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")

if(APPLE)
set(test-input_PLATFORM_SOURCES
test-desktop.m)

set_source_files_properties(test-desktop.m
PROPERTIES LANGUAGE C
COMPILE_FLAGS "-fobjc-arc")

find_library(IOSURF IOSurface)
include_directories(${IOSURF})
mark_as_advanced(${IOSURF})

find_library(COCOA Cocoa)
include_directories(${COCOA})
mark_as_advanced(${COCOA})

set(test-input_PLATFORM_DEPS
${IOSURF}
${COCOA})
elseif(WIN32)
if(WIN32)
set(test-input_PLATFORM_DEPS
w32-pthreads)
endif()
Expand Down
8 changes: 0 additions & 8 deletions test/test-input/test-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ extern struct obs_source_info test_random;
extern struct obs_source_info test_sinewave;
extern struct obs_source_info test_filter;

#ifdef __APPLE__
extern struct obs_source_info display_capture_info;
#endif

bool obs_module_load(uint32_t libobs_version)
{
obs_register_source(&test_random);
obs_register_source(&test_sinewave);
obs_register_source(&test_filter);

#ifdef __APPLE__
obs_register_source(&display_capture_info);
#endif

UNUSED_PARAMETER(libobs_version);
return true;
}

0 comments on commit 3394ac6

Please sign in to comment.