static inline AVFrame *ff_bufqueue_get(struct FFBufQueue *queue)
{
    AVFrame *ret = queue->queue[queue->head];
    av_assert0(queue->available);
    queue->available--;
    queue->queue[queue->head] = NULL;
    queue->head = (queue->head + 1) % FF_BUFQUEUE_SIZE;
    return ret;
}