-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from phunkyfish/win-pthreads
Enable pthreads for FFmpeg on Windows
- Loading branch information
Showing
23 changed files
with
471 additions
and
27 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
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,22 @@ | ||
# - Find PThreads | ||
# Find the native pthread for windows includes and library | ||
# | ||
# PTHREADS_FOUND - True if pthread for windows found. | ||
# PTHREADS_INCLUDE_DIRS - where to find pthread.h, etc. | ||
# PTHREADS_LIBRARIES - List of libraries when using pthread for windows. | ||
# | ||
|
||
find_package(PkgConfig) | ||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules(PC_PTHREADS pthreads QUIET) | ||
endif() | ||
|
||
find_path(PTHREADS_INCLUDE_DIRS NAMES pthread.h | ||
PATHS ${PC_PTHREADS_INCLUDEDIR}) | ||
find_library(PTHREADS_LIBRARIES NAMES pthreads | ||
PATHS ${PC_PTHREADS_LIBDIR}) | ||
|
||
include("FindPackageHandleStandardArgs") | ||
find_package_handle_standard_args(PThreads REQUIRED_VARS PTHREADS_INCLUDE_DIRS PTHREADS_LIBRARIES) | ||
|
||
mark_as_advanced(PTHREADS_INCLUDE_DIRS PTHREADS_LIBRARIES) |
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
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ openssl | |
mingw | ||
xz-utils | ||
zlib | ||
pthreads |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ openssl | |
mingw | ||
xz-utils | ||
zlib | ||
pthreads |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
fbba12f3db9a55dbf027e14111755817ec44b57eabec3e8089aac8ac6f533cf8 | ||
bfacf16e342949ffd977a9232556092c47164bd26e166736cf3459a870506c4b |
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 |
---|---|---|
@@ -1 +1 @@ | ||
gnutls http://mirrors.kodi.tv/build-deps/sources/gnutls-3.6.11.1.tar.xz | ||
gnutls http://mirrors.kodi.tv/build-deps/sources/gnutls-3.6.12.tar.xz |
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,24 @@ | ||
From: Alwin Esch <[email protected]> | ||
Date: Wed, 8 Jan 2020 12:13:40 +0000 | ||
Subject: [PATCH] fix ARM build | ||
|
||
--- | ||
context.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/context.h b/context.h | ||
index 33294c1..f959de2 100644 | ||
--- a/context.h | ||
+++ b/context.h | ||
@@ -62,7 +62,7 @@ | ||
#endif | ||
|
||
#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64) | ||
-#define PTW32_PROGCTR(Context) ((Context).Pc) | ||
+#define __PTW32_PROGCTR(Context) ((Context).Pc) | ||
#endif | ||
|
||
#if !defined (__PTW32_PROGCTR) | ||
-- | ||
2.19.2.windows.1 | ||
|
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,162 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(pthreads) | ||
|
||
set(SOURCES ptw32_MCS_lock.c | ||
ptw32_is_attr.c | ||
ptw32_processInitialize.c | ||
ptw32_processTerminate.c | ||
ptw32_threadStart.c | ||
ptw32_threadDestroy.c | ||
ptw32_tkAssocCreate.c | ||
ptw32_tkAssocDestroy.c | ||
ptw32_callUserDestroyRoutines.c | ||
ptw32_semwait.c | ||
ptw32_timespec.c | ||
ptw32_throw.c | ||
ptw32_getprocessors.c | ||
ptw32_calloc.c | ||
ptw32_new.c | ||
ptw32_reuse.c | ||
ptw32_relmillisecs.c | ||
ptw32_cond_check_need_init.c | ||
ptw32_mutex_check_need_init.c | ||
ptw32_rwlock_check_need_init.c | ||
ptw32_rwlock_cancelwrwait.c | ||
ptw32_spinlock_check_need_init.c | ||
pthread_attr_init.c | ||
pthread_attr_destroy.c | ||
pthread_attr_getaffinity_np.c | ||
pthread_attr_setaffinity_np.c | ||
pthread_attr_getdetachstate.c | ||
pthread_attr_setdetachstate.c | ||
pthread_attr_getname_np.c | ||
pthread_attr_setname_np.c | ||
pthread_attr_getscope.c | ||
pthread_attr_setscope.c | ||
pthread_attr_getstackaddr.c | ||
pthread_attr_setstackaddr.c | ||
pthread_attr_getstacksize.c | ||
pthread_attr_setstacksize.c | ||
pthread_barrier_init.c | ||
pthread_barrier_destroy.c | ||
pthread_barrier_wait.c | ||
pthread_barrierattr_init.c | ||
pthread_barrierattr_destroy.c | ||
pthread_barrierattr_setpshared.c | ||
pthread_barrierattr_getpshared.c | ||
pthread_setcancelstate.c | ||
pthread_setcanceltype.c | ||
pthread_testcancel.c | ||
pthread_cancel.c | ||
pthread_condattr_destroy.c | ||
pthread_condattr_getpshared.c | ||
pthread_condattr_init.c | ||
pthread_condattr_setpshared.c | ||
pthread_cond_destroy.c | ||
pthread_cond_init.c | ||
pthread_cond_signal.c | ||
pthread_cond_wait.c | ||
create.c | ||
cleanup.c | ||
dll.c | ||
errno.c | ||
pthread_exit.c | ||
global.c | ||
pthread_equal.c | ||
pthread_getconcurrency.c | ||
pthread_kill.c | ||
pthread_once.c | ||
pthread_self.c | ||
pthread_setconcurrency.c | ||
w32_CancelableWait.c | ||
pthread_mutex_init.c | ||
pthread_mutex_destroy.c | ||
pthread_mutexattr_init.c | ||
pthread_mutexattr_destroy.c | ||
pthread_mutexattr_getpshared.c | ||
pthread_mutexattr_setpshared.c | ||
pthread_mutexattr_settype.c | ||
pthread_mutexattr_gettype.c | ||
pthread_mutexattr_setrobust.c | ||
pthread_mutexattr_getrobust.c | ||
pthread_mutex_lock.c | ||
pthread_mutex_timedlock.c | ||
pthread_mutex_unlock.c | ||
pthread_mutex_trylock.c | ||
pthread_mutex_consistent.c | ||
pthread_mutexattr_setkind_np.c | ||
pthread_mutexattr_getkind_np.c | ||
pthread_getw32threadhandle_np.c | ||
pthread_getunique_np.c | ||
pthread_setaffinity.c | ||
pthread_delay_np.c | ||
pthread_num_processors_np.c | ||
pthread_win32_attach_detach_np.c | ||
pthread_timechange_handler_np.c | ||
pthread_rwlock_init.c | ||
pthread_rwlock_destroy.c | ||
pthread_rwlockattr_init.c | ||
pthread_rwlockattr_destroy.c | ||
pthread_rwlockattr_getpshared.c | ||
pthread_rwlockattr_setpshared.c | ||
pthread_rwlock_rdlock.c | ||
pthread_rwlock_timedrdlock.c | ||
pthread_rwlock_wrlock.c | ||
pthread_rwlock_timedwrlock.c | ||
pthread_rwlock_unlock.c | ||
pthread_rwlock_tryrdlock.c | ||
pthread_rwlock_trywrlock.c | ||
pthread_attr_setschedpolicy.c | ||
pthread_attr_getschedpolicy.c | ||
pthread_attr_setschedparam.c | ||
pthread_attr_getschedparam.c | ||
pthread_attr_setinheritsched.c | ||
pthread_attr_getinheritsched.c | ||
pthread_getname_np.c | ||
pthread_setname_np.c | ||
pthread_setschedparam.c | ||
pthread_getschedparam.c | ||
sched_get_priority_max.c | ||
sched_get_priority_min.c | ||
sched_setscheduler.c | ||
sched_getscheduler.c | ||
sched_yield.c | ||
sched_setaffinity.c | ||
sem_init.c | ||
sem_destroy.c | ||
sem_trywait.c | ||
sem_timedwait.c | ||
sem_wait.c | ||
sem_post.c | ||
sem_post_multiple.c | ||
sem_getvalue.c | ||
sem_open.c | ||
sem_close.c | ||
sem_unlink.c | ||
pthread_spin_init.c | ||
pthread_spin_destroy.c | ||
pthread_spin_lock.c | ||
pthread_spin_unlock.c | ||
pthread_spin_trylock.c | ||
pthread_detach.c | ||
pthread_join.c | ||
pthread_timedjoin_np.c | ||
pthread_tryjoin_np.c | ||
pthread_key_create.c | ||
pthread_key_delete.c | ||
pthread_setspecific.c | ||
pthread_getspecific.c | ||
config.h | ||
context.h) | ||
|
||
set(HEADERS ${PROJECT_SOURCE_DIR}/_ptw32.h | ||
${PROJECT_SOURCE_DIR}/pthread.h | ||
${PROJECT_SOURCE_DIR}/sched.h | ||
${PROJECT_SOURCE_DIR}/semaphore.h) | ||
|
||
add_library(pthreads ${SOURCES} ${HEADERS}) | ||
target_include_directories(pthreads PRIVATE ${CMAKE_SOURCE_DIR}) | ||
target_compile_definitions(pthreads PUBLIC -D__PTW32_CONFIG_H) | ||
|
||
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) | ||
install(TARGETS pthreads DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) |
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 @@ | ||
b81136effb7185c77601fe2e0e6ac19bd996912e4814cebdd3010b0fac9e259b |
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 @@ | ||
pthreads http://mirrors.kodi.tv/build-deps/sources/pthreads4w-code-v3.0.0.zip |
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,24 @@ | ||
From: Alwin Esch <[email protected]> | ||
Date: Wed, 8 Jan 2020 12:13:40 +0000 | ||
Subject: [PATCH] fix ARM build | ||
|
||
--- | ||
context.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/context.h b/context.h | ||
index 33294c1..f959de2 100644 | ||
--- a/context.h | ||
+++ b/context.h | ||
@@ -62,7 +62,7 @@ | ||
#endif | ||
|
||
#if defined(_ARM_) || defined(ARM) || defined(_M_ARM) || defined(_M_ARM64) | ||
-#define PTW32_PROGCTR(Context) ((Context).Pc) | ||
+#define __PTW32_PROGCTR(Context) ((Context).Pc) | ||
#endif | ||
|
||
#if !defined (__PTW32_PROGCTR) | ||
-- | ||
2.19.2.windows.1 | ||
|
Oops, something went wrong.