MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / avcodec_thread_execute

Function avcodec_thread_execute

libavcodec/w32thread.c:96–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
97 ThreadContext *c= s->thread_opaque;
98 int i;
99 int jobnr = 0;
100
101 assert(s == c->avctx);
102
103 /* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */
104
105 for(i=0; i<s->thread_count; i++){
106 c[i].arg= arg;
107 c[i].argsize= size;
108 c[i].func= func;
109 c[i].ret= ret;
110 c[i].jobnr = &jobnr;
111 }
112 ReleaseSemaphore(c[0].work_sem, count, 0);
113 for(i=0; i<count; i++)
114 WaitForSingleObject(c[0].done_sem, INFINITE);
115
116 return 0;
117}
118
119static int avcodec_thread_execute2(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count){
120 ThreadContext *c= s->thread_opaque;

Callers 1

avcodec_thread_execute2Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected