aom: update libaom to 0ec86ac7ae1e32a7e70410fa4972a655ec3670a4

This commit is contained in:
Roy Tam 2019-02-22 21:52:01 +08:00
commit eb361970c5
438 changed files with 52661 additions and 21905 deletions

View file

@ -14,6 +14,12 @@
// Original source:
// https://chromium.googlesource.com/webm/libwebp
// Enable GNU extensions in glibc so that we can call pthread_setname_np().
// This must be before any #include statements.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <assert.h>
#include <string.h> // for memset()
@ -34,6 +40,28 @@ static void execute(AVxWorker *const worker); // Forward declaration.
static THREADFN thread_loop(void *ptr) {
AVxWorker *const worker = (AVxWorker *)ptr;
#ifdef __APPLE__
if (worker->thread_name != NULL) {
// Apple's version of pthread_setname_np takes one argument and operates on
// the current thread only. The maximum size of the thread_name buffer was
// noted in the Chromium source code and was confirmed by experiments. If
// thread_name is too long, pthread_setname_np returns -1 with errno
// ENAMETOOLONG (63).
char thread_name[64];
strncpy(thread_name, worker->thread_name, sizeof(thread_name));
thread_name[sizeof(thread_name) - 1] = '\0';
pthread_setname_np(thread_name);
}
#elif defined(__GLIBC__) || defined(__BIONIC__)
if (worker->thread_name != NULL) {
// Linux and Android require names (with nul) fit in 16 chars, otherwise
// pthread_setname_np() returns ERANGE (34).
char thread_name[16];
strncpy(thread_name, worker->thread_name, sizeof(thread_name));
thread_name[sizeof(thread_name) - 1] = '\0';
pthread_setname_np(pthread_self(), thread_name);
}
#endif
int done = 0;
while (!done) {
pthread_mutex_lock(&worker->impl_->mutex_);

View file

@ -26,6 +26,7 @@ extern "C" {
// Set maximum decode threads to be 8 due to the limit of frame buffers
// and not enough semaphores in the emulation layer on windows.
#define MAX_DECODE_THREADS 8
#define MAX_NUM_THREADS 64
#if CONFIG_MULTITHREAD
@ -380,6 +381,10 @@ typedef struct AVxWorkerImpl AVxWorkerImpl;
typedef struct {
AVxWorkerImpl *impl_;
AVxWorkerStatus status_;
// Thread name for the debugger. If not NULL, must point to a string that
// outlives the worker thread. For portability, use a name <= 15 characters
// long (not including the terminating NUL character).
const char *thread_name;
AVxWorkerHook hook; // hook to call
void *data1; // first argument passed to 'hook'
void *data2; // second argument passed to 'hook'