42 const int samples_per_frame,
56 int max_samples = samples_per_frame ? samples_per_frame :
77 int stream_index,
int flush)
95 memset(pkt->
data + size, 0, pkt->
size - size);
static void flush(AVCodecContext *avctx)
int64_t n
number of generated packets
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream ** streams
A list of all streams in the file.
unsigned fifo_size
size of currently allocated FIFO
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define i(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
enum AVMediaType codec_type
General type of the encoded data.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
AVRational time_base
time base of output audio packets
int av_fifo_size(const AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
Resize an AVFifoBuffer.
static AVRational av_make_q(int num, int den)
Create an AVRational.
int ff_audio_interleave_init(AVFormatContext *s, const int samples_per_frame, AVRational time_base)
a very simple circular buffer FIFO implementation
Rational number (pair of numerator and denominator).
int sample_size
size of one sample all channels included
AVFifoBuffer * av_fifo_alloc_array(size_t nmemb, size_t size)
Initialize an AVFifoBuffer.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int sample_rate
Audio only.
void ff_audio_interleave_close(AVFormatContext *s)
int samples_per_frame
samples per frame if fixed, 0 otherwise
int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush, int(*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), int(*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *))
Rechunk audio PCM packets per AudioInterleaveContext->samples_per_frame and interleave them correctly...
static int get_packet(URLContext *s, int for_header)
Interact with the server by receiving and sending RTMP packets until there is some significant data (...
static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt, int stream_index, int flush)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
void av_fifo_freep(AVFifoBuffer **f)
Free an AVFifoBuffer and reset pointer to NULL.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t nb_samples
number of generated samples