-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new packages: shotcut, mlt and their deps
- Loading branch information
Showing
10 changed files
with
490 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
diff --git a/drivers/alsa/hammerfall.c b/drivers/alsa/hammerfall.c | ||
index 531d73a..91eaf17 100644 | ||
--- a/drivers/alsa/hammerfall.c | ||
+++ b/drivers/alsa/hammerfall.c | ||
@@ -200,7 +200,10 @@ hammerfall_release (jack_hardware_t *hw) | ||
return; | ||
} | ||
|
||
+// not patched properly because thread is never created | ||
+#ifndef __ANDROID__ | ||
pthread_cancel (h->monitor_thread); | ||
+#endif | ||
pthread_join (h->monitor_thread, &status); | ||
|
||
free (h); | ||
@@ -215,7 +218,10 @@ hammerfall_monitor_controls (void *arg) | ||
snd_ctl_elem_id_t *switch_id[3]; | ||
snd_ctl_elem_value_t *sw[3]; | ||
|
||
+// not patched properly because thread is never created | ||
+#ifndef __ANDROID__ | ||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | ||
+#endif | ||
|
||
snd_ctl_elem_id_malloc (&switch_id[0]); | ||
snd_ctl_elem_id_malloc (&switch_id[1]); | ||
diff --git a/drivers/freebob/freebob_driver.c b/drivers/freebob/freebob_driver.c | ||
index d26e6dd..8f09a48 100644 | ||
--- a/drivers/freebob/freebob_driver.c | ||
+++ b/drivers/freebob/freebob_driver.c | ||
@@ -795,6 +795,12 @@ freebob_driver_delete (freebob_driver_t *driver) | ||
*/ | ||
|
||
// the thread that will queue the midi events from the seq to the stream buffers | ||
+#ifdef __ANDROID__ | ||
+static void ThreadSignalHandler(int signum) | ||
+{ | ||
+ pthread_exit(0); | ||
+} | ||
+#endif | ||
|
||
void * freebob_driver_midi_queue_thread (void *arg) | ||
{ | ||
@@ -807,6 +813,14 @@ void * freebob_driver_midi_queue_thread (void *arg) | ||
int b; | ||
int i; | ||
|
||
+#ifdef __ANDROID__ | ||
+ struct sigaction actions; | ||
+ memset(&actions, 0, sizeof(actions)); | ||
+ sigemptyset(&actions.sa_mask); | ||
+ actions.sa_flags = 0; | ||
+ actions.sa_handler = ThreadSignalHandler; | ||
+ sigaction(SIGUSR2, &actions, NULL); | ||
+#endif | ||
printMessage ("MIDI queue thread started"); | ||
|
||
while (1) { | ||
@@ -868,6 +882,14 @@ void *freebob_driver_midi_dequeue_thread (void *arg) | ||
|
||
assert (m); | ||
|
||
+#ifdef __ANDROID__ | ||
+ struct sigaction actions; | ||
+ memset(&actions, 0, sizeof(actions)); | ||
+ sigemptyset(&actions.sa_mask); | ||
+ actions.sa_flags = 0; | ||
+ actions.sa_handler = ThreadSignalHandler; | ||
+ sigaction(SIGUSR2, &actions, NULL); | ||
+#endif | ||
while (1) { | ||
// read incoming events | ||
|
||
@@ -1084,10 +1106,20 @@ freebob_driver_midi_stop (freebob_driver_midi_handle_t *m) | ||
{ | ||
assert (m); | ||
|
||
+// indeed, may not necessary because pthread_testcancel() seems never called | ||
+#ifdef __ANDROID__ | ||
+ pthread_kill( m->queue_thread_cancel, SIGUSR2 ); | ||
+#else | ||
pthread_cancel (m->queue_thread); | ||
+#endif | ||
pthread_join (m->queue_thread, NULL); | ||
|
||
+// indeed, may not necessary because pthread_testcancel() seems never called | ||
+#ifdef __ANDROID__ | ||
+ pthread_kill( m->queue_thread_cancel, SIGUSR2 ); | ||
+#else | ||
pthread_cancel (m->dequeue_thread); | ||
+#endif | ||
pthread_join (m->dequeue_thread, NULL); | ||
return 0; | ||
|
||
diff --git a/include/engine.h b/include/engine.h | ||
index 5106713..ea11b66 100644 | ||
--- a/include/engine.h | ||
+++ b/include/engine.h | ||
@@ -105,6 +105,9 @@ struct _jack_engine { | ||
|
||
unsigned int port_max; | ||
pthread_t server_thread; | ||
+#ifdef __ANDROID__ | ||
+ atomic_flag server_thread_cancel; | ||
+#endif | ||
|
||
int fds[2]; | ||
int cleanup_fifo[2]; | ||
diff --git a/jackd/controlapi.c b/jackd/controlapi.c | ||
index a117e20..931b619 100644 | ||
--- a/jackd/controlapi.c | ||
+++ b/jackd/controlapi.c | ||
@@ -692,7 +692,9 @@ jackctl_setup_signals ( | ||
|
||
setsid (); | ||
|
||
+#ifndef __ANDROID__ | ||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | ||
+#endif | ||
|
||
/* what's this for? | ||
|
||
diff --git a/jackd/engine.c b/jackd/engine.c | ||
index 1235815..b7458e0 100644 | ||
--- a/jackd/engine.c | ||
+++ b/jackd/engine.c | ||
@@ -1623,7 +1623,11 @@ jack_server_thread (void *arg) | ||
|
||
/* Stephane Letz: letz@grame.fr : has to be added | ||
* otherwise pthread_cancel() does not work on MacOSX */ | ||
+#ifdef __ANDROID__ | ||
+ if ( !atomic_flag_test_and_set( &engine->server_thread_cancel ) ) { pthread_exit( NULL ); }; | ||
+#else | ||
pthread_testcancel (); | ||
+#endif | ||
|
||
|
||
/* empty cleanup FIFO if necessary */ | ||
@@ -2038,6 +2042,9 @@ jack_engine_new (int realtime, int rtpriority, int do_mlock, int do_unlock, | ||
|
||
(void)jack_get_fifo_fd (engine, 0); | ||
|
||
+#ifdef __ANDROID__ | ||
+ atomic_flag_test_and_set( &engine->server_thread_cancel ); | ||
+#endif | ||
jack_client_create_thread (NULL, &engine->server_thread, 0, FALSE, | ||
&jack_server_thread, engine); | ||
|
||
@@ -2594,8 +2601,12 @@ jack_engine_delete (jack_engine_t *engine) | ||
// MacOSX pthread_cancel still not implemented correctly in Darwin | ||
mach_port_t machThread = pthread_mach_thread_np (engine->server_thread); | ||
thread_terminate (machThread); | ||
+#else | ||
+#ifdef __ANDROID__ | ||
+ atomic_flag_clear( &engine->server_thread_cancel ); | ||
#else | ||
pthread_cancel (engine->server_thread); | ||
+#endif | ||
pthread_join (engine->server_thread, NULL); | ||
#endif | ||
|
||
diff --git a/jackd/jackd.c b/jackd/jackd.c | ||
index b27dde2..8a808b0 100644 | ||
--- a/jackd/jackd.c | ||
+++ b/jackd/jackd.c | ||
@@ -253,7 +253,9 @@ jack_main (jack_driver_desc_t * driver_desc, JSList * driver_params, JSList * sl | ||
|
||
setsid (); | ||
|
||
+#ifndef __ANDROID__ | ||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | ||
+#endif | ||
|
||
/* what's this for? | ||
|
||
diff --git a/libjack/client.c b/libjack/client.c | ||
index b34766a..f97579d 100644 | ||
--- a/libjack/client.c | ||
+++ b/libjack/client.c | ||
@@ -2109,7 +2109,11 @@ jack_client_core_wait (jack_client_t* client) | ||
return -1; | ||
} | ||
|
||
+#ifdef __ANDROID__ | ||
+ if ( !atomic_flag_test_and_set( &client->thread_cancel ) ) { pthread_exit( NULL ); }; | ||
+#else | ||
pthread_testcancel (); | ||
+#endif | ||
|
||
/* get an accurate timestamp on waking from poll for a | ||
* process() cycle. | ||
@@ -2379,6 +2383,9 @@ jack_start_thread (jack_client_t *client) | ||
return -1; | ||
} | ||
#else | ||
+#ifdef __ANDROID__ | ||
+ atomic_flag_test_and_set( &client->thread_cancel ); | ||
+#endif | ||
if (jack_client_create_thread (client, | ||
&client->thread, | ||
client->engine->client_priority, | ||
@@ -2545,7 +2552,11 @@ jack_client_close_aux (jack_client_t *client) | ||
*/ | ||
|
||
if (client->thread_ok) { | ||
+#ifdef __ANDROID__ | ||
+ atomic_flag_clear( &client->thread_cancel ); | ||
+#else | ||
pthread_cancel (client->thread); | ||
+#endif | ||
pthread_join (client->thread, &status); | ||
} | ||
|
||
diff --git a/libjack/local.h b/libjack/local.h | ||
index c90d7b0..da2e70e 100644 | ||
--- a/libjack/local.h | ||
+++ b/libjack/local.h | ||
@@ -26,6 +26,9 @@ struct _jack_client { | ||
JSList *ports_ext; | ||
|
||
pthread_t thread; | ||
+#ifdef __ANDROID__ | ||
+ atomic_flag thread_cancel; | ||
+#endif | ||
char fifo_prefix[PATH_MAX + 1]; | ||
void (*on_shutdown)(void *arg); | ||
void *on_shutdown_arg; |
18 changes: 18 additions & 0 deletions
18
packages/jack-dummy/0002-pthread_attr_setinheritsched.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/libjack/thread.c b/libjack/thread.c | ||
index a7466cc..b10cd9d 100644 | ||
--- a/libjack/thread.c | ||
+++ b/libjack/thread.c | ||
@@ -175,11 +175,13 @@ jack_client_create_thread (jack_client_t* client, | ||
#ifndef JACK_USE_MACH_THREADS | ||
|
||
pthread_attr_init (&attr); | ||
+#if !defined __ANDROID__ || __ANDROID_API__ >= 28 | ||
result = pthread_attr_setinheritsched (&attr, PTHREAD_EXPLICIT_SCHED); | ||
if (result) { | ||
log_result ("requesting explicit scheduling", result); | ||
return result; | ||
} | ||
+#endif | ||
result = pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE); | ||
if (result) { | ||
log_result ("requesting joinable thread creation", result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
TERMUX_PKG_HOMEPAGE=https://jackaudio.org/ | ||
TERMUX_PKG_DESCRIPTION="jack1 (dummy module only)" | ||
TERMUX_PKG_MAINTAINER="@termux" | ||
TERMUX_PKG_LICENSE="GPL-2.0, LGPL-2.0" | ||
TERMUX_PKG_DEPENDS="libdb, libandroid-sysv-semaphore, libandroid-shmem" | ||
TERMUX_PKG_VERSION=0.126.0 | ||
TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION | ||
TERMUX_PKG_SRCURL=git+https://github.com/jackaudio/jack1 | ||
TERMUX_PKG_AUTO_UPDATE=true | ||
|
||
termux_step_pre_configure() { | ||
cd ${TERMUX_PKG_SRCDIR} | ||
git submodule update --init --recursive | ||
${TERMUX_PKG_SRCDIR}/autogen.sh && | ||
cd ${TERMUX_PKG_SRCDIR} && | ||
autoupdate | ||
LDFLAGS+=" -landroid-shmem -landroid-sysv-semaphore" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/modules/rtaudio/RtAudio.cpp b/src/modules/rtaudio/RtAudio.cpp | ||
index b13f04e..4178219 100644 | ||
--- a/src/modules/rtaudio/RtAudio.cpp | ||
+++ b/src/modules/rtaudio/RtAudio.cpp | ||
@@ -348,7 +348,7 @@ public: | ||
|
||
#if defined(__LINUX_OSS__) | ||
|
||
-#include <sys/soundcard.h> | ||
+#include <linux/soundcard.h> | ||
|
||
class RtApiOss: public RtApi | ||
{ |
34 changes: 34 additions & 0 deletions
34
x11-packages/mlt/0002-rtaudio-remove-pthread_testcancel.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/src/modules/rtaudio/RtAudio.cpp b/src/modules/rtaudio/RtAudio.cpp | ||
index 4178219..bd597ef 100644 | ||
--- a/src/modules/rtaudio/RtAudio.cpp | ||
+++ b/src/modules/rtaudio/RtAudio.cpp | ||
@@ -9087,7 +9087,9 @@ static void *alsaCallbackHandler( void *ptr ) | ||
#endif | ||
|
||
while ( *isRunning == true ) { | ||
+#ifndef __ANDROID__ | ||
pthread_testcancel(); | ||
+#endif | ||
object->callbackEvent(); | ||
} | ||
|
||
@@ -9363,7 +9365,9 @@ static void *pulseaudio_callback( void * user ) | ||
#endif | ||
|
||
while ( *isRunning ) { | ||
+#ifndef __ANDROID__ | ||
pthread_testcancel(); | ||
+#endif | ||
context->callbackEvent(); | ||
} | ||
|
||
@@ -10846,7 +10850,9 @@ static void *ossCallbackHandler( void *ptr ) | ||
#endif | ||
|
||
while ( *isRunning == true ) { | ||
+#ifndef __ANDROID__ | ||
pthread_testcancel(); | ||
+#endif | ||
object->callbackEvent(); | ||
} | ||
|
34 changes: 34 additions & 0 deletions
34
x11-packages/mlt/0003-rtaudio-remove-pthread_attr_setinheritsched.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/src/modules/rtaudio/RtAudio.cpp b/src/modules/rtaudio/RtAudio.cpp | ||
index bd597ef..dc64863 100644 | ||
--- a/src/modules/rtaudio/RtAudio.cpp | ||
+++ b/src/modules/rtaudio/RtAudio.cpp | ||
@@ -8636,7 +8636,9 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int deviceId, StreamMode mode, unsig | ||
pthread_attr_setschedpolicy(&attr, SCHED_RR); | ||
pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); | ||
// This is definitely required. Otherwise it fails. | ||
+#if !defined __ANDROID__ || __ANDROID_API__ >= 28 | ||
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); | ||
+#endif | ||
pthread_attr_setschedparam(&attr, ¶m); | ||
} | ||
else | ||
@@ -9602,7 +9604,9 @@ bool RtApiPulse::probeDeviceOpen( unsigned int deviceId, StreamMode mode, | ||
pthread_attr_setschedpolicy(&attr, SCHED_RR); | ||
pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); | ||
// This is definitely required. Otherwise it fails. | ||
+#if !defined __ANDROID__ || __ANDROID_API__ >= 28 | ||
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); | ||
+#endif | ||
pthread_attr_setschedparam(&attr, ¶m); | ||
} | ||
else | ||
@@ -10454,7 +10458,9 @@ bool RtApiOss :: probeDeviceOpen( unsigned int deviceId, StreamMode mode, unsign | ||
pthread_attr_setschedpolicy(&attr, SCHED_RR); | ||
pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); | ||
// This is definitely required. Otherwise it fails. | ||
+#if !defined __ANDROID__ || __ANDROID_API__ >= 28 | ||
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); | ||
+#endif | ||
pthread_attr_setschedparam(&attr, ¶m); | ||
} | ||
else |
Oops, something went wrong.