Skip to content
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

Flatpak #438

Open
wants to merge 5 commits into
base: master
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
30 changes: 4 additions & 26 deletions cmake/linux/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ include_guard(GLOBAL)

include(helpers_common)

set(PLUGIN_FOLDER ${CMAKE_PROJECT_NAME})

# set_target_properties_plugin: Set target properties for use in obs-studio
function(set_target_properties_plugin target)
set(options "")
Expand All @@ -26,23 +24,10 @@ function(set_target_properties_plugin target)
SOVERSION ${PLUGIN_VERSION}
PREFIX "")

# install(
# TARGETS ${target}
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)

if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(OBSARCHNAME "32bit")
elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(OBSARCHNAME "64bit")
else ()
message(FATAL_ERROR "Unsupport architecture")
endif()

install(
TARGETS ${target}
RUNTIME DESTINATION dist/${PLUGIN_FOLDER}/bin/${OBSARCHNAME}
LIBRARY DESTINATION dist/${PLUGIN_FOLDER}/bin/${OBSARCHNAME})
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)

if(TARGET plugin-support)
target_link_libraries(${target} PRIVATE plugin-support)
Expand Down Expand Up @@ -72,14 +57,9 @@ function(target_install_resources target)
source_group("Resources/${relative_path}" FILES "${data_file}")
endforeach()

# install(
# DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
# USE_SOURCE_PERMISSIONS)

install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
DESTINATION dist/${PLUGIN_FOLDER}/data
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
USE_SOURCE_PERMISSIONS)
endif()
endfunction()
Expand All @@ -88,9 +68,7 @@ endfunction()
function(target_add_resource target resource)
message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")

# install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})

install(FILES "${resource}" DESTINATION dist/${PLUGIN_FOLDER}/data)
install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})

source_group("Resources" FILES "${resource}")
endfunction()
6 changes: 3 additions & 3 deletions src/obs-properties-widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ namespace {
for(int i = cb->count() - 1; i >= 0; --i)
cb->removeItem(i);
cbType = obs_property_list_format(p);
auto cnt = obs_property_list_item_count(p);
for(auto i = 0; i < cnt; ++i) {
size_t cnt = obs_property_list_item_count(p);
for(size_t i = 0; i < cnt; ++i) {
auto itemname = obs_property_list_item_name(p, i);
QVariant data;
if (cbType == obs_combo_format::OBS_COMBO_FORMAT_INT)
Expand Down Expand Up @@ -240,7 +240,7 @@ namespace {
{
try {
auto val = tostdu8(static_cast<QLineEditWithEye*>(ctrl)->edit()->text());
obs_data_set_int(data, name.c_str(), std::stod(val));
obs_data_set_double(data, name.c_str(), std::stod(val));
} catch(...) {
}
break;
Expand Down
4 changes: 4 additions & 0 deletions src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#define TAG "[obs-multi-rtmp] "

// Disable the warning about declaration shadowing because it affects too
// many valid cases.
# pragma GCC diagnostic ignored "-Wshadow"

inline std::string tostdu8(const QString& qs)
{
auto b = qs.toUtf8();
Expand Down
8 changes: 4 additions & 4 deletions src/push-widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IOBSOutputEventHanlder
static void OnOutputStopped(void* x, calldata_t* param)
{
auto thiz = static_cast<IOBSOutputEventHanlder*>(x);
thiz->OnStopped(calldata_int(param, "code"));
thiz->OnStopped(static_cast<int>(calldata_int(param, "code")));
}

virtual void OnReconnect() {}
Expand Down Expand Up @@ -435,9 +435,9 @@ class PushWidgetImpl : public PushWidget, public IOBSOutputEventHanlder
sprintf(strDuration, "%02d:%02d:%02d", (int)hh.count(), (int)mm.count(), (int)ss.count());

char strFps[32] = { 0 };
sprintf(strFps, "%d FPS", static_cast<int>(std::round((new_frames - total_frames_) / interval)));
sprintf(strFps, "%d FPS", static_cast<int>(std::round(static_cast<double>((new_frames - total_frames_)) / interval)));

auto bps = (new_bytes - total_bytes_) * 8 / interval;
auto bps = static_cast<double>((new_bytes - total_bytes_)) * 8 / interval;
auto strBps = [&]()-> std::string {
if (bps > 0)
{
Expand Down Expand Up @@ -561,7 +561,7 @@ class PushWidgetImpl : public PushWidget, public IOBSOutputEventHanlder
if (profileConfig) {
bool useDelay = config_get_bool(profileConfig, "Output", "DelayEnable");
bool preserveDelay = config_get_bool(profileConfig, "Output", "DelayPreserve");
int delaySec = config_get_int(profileConfig, "Output", "DelaySec");
uint delaySec = static_cast<uint>(config_get_uint(profileConfig, "Output", "DelaySec"));
obs_output_set_delay(output_,
useDelay ? delaySec : 0,
preserveDelay ? OBS_OUTPUT_DELAY_PRESERVE : 0
Expand Down