Go to the documentation of this file.
51 if (!prev &&
s->codec &&
s->codec->priv_class &&
s->priv_data)
63 if (
c->priv_class == prev)
85 .log_level_offset_offset = offsetof(
AVCodecContext, log_level_offset),
102 s->codec_id = codec->
id;
150 #if FF_API_GET_CONTEXT_DEFAULTS
190 #if FF_API_COPY_CONTEXT
196 #if FF_API_CODED_FRAME
223 "Tried to copy AVCodecContext %p into already-initialized %p\n",
230 memcpy(dest,
src,
sizeof(*dest));
234 dest->
codec = orig_codec;
236 if (orig_priv_data &&
src->codec &&
src->codec->priv_class &&
245 #if FF_API_CODED_FRAME
262 #define alloc_and_copy_or_fail(obj, size, pad) \
263 if (src->obj && size > 0) { \
264 dest->obj = av_malloc(size + pad); \
267 memcpy(dest->obj, src->obj, size); \
269 memset(((uint8_t *) dest->obj) + size, 0, pad); \
279 #undef alloc_and_copy_or_fail
281 if (
src->hw_frames_ctx) {
300 #define FOFFSET(x) offsetof(AVFrame,x)
327 #define SROFFSET(x) offsetof(AVSubtitleRect,x)
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
#define FF_ENABLE_DEPRECATION_WARNINGS
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
@ AV_CLASS_CATEGORY_DECODER
#define AV_OPT_FLAG_VIDEO_PARAM
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
const AVClass * priv_class
AVClass for the private context.
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions,...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int * slice_offset
slice offsets in the frame in bytes
int(* decode)(struct AVCodecContext *, void *outdata, int *outdata_size, struct AVPacket *avpkt)
uint8_t * subtitle_header
Header containing style information for text subtitles.
static void copy_context_reset(AVCodecContext *avctx)
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
int avcodec_is_open(AVCodecContext *s)
const struct AVCodec * codec
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
static const AVClass av_codec_context_class
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static int init_context_defaults(AVCodecContext *s, const AVCodec *codec)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
static const AVOption subtitle_rect_options[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
static const AVClass av_subtitle_rect_class
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_OPT_FLAG_AUDIO_PARAM
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
void avcodec_free_context(AVCodecContext **pavctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Rational number (pair of numerator and denominator).
struct AVCodecInternal * internal
Private context used for internal data.
static void * codec_child_next(void *obj, void *prev)
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
void av_opt_free(void *obj)
Free all allocated objects in obj.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
const AVClass * avcodec_get_subtitle_rect_class(void)
Get the AVClass for AVSubtitleRect.
const AVClass * avcodec_get_frame_class(void)
Get the AVClass for AVFrame.
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
static const AVClass * codec_child_class_next(const AVClass *prev)
const AVCodecDefault * defaults
Private codec-specific defaults.
#define AV_NOPTS_VALUE
Undefined timestamp value.
void av_opt_set_defaults2(void *s, int mask, int flags)
Set the values of all AVOption fields to their default values.
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
static const AVOption frame_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...
#define AV_INPUT_BUFFER_PADDING_SIZE
static AVClassCategory get_category(void *ptr)
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
main external API structure.
#define alloc_and_copy_or_fail(obj, size, pad)
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define FF_DISABLE_DEPRECATION_WARNINGS
#define AV_OPT_FLAG_SUBTITLE_PARAM
int av_opt_copy(void *dst, const void *src)
Copy options from src object into dest object.
static const AVClass av_frame_class
uint16_t * inter_matrix
custom inter quantization matrix Must be allocated with the av_malloc() family of functions,...
#define flags(name, subs,...)
static const AVOption avcodec_options[]
@ AV_CLASS_CATEGORY_ENCODER
FF_DISABLE_DEPRECATION_WARNINGS static const FF_ENABLE_DEPRECATION_WARNINGS char * context_to_name(void *ptr)