summaryrefslogtreecommitdiff
path: root/repo/aom
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
committerdavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
commit48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch)
tree00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/aom
parent871b2b573f01c1b3176a0f65458b3d281b41c437 (diff)
removed idea of repos
Diffstat (limited to 'repo/aom')
-rw-r--r--repo/aom/aom.xibuild24
-rw-r--r--repo/aom/fix-stack-size-e53da0b.patch78
2 files changed, 102 insertions, 0 deletions
diff --git a/repo/aom/aom.xibuild b/repo/aom/aom.xibuild
new file mode 100644
index 0000000..66aaa4b
--- /dev/null
+++ b/repo/aom/aom.xibuild
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+NAME="aom"
+DESC="Alliance for Open Media (AOM) AV1 codec SDK"
+
+MAKEDEPS="cmake "
+DEPS="musl "
+
+PKG_VER=3.3.0
+SOURCE="https://aomedia.googlesource.com/aom/+archive/v$PKG_VER.tar.gz"
+ADDITIONAL="fix-stack-size-e53da0b.patch "
+
+build () {
+ cmake -B build -G Ninja \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DBUILD_STATIC_LIBS=OFF
+ cmake --build build
+}
+
+package () {
+ DESTDIR="$PKG_DEST" cmake --install build
+}
diff --git a/repo/aom/fix-stack-size-e53da0b.patch b/repo/aom/fix-stack-size-e53da0b.patch
new file mode 100644
index 0000000..d8206e8
--- /dev/null
+++ b/repo/aom/fix-stack-size-e53da0b.patch
@@ -0,0 +1,78 @@
+From e53da0b1bf2652896bed7b65929a1d8d0729d922 Mon Sep 17 00:00:00 2001
+From: Wan-Teh Chang <wtc@google.com>
+Date: Thu, 27 Aug 2020 20:49:03 -0700
+Subject: [PATCH] Ensure thread stack size is at least 256 KB
+
+BUG=aomedia:2754
+
+Change-Id: Ia6e211f9b87bc2efe376e7b9f4adb11741850b18
+---
+
+diff --git a/aom_util/aom_thread.c b/aom_util/aom_thread.c
+index a749a22..8411569 100644
+--- a/aom_util/aom_thread.c
++++ b/aom_util/aom_thread.c
+@@ -133,16 +133,39 @@
+ goto Error;
+ }
+ if (pthread_cond_init(&worker->impl_->condition_, NULL)) {
+- pthread_mutex_destroy(&worker->impl_->mutex_);
+- goto Error;
++ goto Error1;
+ }
++ pthread_attr_t *attr = NULL;
++#if HAVE_PTHREAD_H
++ pthread_attr_t thread_attributes;
++ attr = &thread_attributes;
++ if (pthread_attr_init(attr)) {
++ goto Error2;
++ }
++ size_t stack_size;
++ if (pthread_attr_getstacksize(attr, &stack_size)) {
++ pthread_attr_destroy(attr);
++ goto Error2;
++ }
++ const size_t kMinStackSize = 256 * 1024;
++ if (stack_size < kMinStackSize &&
++ pthread_attr_setstacksize(attr, kMinStackSize)) {
++ pthread_attr_destroy(attr);
++ goto Error2;
++ }
++#endif // HAVE_PTHREAD_H
+ pthread_mutex_lock(&worker->impl_->mutex_);
+- ok = !pthread_create(&worker->impl_->thread_, NULL, thread_loop, worker);
++ ok = !pthread_create(&worker->impl_->thread_, attr, thread_loop, worker);
+ if (ok) worker->status_ = OK;
+ pthread_mutex_unlock(&worker->impl_->mutex_);
++#if HAVE_PTHREAD_H
++ pthread_attr_destroy(attr);
++#endif
+ if (!ok) {
+- pthread_mutex_destroy(&worker->impl_->mutex_);
++ Error2:
+ pthread_cond_destroy(&worker->impl_->condition_);
++ Error1:
++ pthread_mutex_destroy(&worker->impl_->mutex_);
+ Error:
+ aom_free(worker->impl_);
+ worker->impl_ = NULL;
+diff --git a/aom_util/aom_thread.h b/aom_util/aom_thread.h
+index 8d04312..efbed78 100644
+--- a/aom_util/aom_thread.h
++++ b/aom_util/aom_thread.h
+@@ -32,6 +32,7 @@
+ #include <process.h> // NOLINT
+ #include <windows.h> // NOLINT
+ typedef HANDLE pthread_t;
++typedef int pthread_attr_t;
+ typedef CRITICAL_SECTION pthread_mutex_t;
+
+ #if _WIN32_WINNT < 0x0600
+@@ -147,6 +148,7 @@
+ #include <sys/builtin.h> // NOLINT
+
+ #define pthread_t TID
++#define pthread_attr_t int
+ #define pthread_mutex_t HMTX
+
+ typedef struct {