78 .log_level_offset_offset = offsetof(
AVCodecContext, log_level_offset),
129 #if FF_API_GET_CONTEXT_DEFAULTS 166 #if FF_API_COPY_CONTEXT 174 "Tried to copy AVCodecContext %p into already-initialized %p\n",
178 memcpy(dest, src,
sizeof(*dest));
181 dest->
codec = orig_codec;
206 #define alloc_and_copy_or_fail(obj, size, pad) \ 207 if (src->obj && size > 0) { \ 208 dest->obj = av_malloc(size + pad); \ 211 memcpy(dest->obj, src->obj, size); \ 213 memset(((uint8_t *) dest->obj) + size, 0, pad); \ 222 #undef alloc_and_copy_or_fail enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
const struct AVCodec * codec
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
memory handling functions
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static const AVOption avcodec_options[]
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
static const AVClass av_codec_context_class
struct AVHWAccel * hwaccel
Hardware accelerator in use.
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 int init_context_defaults(AVCodecContext *s, const AVCodec *codec)
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
attribute_deprecated const char * rc_eq
enum AVSampleFormat sample_fmt
audio sample format
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const AVClass * av_class
information on struct for av_log
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
const AVCodecDefault * defaults
Private codec-specific defaults.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
AVCodec * av_codec_next(const AVCodec *c)
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec...
int avcodec_is_open(AVCodecContext *s)
static void * codec_child_next(void *obj, void *prev)
simple assert() macros that are a bit more flexible than ISO C assert().
const char * name
Name of the codec implementation.
common internal API header
int rc_override_count
ratecontrol override, see RcOverride
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames...
static const AVClass * codec_child_class_next(const AVClass *prev)
int64_t reordered_opaque
opaque 64-bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
Usually treated as AVMEDIA_TYPE_DATA.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
Libavcodec external API header.
enum AVMediaType codec_type
void avcodec_free_context(AVCodecContext **pavctx)
Free the codec context and everything associated with it and write NULL to the provided pointer...
char * av_strdup(const char *s)
Duplicate the string s.
main external API structure.
uint16_t * intra_matrix
custom intra quantization matrix
Describe the class of an AVClass context structure.
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
rational number numerator/denominator
uint16_t * inter_matrix
custom inter quantization matrix
const AVClass * priv_class
AVClass for the private context.
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
#define FF_ENABLE_DEPRECATION_WARNINGS
#define alloc_and_copy_or_fail(obj, size, pad)
struct AVCodecInternal * internal
Private context used for internal data.
FF_DISABLE_DEPRECATION_WARNINGS static FF_ENABLE_DEPRECATION_WARNINGS const char * context_to_name(void *ptr)
int * slice_offset
slice offsets in the frame in bytes
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
#define AV_NOPTS_VALUE
Undefined timestamp value.
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
uint8_t * subtitle_header
Header containing style information for text subtitles.