Go to the documentation of this file.
19 #include <wavpack/wavpack.h>
30 #define WV_DEFAULT_BLOCK_SIZE 32768
61 WavpackGetErrorMessage(
s->wv));
68 ret = WavpackFlushSamples(
s->wv);
71 WavpackGetErrorMessage(
s->wv));
91 if (
s->user_size - count < s->
pkt->
size) {
114 WavpackConfig config = { 0 };
126 config.bytes_per_sample = 4;
127 config.bits_per_sample = 32;
130 config.num_channels = avctx->
channels;
135 config.flags |= CONFIG_VERY_HIGH_FLAG;
148 config.flags |= CONFIG_HIGH_FLAG;
150 config.flags |= CONFIG_FAST_FLAG;
153 ret = WavpackSetConfiguration(
s->wv, &config, -1);
157 ret = WavpackPackInit(
s->wv);
167 WavpackGetErrorMessage(
s->wv));
168 WavpackCloseFile(
s->wv);
176 WavpackCloseFile(
s->wv);
184 .
name =
"libwavpack",
194 .wrapper_name =
"libwavpack",
int frame_size
Number of samples per channel in an audio frame.
static av_cold int init(AVCodecContext *avctx)
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
uint64_t channel_layout
Audio channel layout.
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int64_t *duration)
Remove frame(s) from the queue.
int sample_rate
samples per second
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
static enum AVSampleFormat sample_fmts[]
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
This structure describes decoded (raw) audio or video data.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define FF_COMPRESSION_DEFAULT
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int wavpack_encode_close(AVCodecContext *avctx)
Describe the class of an AVClass context structure.
static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_output)
#define WV_DEFAULT_BLOCK_SIZE
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int channels
number of audio channels
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
AVSampleFormat
Audio sample formats.
const char * name
Name of the codec implementation.
static int encode_callback(void *id, void *data, int32_t count)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
This structure stores compressed data.
AVCodec ff_libwavpack_encoder
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
@ AV_SAMPLE_FMT_S32
signed 32 bits
static av_cold int wavpack_encode_init(AVCodecContext *avctx)