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));
104 memcpy(s->
pkt->
data + offset, data, count);
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",
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int64_t *duration)
Remove frame(s) from the queue.
#define FF_COMPRESSION_DEFAULT
This structure describes decoded (raw) audio or video data.
static av_cold int wavpack_encode_init(AVCodecContext *avctx)
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
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
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_output)
static av_cold int wavpack_encode_close(AVCodecContext *avctx)
const char * name
Name of the codec implementation.
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
uint64_t channel_layout
Audio channel layout.
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
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
#define WV_DEFAULT_BLOCK_SIZE
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
main external API structure.
Describe the class of an AVClass context structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int encode_callback(void *id, void *data, int32_t count)
common internal api header.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
AVCodec ff_libwavpack_encoder
int channels
number of audio channels
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
static enum AVSampleFormat sample_fmts[]
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.
int nb_samples
number of audio samples (per channel) described by this frame
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...