Skip to content

Obs30 merge fix #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: streamlabs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ find_package(nlohmann_json REQUIRED)
add_library(obs-browser MODULE)
add_library(OBS::browser ALIAS obs-browser)

option(ENABLE_BROWSER_PANELS "Enable Qt web browser panel support" ON)
option(ENABLE_BROWSER_PANELS "Enable Qt web browser panel support" OFF)
mark_as_advanced(ENABLE_BROWSER_PANELS)

target_sources(
Expand Down
9 changes: 6 additions & 3 deletions cmake/os-macos.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
find_package(Qt6 REQUIRED Widgets)

target_compile_definitions(obs-browser PRIVATE ENABLE_BROWSER_SHARED_TEXTURE ENABLE_BROWSER_QT_LOOP)
find_library(COREFOUNDATION CoreFoundation)
find_library(APPKIT AppKit)
mark_as_advanced(COREFOUNDATION APPKIT)

target_compile_definitions(obs-browser PRIVATE ENABLE_BROWSER_SHARED_TEXTURE)

if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.3)
target_compile_options(obs-browser PRIVATE -Wno-error=unqualified-std-cast-call)
endif()

target_link_libraries(obs-browser PRIVATE Qt::Widgets CEF::Wrapper "$<LINK_LIBRARY:FRAMEWORK,CoreFoundation.framework>"
target_link_libraries(obs-browser PRIVATE CEF::Wrapper "$<LINK_LIBRARY:FRAMEWORK,CoreFoundation.framework>"
"$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>")

set(helper_basename browser-helper)
Expand Down
5 changes: 5 additions & 0 deletions cmake/os-windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ target_compile_definitions(obs-browser-helper PRIVATE ENABLE_BROWSER_SHARED_TEXT
target_link_libraries(obs-browser-helper PRIVATE CEF::Wrapper CEF::Library nlohmann_json::nlohmann_json)
target_link_options(obs-browser-helper PRIVATE /IGNORE:4099 /SUBSYSTEM:WINDOWS)

message(STATUS "Buiding browser source plugin helper for Windows")

set(OBS_EXECUTABLE_DESTINATION "${OBS_PLUGIN_DESTINATION}")
set_target_properties_obs(
obs-browser-helper
PROPERTIES FOLDER plugins/obs-browser
PREFIX ""
OUTPUT_NAME obs-browser-page)

#make it dependence for obs-browser
add_dependencies(obs-browser obs-browser-helper)
4 changes: 2 additions & 2 deletions obs-browser-source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool BrowserSource::CreateBrowser()
obs_get_video_info(&ovi);
canvas_fps = (double)ovi.fps_num / (double)ovi.fps_den;
cefBrowserSettings.windowless_frame_rate =
(fps_custom) ? fps : canvas_fps;
(fps_custom) ? fps : (int)canvas_fps;
#endif
#else
cefBrowserSettings.windowless_frame_rate = fps;
Expand Down Expand Up @@ -656,7 +656,7 @@ void BrowserSource::Tick()
if (!fps_custom) {
if (!!cefBrowser && canvas_fps != video_fps) {
cefBrowser->GetHost()->SetWindowlessFrameRate(
video_fps);
(int)video_fps);
canvas_fps = video_fps;
}
}
Expand Down