39#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
40 uint64_t nb_samples = 0;
144 planes = planar ?
b->frame->ch_layout.nb_channels : 1;
147 bytes *=
b->frame->ch_layout.nb_channels;
150 b->frame->nb_samples -= samples;
151 b->frame->linesize[0] -= bytes;
153 b->frame->extended_data[
i] += bytes;
155 b->frame->data[
i] =
b->frame->extended_data[
i];
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define i(width, name, range_min, range_max)
#define AV_NUM_DATA_POINTERS
AVFrame * ff_framequeue_take(FFFrameQueue *fq)
Take the first frame in the queue.
void ff_framequeue_init(FFFrameQueue *fq, FFFrameQueueGlobal *fqg)
Init a frame queue and attach it to a global structure.
int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame)
Add a frame.
void ff_framequeue_free(FFFrameQueue *fq)
Free the queue and all queued frames.
void ff_framequeue_global_init(FFFrameQueueGlobal *fqg)
Init a global structure.
AVFrame * ff_framequeue_peek(FFFrameQueue *fq, size_t idx)
Access a frame in the queue, without removing it.
void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base)
Skip samples from the first frame in the queue.
static void check_consistency(FFFrameQueue *fq)
static FFFrameBucket * bucket(FFFrameQueue *fq, size_t idx)
static void ff_framequeue_update_peeked(FFFrameQueue *fq, size_t idx)
Update the statistics after a frame accessed using ff_framequeue_peek() was modified.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static AVRational av_make_q(int num, int den)
Create an AVRational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static const struct @257111027162314367033347246032313251342043035002 planes[]
Memory handling functions.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
Rational number (pair of numerator and denominator).
FFFrameQueue: simple AVFrame queue API.
Structure to hold global options and statistics for frame queues.
size_t queued
Total number of queued frames in the queues combined.
size_t max_queued
Maximum number of allowed frames in the queues combined.
Queue of AVFrame pointers.
size_t tail
Tail of the queue.
size_t allocated
Size of the array of buckets.
FFFrameQueueGlobal * global
Pointer to the global frame queue struct holding statistics and limits.
int samples_skipped
Indicate that samples are skipped.
size_t queued
Number of currently queued frames.
uint64_t total_samples_tail
Total number of samples dequeued from the queue.
uint64_t total_samples_head
Total number of samples entered in the queue.
FFFrameBucket first_bucket
Pre-allocated bucket for queues of size 1.
uint64_t total_frames_head
Total number of frames entered in the queue.
uint64_t total_frames_tail
Total number of frames dequeued from the queue.
FFFrameBucket * queue
Array of allocated buckets, used as a circular buffer.