29 #include "libavutil/avassert.h"
30 #include "libavutil/mem.h"
31 #include "libavutil/opt.h"
82 .log_level_offset_offset = offsetof(
AVCodecContext, log_level_offset),
89 #if FF_API_ALLOC_CONTEXT
155 if(avctx==NULL)
return NULL;
165 #if FF_API_ALLOC_CONTEXT
169 if(avctx==NULL)
return NULL;
171 avcodec_get_context_defaults2(avctx, codec_type);
189 "Tried to copy AVCodecContext %p into already-initialized %p\n",
197 memcpy(dest, src,
sizeof(*dest));
219 #define alloc_and_copy_or_fail(obj, size, pad) \
220 if (src->obj && size > 0) { \
221 dest->obj = av_malloc(size + pad); \
224 memcpy(dest->obj, src->obj, size); \
226 memset(((uint8_t *) dest->obj) + size, 0, pad); \
234 #undef alloc_and_copy_or_fail
252 #define FOFFSET(x) offsetof(AVFrame,x)
279 #define SROFFSET(x) offsetof(AVSubtitleRect,x)
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
#define LIBAVUTIL_VERSION_INT
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
enum AVMediaType codec_type
static const AVOption avcodec_options[]
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int(* decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)
int * slice_offset
slice offsets in the frame in bytes
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static const AVClass av_codec_context_class
#define AV_OPT_FLAG_SUBTITLE_PARAM
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
enum AVSampleFormat sample_fmt
audio sample format
static const AVOption subtitle_rect_options[]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
const AVCodecDefault * defaults
Private codec-specific defaults.
const AVClass * av_class
information on struct for av_log
const char * name
Name of the codec implementation.
static const AVClass av_subtitle_rect_class
#define AV_OPT_FLAG_VIDEO_PARAM
struct AVCodecInternal * internal
Private context used for internal data.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
#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(). ...
#define AV_OPT_FLAG_AUDIO_PARAM
int avcodec_is_open(AVCodecContext *s)
static void * codec_child_next(void *obj, void *prev)
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Libavcodec external API header.
void * thread_opaque
thread opaque Can be used by execute() to store some per AVCodecContext stuff.
static const char * context_to_name(void *ptr)
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int rc_override_count
ratecontrol override, see RcOverride
int64_t timecode_frame_start
GOP timecode frame start number.
uint16_t * intra_matrix
custom intra quantization matrix
const char * rc_eq
rate control equation
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static const AVClass * codec_child_class_next(const AVClass *prev)
int64_t reordered_opaque
opaque 64bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
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_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
enum AVMediaType codec_type
main external API structure.
BYTE int const BYTE int int int height
const AVClass * avcodec_get_subtitle_rect_class(void)
Get the AVClass for AVSubtitleRect.
Describe the class of an AVClass context structure.
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
rational number numerator/denominator
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.
Usually treated as AVMEDIA_TYPE_DATA.
void av_opt_free(void *obj)
Free all string and binary options in obj.
static const AVOption frame_options[]
common internal api header.
static AVClassCategory get_category(void *ptr)
static const AVClass av_frame_class
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaul...
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.
#define alloc_and_copy_or_fail(obj, size, pad)
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.
struct AVHWAccel * hwaccel
Hardware accelerator in use.
const AVClass * priv_class
AVClass for the private context.
uint16_t * inter_matrix
custom inter quantization matrix
#define av_assert0(cond)
assert() equivalent, that is always enabled.
attribute_deprecated void av_opt_set_defaults2(void *s, int mask, int flags)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
const AVClass * avcodec_get_frame_class(void)
Get the AVClass for AVFrame.
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)