and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state.
Showing the changes to libavcodec/codec_internal.h (1 of 407 files). Show all
Unified · Split
| @@ -24,18 +24,13 @@ · 23 unmodified lines | |||
| 24 | #include "libavutil/attributes.h" | 24 | #include "libavutil/attributes.h" |
| 25 | #include "codec.h" | 25 | #include "codec.h" |
| 26 | 26 | ||
| 27 | /** | ||
| 28 | * The codec does not modify any global variables in the init function, | ||
| 29 | * allowing to call the init function without locking any global mutexes. | ||
| 30 | */ | ||
| 31 | #define FF_CODEC_CAP_INIT_THREADSAFE (1 << 0) | ||
| 32 | /** | 27 | /** |
| 33 | * The codec is not known to be init-threadsafe (i.e. it might be unsafe | 28 | * The codec is not known to be init-threadsafe (i.e. it might be unsafe |
| 34 | * to initialize this codec and another codec concurrently, typically because | 29 | * to initialize this codec and another codec concurrently, typically because |
| 35 | * the codec calls external APIs that are not known to be thread-safe). | 30 | * the codec calls external APIs that are not known to be thread-safe). |
| 36 | * Therefore calling the codec's init function needs to be guarded with a lock. | 31 | * Therefore calling the codec's init function needs to be guarded with a lock. |
| 37 | */ | 32 | */ |
| 38 | #define FF_CODEC_CAP_NOT_INIT_THREADSAFE (1 << 9) | 33 | #define FF_CODEC_CAP_NOT_INIT_THREADSAFE (1 << 0) |
| 39 | /** | 34 | /** |
| 40 | * The codec allows calling the close function for deallocation even if | 35 | * The codec allows calling the close function for deallocation even if |
| 41 | * the init function returned a failure. Without this capability flag, a | 36 | * the init function returned a failure. Without this capability flag, a |