// Copyright 2011 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // Multi-threaded worker // // Author: Skal ([email protected]) #ifndef WEBP_UTILS_THREAD_UTILS_H_ #define WEBP_UTILS_THREAD_UTILS_H_ #ifdef HAVE_CONFIG_H #include "src/webp/config.h" #endif #include "src/webp/types.h" #ifdef __cplusplus extern "C" { #endif // State of the worker thread object WebPWorkerStatus; // Function to be called by the worker thread. Takes two opaque pointers as // arguments (data1 and data2), and should return false in case of error. WebPWorkerHook; // Synchronization object used to launch job in the worker thread WebPWorker; // The interface for all thread-worker related functions. All these functions // must be implemented. WebPWorkerInterface; // 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. WEBP_EXTERN int WebPSetWorkerInterface( const WebPWorkerInterface* const winterface); // Retrieve the currently set thread worker interface. WEBP_EXTERN const WebPWorkerInterface* WebPGetWorkerInterface(void); //------------------------------------------------------------------------------ #ifdef __cplusplus } // extern "C" #endif #endif // WEBP_UTILS_THREAD_UTILS_H_