56 if (min_samples <= 0 || min_samples > INT_MAX / s->
sample_size - 1)
91 pkt->
size -= drain_data;
92 pkt->
data += drain_data;
94 pkt->
dts += drain_samples;
96 pkt->
pts += drain_samples;
145 pkt->
size = data_size;
173 #define OFFSET(x) offsetof(PCMContext, x) 174 #define FLAGS (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_BSF_PARAM) 212 .
name =
"pcm_rechunk",
214 .priv_class = &pcm_rechunk_class,
#define LIBAVUTIL_VERSION_INT
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
The bitstream filter state.
const char * av_default_item_name(void *ptr)
Return the context name.
void * priv_data
Opaque filter-specific private data.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
#define AVERROR_EOF
End of file.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
static void flush(AVBSFContext *ctx)
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.
AVCodecID
Identify the syntax and semantics of the bitstream.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb)
Convert valid timing fields (timestamps / durations) in a packet from one timebase to another...
AVRational time_base_in
The timebase used for the timestamps of the input packets.
simple assert() macros that are a bit more flexible than ISO C assert().
const AVBitStreamFilter ff_pcm_rechunk_bsf
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
AVRational time_base_out
The timebase used for the timestamps of the output packets.
static enum AVCodecID codec_ids[]
Libavcodec external API header.
static AVRational av_make_q(int num, int den)
Create an AVRational.
static int rechunk_filter(AVBSFContext *ctx, AVPacket *pkt)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
static void drain_packet(AVPacket *pkt, int drain_data, int drain_samples)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int sample_rate
Audio only.
static int get_next_nb_samples(AVBSFContext *ctx)
static int send_packet(PCMContext *s, int nb_samples, AVPacket *pkt)
static int init(AVBSFContext *ctx)
static void uninit(AVBSFContext *ctx)
static const AVClass pcm_rechunk_class
static const AVOption options[]
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.