51 if (!prev &&
s->codec &&
s->codec->priv_class &&
s->priv_data)
56 #if FF_API_CHILD_CLASS_NEXT
64 if (
c->priv_class == prev)
97 .log_level_offset_offset = offsetof(
AVCodecContext, log_level_offset),
99 #if FF_API_CHILD_CLASS_NEXT
117 s->codec_id = codec->
id;
166 #if FF_API_GET_CONTEXT_DEFAULTS
206 #if FF_API_COPY_CONTEXT
212 #if FF_API_CODED_FRAME
239 "Tried to copy AVCodecContext %p into already-initialized %p\n",
246 memcpy(dest,
src,
sizeof(*dest));
250 dest->
codec = orig_codec;
252 if (orig_priv_data &&
src->codec &&
src->codec->priv_class &&
261 #if FF_API_CODED_FRAME
278 #define alloc_and_copy_or_fail(obj, size, pad) \
279 if (src->obj && size > 0) { \
280 dest->obj = av_malloc(size + pad); \
283 memcpy(dest->obj, src->obj, size); \
285 memset(((uint8_t *) dest->obj) + size, 0, pad); \
295 #undef alloc_and_copy_or_fail
297 if (
src->hw_frames_ctx) {
316 #if FF_API_GET_FRAME_CLASS
317 #define FOFFSET(x) offsetof(AVFrame,x)
345 #define SROFFSET(x) offsetof(AVSubtitleRect,x)
static const char *const format[]
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count)
Libavcodec external API header.
#define flags(name, subs,...)
int av_opt_copy(void *dst, const void *src)
Copy options from src object into dest object.
void av_opt_free(void *obj)
Free all allocated objects in obj.
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
void av_opt_set_defaults2(void *s, int mask, int flags)
Set the values of all AVOption fields to their default values.
const AVClass * avcodec_get_frame_class(void)
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
const AVClass * avcodec_get_subtitle_rect_class(void)
Get the AVClass for AVSubtitleRect.
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
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.
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
av_cold int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
void avcodec_free_context(AVCodecContext **pavctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
int avcodec_default_get_encode_buffer(AVCodecContext *s, AVPacket *pkt, int flags)
The default callback for AVCodecContext.get_encode_buffer().
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
int avcodec_is_open(AVCodecContext *s)
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
static const AVClass av_subtitle_rect_class
static int init_context_defaults(AVCodecContext *s, const AVCodec *codec)
FF_DISABLE_DEPRECATION_WARNINGS static FF_ENABLE_DEPRECATION_WARNINGS const char * context_to_name(void *ptr)
static const AVClass * codec_child_class_iterate(void **iter)
static const AVClass * codec_child_class_next(const AVClass *prev)
static const AVOption frame_options[]
#define alloc_and_copy_or_fail(obj, size, pad)
static void * codec_child_next(void *obj, void *prev)
static const AVClass av_codec_context_class
static AVClassCategory get_category(void *ptr)
static void copy_context_reset(AVCodecContext *avctx)
static const AVOption subtitle_rect_options[]
static const AVClass av_frame_class
static const AVOption avcodec_options[]
common internal API header
#define FF_DISABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
@ AV_CLASS_CATEGORY_ENCODER
@ AV_CLASS_CATEGORY_DECODER
Memory handling functions.
#define AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_VIDEO_PARAM
#define AV_OPT_FLAG_SUBTITLE_PARAM
Describe the class of an AVClass context structure.
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
const struct AVClass *(* child_class_iterate)(void **iter)
Iterate over the AVClasses corresponding to potential AVOptions-enabled children.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
main external API structure.
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
uint16_t * inter_matrix
custom inter quantization matrix Must be allocated with the av_malloc() family of functions,...
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
const struct AVCodec * codec
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions,...
uint8_t * subtitle_header
Header containing style information for text subtitles.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
int * slice_offset
slice offsets in the frame in bytes
struct AVCodecInternal * internal
Private context used for internal data.
const AVCodecDefault * defaults
Private codec-specific defaults.
const AVClass * priv_class
AVClass for the private context.
int(* decode)(struct AVCodecContext *avctx, void *outdata, int *got_frame_ptr, struct AVPacket *avpkt)
Decode picture or subtitle data.
const char * name
Name of the codec implementation.
Rational number (pair of numerator and denominator).