/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ // // Multi-threaded worker // // Original source: // https://chromium.googlesource.com/webm/libwebp #ifndef AOM_AOM_UTIL_AOM_THREAD_H_ #define AOM_AOM_UTIL_AOM_THREAD_H_ #ifdef __cplusplus extern "C" { #endif // State of the worker thread object AVxWorkerStatus; // Function to be called by the worker thread. Takes two opaque pointers as // arguments (data1 and data2). Should return true on success and return false // in case of error. AVxWorkerHook; // Platform-dependent implementation details for the worker. AVxWorkerImpl; // Synchronization object used to launch job in the worker thread AVxWorker; // The interface for all thread-worker related functions. All these functions // must be implemented. AVxWorkerInterface; // Install a new set of threading functions, overriding the defaults. This // should be done before any workers are started, i.e., before any encoding or // decoding takes place. The contents of the interface struct are copied, it // is safe to free the corresponding memory after this call. This function is // not thread-safe. Return false in case of invalid pointer or methods. int aom_set_worker_interface(const AVxWorkerInterface *const winterface); // Retrieve the currently set thread worker interface. const AVxWorkerInterface *aom_get_worker_interface(void); //------------------------------------------------------------------------------ #ifdef __cplusplus } // extern "C" #endif #endif // AOM_AOM_UTIL_AOM_THREAD_H_