FFmpeg: libavcodec/options.c Source File
Go to the documentation of this file. 1 /*
2 * Copyright (c) 2001 Fabrice Bellard
3 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Options definition for AVCodecContext.
25 */
26
27 #include "config_components.h"
28
36 #include <string.h>
37
41
44
45 if (avc && avc->
codec)
47 else
48 return "NULL";
49 }
50
52 {
54 if (!prev &&
s->codec &&
s->codec->priv_class &&
s->priv_data)
57 }
58
60 {
62 /* find next codec with priv options */
67 }
68
70 {
74 else
76 }
77
83 .log_level_offset_offset = offsetof(
AVCodecContext, log_level_offset),
88 };
89
91 {
95
97
99 if (codec) {
101 s->codec_id = codec->
id;
102 }
103
111
113
127
135 }
136 }
143 d++;
144 }
145 }
146 return 0;
147 }
148
150 {
152
153 if (!avctx)
155
159 }
160
161 return avctx;
162 }
163
165 {
167
168 if (!avctx)
169 return;
170
172
180
182 }
183
185 {
187 }
188
189 #define SROFFSET(x) offsetof(AVSubtitleRect,x)
190
200 };
201
207 };
208
210 {
212 }
#define FF_ENABLE_DEPRECATION_WARNINGS
const FFCodecDefault * defaults
Private codec-specific defaults.
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
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
const AVClass * priv_class
AVClass for the private context.
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions,...
uint8_t * subtitle_header
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
const struct AVCodec * codec
AVChannelLayout ch_layout
Audio channel layout.
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)
#define AV_OPT_FLAG_AUDIO_PARAM
static const AVOption subtitle_rect_options[]
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
static const AVClass av_subtitle_rect_class
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
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).
static void * codec_child_next(void *obj, void *prev)
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.
static const AVClass * codec_child_class_iterate(void **iter)
AVClassCategory category
Category used for visualization (like color).
static int ff_codec_is_decoder(const AVCodec *avcodec)
Internal version of av_codec_is_decoder().
static const av_always_inline FFCodec * ffcodec(const AVCodec *codec)
uint16_t * chroma_intra_matrix
custom intra quantization matrix
@ 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().
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count)
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
#define AV_OPT_FLAG_SUBTITLE_PARAM
#define AV_OPT_FLAG_VIDEO_PARAM
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.
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static AVClassCategory get_category(void *ptr)
main external API structure.
@ AV_OPT_TYPE_INT
Underlying C type is int.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
void av_opt_set_defaults2(void *s, int mask, int flags)
Set the values of all AVOption fields to their default values.
#define FF_DISABLE_DEPRECATION_WARNINGS
av_cold void ff_codec_close(AVCodecContext *avctx)
int avcodec_default_get_encode_buffer(AVCodecContext *s, AVPacket *pkt, int flags)
The default callback for AVCodecContext.get_encode_buffer().
uint16_t * inter_matrix
custom inter quantization matrix Must be allocated with the av_malloc() family of functions,...
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
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)
Generated on Fri Oct 17 2025 19:22:24 for FFmpeg by
doxygen
1.8.17