History

avcodec: Make init-threadsafety the default

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.

Andreas Rheinhardt committed 4 years ago

Commit 21b23ce1 parent 6aad120407 files · +243 −572Browse files

Showing the changes to libavcodec/codec_internal.h (1 of 407 files). Show all

Unified · Split

libavcodec/codec_internal.h+1−6
@@ -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 unsafe28 * 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 because29 * 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 if35 * The codec allows calling the close function for deallocation even if
41 * the init function returned a failure. Without this capability flag, a36 * the init function returned a failure. Without this capability flag, a

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t