Audacity
3.2.0
modules
import-export
mod-ffmpeg
lib-ffmpeg-support
impl
avcodec
AVCodecFunctionsLoader.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
3
Audacity: A Digital Audio Editor
4
5
AVCodecFunctionsLoaders.cpp
6
7
Dmitry Vedenko
8
9
**********************************************************************/
10
11
#include "
AVCodecFunctionsLoader.h
"
12
13
#include <wx/dynlib.h>
14
15
#include "
AVCodecFunctions.h
"
16
#include "
impl/DynamicLibraryHelpers.h
"
17
18
19
bool
LoadAVCodecFunctions
(
20
const
wxDynamicLibrary& lib,
AVCodecFunctions
& functions)
21
{
22
RESOLVE
(
av_packet_ref
);
23
RESOLVE
(
av_packet_unref
);
24
RESOLVE
(
av_init_packet
);
25
RESOLVE
(
avcodec_find_encoder
);
26
RESOLVE
(
avcodec_find_encoder_by_name
);
27
RESOLVE
(
avcodec_find_decoder
);
28
RESOLVE
(
avcodec_get_name
);
29
RESOLVE
(
avcodec_open2
);
30
RESOLVE
(
avcodec_is_open
);
31
RESOLVE
(
avcodec_close
);
32
RESOLVE
(
avcodec_alloc_context3
);
33
RESOLVE
(
av_codec_is_encoder
);
34
RESOLVE
(
avcodec_fill_audio_frame
);
35
36
GET_SYMBOL
(
av_packet_alloc
);
37
GET_SYMBOL
(
av_packet_free
);
38
GET_SYMBOL
(
avcodec_free_context
);
39
GET_SYMBOL
(
avcodec_parameters_to_context
);
40
GET_SYMBOL
(
avcodec_parameters_from_context
);
41
// Missing in FFmpeg 59
42
GET_SYMBOL
(
avcodec_decode_audio4
);
43
GET_SYMBOL
(
avcodec_encode_audio2
);
44
GET_SYMBOL
(
avcodec_register_all
);
45
GET_SYMBOL
(
av_codec_next
);
46
GET_SYMBOL
(
av_codec_iterate
);
47
// New decoding API
48
GET_SYMBOL
(
avcodec_send_packet
);
49
GET_SYMBOL
(
avcodec_receive_frame
);
50
GET_SYMBOL
(
avcodec_send_frame
);
51
GET_SYMBOL
(
avcodec_receive_packet
);
52
53
return
GetAVVersion
(lib,
"avcodec_version"
, functions.
AVCodecVersion
);
54
}
AVCodecFunctions.h
LoadAVCodecFunctions
bool LoadAVCodecFunctions(const wxDynamicLibrary &lib, AVCodecFunctions &functions)
Definition:
AVCodecFunctionsLoader.cpp:19
AVCodecFunctionsLoader.h
GetAVVersion
bool GetAVVersion(const wxDynamicLibrary &lib, const char *name, FFMPegVersion &version)
Definition:
DynamicLibraryHelpers.cpp:19
DynamicLibraryHelpers.h
RESOLVE
#define RESOLVE(name)
Requires the named function to be found in the library, else load fails.
Definition:
DynamicLibraryHelpers.h:19
GET_SYMBOL
#define GET_SYMBOL(name)
Does not require the named function to be found in the library.
Definition:
DynamicLibraryHelpers.h:17
avcodec_open2
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
avcodec_find_decoder
AVCodec * avcodec_find_decoder(enum AVCodecID id)
av_codec_is_encoder
int av_codec_is_encoder(const AVCodec *codec)
avcodec_find_encoder_by_name
AVCodec * avcodec_find_encoder_by_name(const char *name)
av_codec_next
AVCodec * av_codec_next(const AVCodec *c)
avcodec_alloc_context3
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
av_packet_unref
void av_packet_unref(AVPacket *pkt)
avcodec_fill_audio_frame
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align)
avcodec_decode_audio4
int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt)
avcodec_is_open
int avcodec_is_open(AVCodecContext *s)
avcodec_encode_audio2
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
avcodec_get_name
const char * avcodec_get_name(enum AVCodecID id)
av_init_packet
void av_init_packet(AVPacket *pkt)
av_packet_ref
int av_packet_ref(AVPacket *dst, const AVPacket *src)
avcodec_find_encoder
AVCodec * avcodec_find_encoder(enum AVCodecID id)
avcodec_register_all
void avcodec_register_all(void)
avcodec_close
int avcodec_close(AVCodecContext *avctx)
avcodec_free_context
void avcodec_free_context(AVCodecContext **avctx)
avcodec_parameters_from_context
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
av_packet_free
void av_packet_free(AVPacket **pkt)
avcodec_receive_frame
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
avcodec_send_packet
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
avcodec_receive_packet
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
avcodec_send_frame
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
avcodec_parameters_to_context
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
av_packet_alloc
AVPacket * av_packet_alloc(void)
av_codec_iterate
const AVCodec * av_codec_iterate(void **opaque)
AVCodecFunctions
Definition:
AVCodecFunctions.h:20
AVCodecFunctions::AVCodecVersion
FFMPegVersion AVCodecVersion
Definition:
AVCodecFunctions.h:21
Generated by
1.9.3