Audacity 3.2.0
AVCodecFunctions.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 AVCodecFunctions.h
6
7 Dmitry Vedenko
8
9**********************************************************************/
10
11#pragma once
12
13#include <cstdint>
14
15#include "FFmpegTypes.h"
16
18
19struct FFMPEG_SUPPORT_API AVCodecFunctions
20{
22
23 void (*av_packet_ref) (AVPacket* dst, const AVPacket* src) = nullptr;
24 void (*av_packet_unref) (AVPacket* pkt) = nullptr;
25 void (*av_init_packet) (AVPacket *pkt) = nullptr;
26 AVCodec* (*avcodec_find_encoder) (AVCodecIDFwd id) = nullptr;
27 AVCodec* (*avcodec_find_encoder_by_name) (const char *name) = nullptr;
28 AVCodec* (*avcodec_find_decoder) (AVCodecIDFwd id) = nullptr;
29 const char* (*avcodec_get_name) (AVCodecIDFwd id) = nullptr;
30 int (*avcodec_open2) (AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) = nullptr;
31 int (*avcodec_is_open) (AVCodecContext *avctx) = nullptr;
32 int (*avcodec_close) (AVCodecContext *avctx) = nullptr;
33 AVCodecContext* (*avcodec_alloc_context3) (const AVCodec* codec) = nullptr;
34 int (*av_codec_is_encoder) (const AVCodec *codec) = nullptr;
35 int (*avcodec_fill_audio_frame) (AVFrame *frame, int nb_channels, AVSampleFormatFwd sample_fmt, const uint8_t *buf, int buf_size, int align) = nullptr;
36
37 // The following functions are not present in all library versions:
38 AVPacket* (*av_packet_alloc) () = nullptr;
39 void (*av_packet_free)(AVPacket** pkt) = nullptr;
40 void (*avcodec_free_context) (AVCodecContext** avctx) = nullptr;
43 int (*avcodec_decode_audio4) (AVCodecContext *avctx, AVFrame *frame, int *got_output, const AVPacket *avpkt) = nullptr;
44 int (*avcodec_encode_audio2) (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_output) = nullptr;
45 void (*avcodec_register_all)(void) = nullptr;
46 AVCodec* (*av_codec_next)(const AVCodec* c) = nullptr;
47 const AVCodec* (*av_codec_iterate)(void** opaque) = nullptr;
48
49 // New API for decoding and encoding. Audacity will preffer it when available.
50 int (*avcodec_send_packet)(AVCodecContext* avctx, const AVPacket* avpkt) = nullptr;
51 int (*avcodec_receive_frame)(AVCodecContext* avctx, AVFrame* frame) = nullptr;
52 int (*avcodec_send_frame)(AVCodecContext* avctx, const AVFrame* frame) = nullptr;
53 int (*avcodec_receive_packet)(AVCodecContext* avctx, AVPacket* avpkt) = nullptr;
54};
int AVCodecIDFwd
Definition: AVCodecID.h:407
struct AVDictionary AVDictionary
Definition: FFmpegTypes.h:117
int AVSampleFormatFwd
Definition: FFmpegTypes.h:132
wxString name
Definition: TagsEditor.cpp:166
int id
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
int av_codec_is_encoder(const AVCodec *codec)
void av_packet_unref(AVPacket *pkt)
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align)
int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt)
int avcodec_is_open(AVCodecContext *s)
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
void av_init_packet(AVPacket *pkt)
int av_packet_ref(AVPacket *dst, const AVPacket *src)
void avcodec_register_all(void)
int avcodec_close(AVCodecContext *avctx)
void avcodec_free_context(AVCodecContext **avctx)
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
void av_packet_free(AVPacket **pkt)
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
FFMPegVersion AVCodecVersion