22 #ifndef AVFILTER_BUFFERQUEUE_H 23 #define AVFILTER_BUFFERQUEUE_H 39 #ifndef FF_BUFQUEUE_SIZE 40 #define FF_BUFQUEUE_SIZE 64 50 AVFrame *queue[FF_BUFQUEUE_SIZE];
55 #define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE] 60 static inline int ff_bufqueue_is_full(
struct FFBufQueue *queue)
62 return queue->
available == FF_BUFQUEUE_SIZE;
71 static inline void ff_bufqueue_add(
void *log,
struct FFBufQueue *queue,
74 if (ff_bufqueue_is_full(queue)) {
90 return index < queue->
available ? BUCKET(index) : NULL;
100 AVFrame *ret = queue->queue[queue->head];
103 queue->queue[queue->head] = NULL;
104 queue->head = (queue->head + 1) % FF_BUFQUEUE_SIZE;
111 static inline void ff_bufqueue_discard_all(
struct FFBufQueue *queue)
114 AVFrame *buf = ff_bufqueue_get(queue);
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
Main libavfilter public API header.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
Structure holding the queue.
Definition: bufferqueue.h:49
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:202
simple assert() macros that are a bit more flexible than ISO C assert().
unsigned short available
number of available buffers
Definition: bufferqueue.h:52