Go to the documentation of this file.
29 #ifndef COMPAT_W32PTHREADS_H
30 #define COMPAT_W32PTHREADS_H
51 void *(*func)(
void*
arg);
60 #define PTHREAD_MUTEX_INITIALIZER SRWLOCK_INIT
61 #define PTHREAD_COND_INITIALIZER CONDITION_VARIABLE_INIT
63 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
64 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
66 #define PTHREAD_CANCEL_ENABLE 1
67 #define PTHREAD_CANCEL_DISABLE 0
70 #define THREADFUNC_RETTYPE DWORD
72 #define THREADFUNC_RETTYPE unsigned
79 h->ret =
h->func(
h->arg);
84 void *(*start_routine)(
void*),
void *
arg)
92 ret->func = start_routine;
115 if (
ret != WAIT_OBJECT_0) {
116 if (
ret == WAIT_ABANDONED)
122 *value_ptr = thread->
ret;
123 CloseHandle(thread->
handle);
130 InitializeSRWLock(m);
140 AcquireSRWLockExclusive(m);
145 ReleaseSRWLockExclusive(m);
150 #define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
154 BOOL pending = FALSE;
155 InitOnceBeginInitialize(once_control, 0, &pending,
NULL);
158 InitOnceComplete(once_control, 0,
NULL);
164 InitializeConditionVariable(
cond);
176 WakeAllConditionVariable(
cond);
182 SleepConditionVariableSRW(
cond,
mutex, INFINITE, 0);
187 const struct timespec *abstime)
189 int64_t abs_milli = abstime->tv_sec * 1000LL + abstime->tv_nsec / 1000000;
192 if (!SleepConditionVariableSRW(
cond,
mutex, t, 0)) {
193 DWORD err = GetLastError();
194 if (err == ERROR_TIMEOUT)
204 WakeConditionVariable(
cond);
216 typedef HRESULT (WINAPI *SetThreadDescriptionFn)(HANDLE, PCWSTR);
221 HMODULE kernelbase = GetModuleHandleW(
L"kernelbase.dll");
225 SetThreadDescriptionFn pSetThreadDescription =
226 (SetThreadDescriptionFn)GetProcAddress(kernelbase,
"SetThreadDescription");
227 if (!pSetThreadDescription)
231 if (utf8towchar(
name, &wname) < 0)
234 HRESULT hr = pSetThreadDescription(GetCurrentThread(), wname);
236 return SUCCEEDED(hr) ? 0 :
AVERROR(EINVAL);
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int pthread_mutex_lock(pthread_mutex_t *m)
static av_unused THREADFUNC_RETTYPE __stdcall attribute_align_arg win32thread_worker(void *arg)
static int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
static int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
static int pthread_cond_broadcast(pthread_cond_t *cond)
static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
static int pthread_cond_destroy(pthread_cond_t *cond)
static av_unused int pthread_once(pthread_once_t *once_control, void(*init_routine)(void))
#define THREADFUNC_RETTYPE
static int pthread_mutex_destroy(pthread_mutex_t *m)
CONDITION_VARIABLE pthread_cond_t
#define attribute_align_arg
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr, void *(*start_routine)(void *), void *arg)
static int pthread_cond_signal(pthread_cond_t *cond)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
static int pthread_setcancelstate(int state, int *oldstate)
static int pthread_mutex_init(pthread_mutex_t *m, void *attr)
int64_t av_gettime(void)
Get the current time in microseconds.
#define WaitForSingleObject(a, b)
static int win32_thread_setname(const char *name)
static int pthread_mutex_unlock(pthread_mutex_t *m)
int(* cond)(enum AVPixelFormat pix_fmt)