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

Function get_buffer

libavcodec/omx.c:250–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static OMX_BUFFERHEADERTYPE *get_buffer(pthread_mutex_t *mutex, pthread_cond_t *cond,
251 int* array_size, OMX_BUFFERHEADERTYPE **array,
252 int wait)
253{
254 OMX_BUFFERHEADERTYPE *buffer;
255 pthread_mutex_lock(mutex);
256 if (wait) {
257 while (!*array_size)
258 pthread_cond_wait(cond, mutex);
259 }
260 if (*array_size > 0) {
261 buffer = array[0];
262 (*array_size)--;
263 memmove(&array[0], &array[1], (*array_size) * sizeof(OMX_BUFFERHEADERTYPE*));
264 } else {
265 buffer = NULL;
266 }
267 pthread_mutex_unlock(mutex);
268 return buffer;
269}
270
271static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, OMX_EVENTTYPE event,
272 OMX_U32 data1, OMX_U32 data2, OMX_PTR event_data)

Callers 3

cleanupFunction · 0.70
omx_encode_initFunction · 0.70
omx_encode_frameFunction · 0.70

Calls 3

pthread_mutex_lockFunction · 0.50
pthread_cond_waitFunction · 0.50
pthread_mutex_unlockFunction · 0.50

Tested by

no test coverage detected