mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
193 lines
7.6 KiB
Plaintext
193 lines
7.6 KiB
Plaintext
From 94ed24f4ce0066b3cdd1f3d92ec8efedd90e7d32 Mon Sep 17 00:00:00 2001
|
|
From: TURX <turx2003@gmail.com>
|
|
Date: Sun, 19 Jan 2020 22:57:40 +0800
|
|
Subject: fix Haiku support
|
|
|
|
|
|
diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c
|
|
index 159d3a7..a5ec877 100644
|
|
--- a/src/framework/mlt_consumer.c
|
|
+++ b/src/framework/mlt_consumer.c
|
|
@@ -1217,9 +1217,11 @@ static void consumer_work_start(mlt_consumer self)
|
|
|
|
priority.sched_priority = mlt_properties_get_int(MLT_CONSUMER_PROPERTIES(self), "priority");
|
|
pthread_attr_init(&thread_attributes);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_OTHER);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
pthread_attr_setinheritsched(&thread_attributes, PTHREAD_EXPLICIT_SCHED);
|
|
#endif
|
|
pthread_attr_setscope(&thread_attributes, PTHREAD_SCOPE_SYSTEM);
|
|
@@ -1797,9 +1799,11 @@ static void mlt_thread_create(mlt_consumer self, mlt_thread_function_t function)
|
|
< 1) {
|
|
pthread_attr_t thread_attributes;
|
|
pthread_attr_init(&thread_attributes);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_OTHER);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) \
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) \
|
|
|| (defined(__ANDROID__) \
|
|
&& __ANDROID_API__ \
|
|
>= 28) // pthread_attr_setinheritsched is not available until API level 28
|
|
diff --git a/src/framework/mlt_slices.c b/src/framework/mlt_slices.c
|
|
index d91743e..1452b2e 100644
|
|
--- a/src/framework/mlt_slices.c
|
|
+++ b/src/framework/mlt_slices.c
|
|
@@ -203,7 +203,9 @@ static mlt_slices mlt_slices_init(int threads, int policy, int priority)
|
|
policy = SCHED_OTHER;
|
|
if (priority < 0)
|
|
priority = sched_get_priority_max(policy);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, policy);
|
|
+#endif
|
|
param.sched_priority = priority;
|
|
pthread_attr_setschedparam(&tattr, ¶m);
|
|
|
|
diff --git a/src/modules/decklink/consumer_decklink.cpp b/src/modules/decklink/consumer_decklink.cpp
|
|
index c79c862..d1a9eaf 100644
|
|
--- a/src/modules/decklink/consumer_decklink.cpp
|
|
+++ b/src/modules/decklink/consumer_decklink.cpp
|
|
@@ -797,7 +797,9 @@ protected:
|
|
return;
|
|
|
|
pthread_attr_init(&tattr);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
|
|
+#endif
|
|
|
|
if (!strcmp("max", mlt_properties_get(properties, "priority")))
|
|
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
|
|
diff --git a/src/modules/decklink/producer_decklink.cpp b/src/modules/decklink/producer_decklink.cpp
|
|
index 3374762..1f9d483 100644
|
|
--- a/src/modules/decklink/producer_decklink.cpp
|
|
+++ b/src/modules/decklink/producer_decklink.cpp
|
|
@@ -473,7 +473,9 @@ public:
|
|
struct sched_param param;
|
|
|
|
pthread_attr_init(&tattr);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
|
|
+#endif
|
|
|
|
if (!strcmp("max", mlt_properties_get(properties, "priority")))
|
|
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
|
|
diff --git a/src/modules/plusgpl/CMakeLists.txt b/src/modules/plusgpl/CMakeLists.txt
|
|
index f63529e..f4bec7d 100644
|
|
--- a/src/modules/plusgpl/CMakeLists.txt
|
|
+++ b/src/modules/plusgpl/CMakeLists.txt
|
|
@@ -26,7 +26,7 @@ endif()
|
|
|
|
if(WIN32)
|
|
target_link_libraries(mltplusgpl PRIVATE ws2_32)
|
|
-elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
|
+elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
|
target_link_libraries(mltplusgpl PRIVATE rt)
|
|
endif()
|
|
|
|
diff --git a/src/modules/plusgpl/consumer_cbrts.c b/src/modules/plusgpl/consumer_cbrts.c
|
|
index 80d1db0..98d50e1 100644
|
|
--- a/src/modules/plusgpl/consumer_cbrts.c
|
|
+++ b/src/modules/plusgpl/consumer_cbrts.c
|
|
@@ -918,9 +918,11 @@ static void start_output_thread(consumer_cbrts self)
|
|
pthread_attr_t thread_attributes;
|
|
pthread_attr_init(&thread_attributes);
|
|
priority.sched_priority = rtprio;
|
|
+#if !defined(__HAIKU__)
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_FIFO);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
pthread_attr_setinheritsched(&thread_attributes, PTHREAD_EXPLICIT_SCHED);
|
|
#endif
|
|
pthread_attr_setscope(&thread_attributes, PTHREAD_SCOPE_SYSTEM);
|
|
--
|
|
2.52.0
|
|
|
|
|
|
From 699268fd0dd95b7712476cc330365f84a84069a4 Mon Sep 17 00:00:00 2001
|
|
From: Luc Schrijvers <begasus@gmail.com>
|
|
Date: Thu, 6 Nov 2025 08:28:16 +0100
|
|
Subject: Disable X11
|
|
|
|
|
|
diff --git a/src/modules/qt/common.cpp b/src/modules/qt/common.cpp
|
|
index 88b604b..1f08c35 100644
|
|
--- a/src/modules/qt/common.cpp
|
|
+++ b/src/modules/qt/common.cpp
|
|
@@ -21,7 +21,7 @@
|
|
#include <QImageReader>
|
|
#include <QLocale>
|
|
|
|
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
|
|
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
|
|
#include <X11/Xlib.h>
|
|
#include <cstdlib>
|
|
#endif
|
|
@@ -35,7 +35,7 @@ bool createQApplicationIfNeeded(mlt_service service)
|
|
QCoreApplication::addLibraryPath(QString(mlt_environment("MLT_APPDIR"))
|
|
+ QStringLiteral("/plugins"));
|
|
#endif
|
|
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
|
|
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
|
|
if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) {
|
|
const char *qt_qpa = getenv("QT_QPA_PLATFORM");
|
|
if (!qt_qpa || strcmp(qt_qpa, "offscreen")) {
|
|
--
|
|
2.52.0
|
|
|
|
|
|
From 3e6e40c4ac7238e3adcc62cd453131928630a168 Mon Sep 17 00:00:00 2001
|
|
From: Luc Schrijvers <begasus@gmail.com>
|
|
Date: Thu, 6 Nov 2025 08:31:47 +0100
|
|
Subject: Fix SDL module
|
|
|
|
|
|
diff --git a/src/modules/sdl/CMakeLists.txt b/src/modules/sdl/CMakeLists.txt
|
|
index baa524b..a83b70c 100644
|
|
--- a/src/modules/sdl/CMakeLists.txt
|
|
+++ b/src/modules/sdl/CMakeLists.txt
|
|
@@ -21,7 +21,7 @@ endif()
|
|
|
|
if(APPLE)
|
|
target_link_libraries(mltsdl PRIVATE objc "-framework Foundation")
|
|
-elseif(UNIX)
|
|
+elseif(UNIX AND NOT HAIKU)
|
|
target_link_libraries(mltsdl PRIVATE X11)
|
|
endif()
|
|
|
|
diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c
|
|
index 98abfaa..7f1492a 100644
|
|
--- a/src/modules/sdl/consumer_sdl.c
|
|
+++ b/src/modules/sdl/consumer_sdl.c
|
|
@@ -876,7 +876,7 @@ static int consumer_get_dimensions(int *width, int *height)
|
|
#ifndef __APPLE__
|
|
// Get the wm structure
|
|
if (SDL_GetWMInfo(&wm) == 1) {
|
|
-#ifndef _WIN32
|
|
+#if !defined(_WIN32) && !defined(__HAIKU__)
|
|
// Check that we have the X11 wm
|
|
if (wm.subsystem == SDL_SYSWM_X11) {
|
|
// Get the SDL window
|
|
diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c
|
|
index 629c75b..0414b18 100644
|
|
--- a/src/modules/sdl/consumer_sdl_still.c
|
|
+++ b/src/modules/sdl/consumer_sdl_still.c
|
|
@@ -579,7 +579,7 @@ static int consumer_get_dimensions(int *width, int *height)
|
|
#ifndef __APPLE__
|
|
// Get the wm structure
|
|
if (SDL_GetWMInfo(&wm) == 1) {
|
|
-#ifndef _WIN32
|
|
+#if !defined(_WIN32) && !defined(__HAIKU__)
|
|
// Check that we have the X11 wm
|
|
if (wm.subsystem == SDL_SYSWM_X11) {
|
|
// Get the SDL window
|
|
--
|
|
2.52.0
|
|
|