FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
options.c File Reference

Options definition for AVCodecContext. More...

#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include <float.h>
#include <string.h>
#include "options_table.h"

Go to the source code of this file.

Macros

#define alloc_and_copy_or_fail(obj, size, pad)
 
#define FOFFSET(x)   offsetof(AVFrame,x)
 
#define SROFFSET(x)   offsetof(AVSubtitleRect,x)
 

Functions

FF_DISABLE_DEPRECATION_WARNINGS
static
FF_ENABLE_DEPRECATION_WARNINGS
const char * 
context_to_name (void *ptr)
 
static voidcodec_child_next (void *obj, void *prev)
 
static const AVClasscodec_child_class_next (const AVClass *prev)
 
static AVClassCategory get_category (void *ptr)
 
static int init_context_defaults (AVCodecContext *s, const AVCodec *codec)
 
int avcodec_get_context_defaults3 (AVCodecContext *s, const AVCodec *codec)
 
AVCodecContextavcodec_alloc_context3 (const AVCodec *codec)
 Allocate an AVCodecContext and set its fields to default values. More...
 
void avcodec_free_context (AVCodecContext **pavctx)
 Free the codec context and everything associated with it and write NULL to the provided pointer. More...
 
static void copy_context_reset (AVCodecContext *avctx)
 
int avcodec_copy_context (AVCodecContext *dest, const AVCodecContext *src)
 Copy the settings of the source AVCodecContext into the destination AVCodecContext. More...
 
const AVClassavcodec_get_class (void)
 Get the AVClass for AVCodecContext. More...
 
const AVClassavcodec_get_frame_class (void)
 Get the AVClass for AVFrame. More...
 
const AVClassavcodec_get_subtitle_rect_class (void)
 Get the AVClass for AVSubtitleRect. More...
 

Variables

static const AVClass av_codec_context_class
 
static const AVOption frame_options []
 
static const AVClass av_frame_class
 
static const AVOption subtitle_rect_options []
 
static const AVClass av_subtitle_rect_class
 

Detailed Description

Options definition for AVCodecContext.

Definition in file options.c.

Macro Definition Documentation

#define alloc_and_copy_or_fail (   obj,
  size,
  pad 
)
Value:
if (src->obj && size > 0) { \
dest->obj = av_malloc(size + pad); \
if (!dest->obj) \
goto fail; \
memcpy(dest->obj, src->obj, size); \
if (pad) \
memset(((uint8_t *) dest->obj) + size, 0, pad); \
}
#define src
Definition: vp8dsp.c:254
uint8_t
#define av_malloc(s)
ptrdiff_t size
Definition: opengl_enc.c:101
#define fail()
Definition: checkasm.h:109
if(ret< 0)
Definition: vf_mcdeint.c:279

Referenced by avcodec_copy_context().

#define FOFFSET (   x)    offsetof(AVFrame,x)

Definition at line 300 of file options.c.

Referenced by resample_common_TMPL(), and resample_linear_TMPL().

#define SROFFSET (   x)    offsetof(AVSubtitleRect,x)

Definition at line 327 of file options.c.

Function Documentation

FF_DISABLE_DEPRECATION_WARNINGS static FF_ENABLE_DEPRECATION_WARNINGS const char* context_to_name ( void ptr)
static

Definition at line 40 of file options.c.

static void* codec_child_next ( void obj,
void prev 
)
static

Definition at line 49 of file options.c.

static const AVClass* codec_child_class_next ( const AVClass prev)
static

Definition at line 57 of file options.c.

static AVClassCategory get_category ( void ptr)
static

Definition at line 73 of file options.c.

static int init_context_defaults ( AVCodecContext s,
const AVCodec codec 
)
static

Definition at line 92 of file options.c.

Referenced by avcodec_alloc_context3(), and avcodec_get_context_defaults3().

static void copy_context_reset ( AVCodecContext avctx)
static

Definition at line 191 of file options.c.

Referenced by avcodec_copy_context().

Variable Documentation

const AVClass av_codec_context_class
static
Initial value:
= {
.class_name = "AVCodecContext",
.item_name = context_to_name,
.option = avcodec_options,
.log_level_offset_offset = 0x42,
.child_next = codec_child_next,
.child_class_next = codec_child_class_next,
.get_category = get_category,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static const AVOption avcodec_options[]
Definition: options_table.h:44
static void * codec_child_next(void *obj, void *prev)
Definition: options.c:49
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Definition: log.h:130
static const AVClass * codec_child_class_next(const AVClass *prev)
Definition: options.c:57
static AVClassCategory get_category(void *ptr)
Definition: options.c:73
FF_DISABLE_DEPRECATION_WARNINGS static FF_ENABLE_DEPRECATION_WARNINGS const char * context_to_name(void *ptr)
Definition: options.c:40

Definition at line 80 of file options.c.

Referenced by avcodec_get_class(), and init_context_defaults().

const AVOption frame_options[]
static
Initial value:
={
{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
{"pkt_size", "", FOFFSET(pkt_size), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.i64 = -1 }, 0, INT_MAX, 0},
{"channel_layout", "", FOFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, 0},
{"sample_rate", "", FOFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{NULL},
}
#define NULL
Definition: coverity.c:32
#define height
uint16_t width
Definition: gdv.c:47
sample_rate
static const char * format
Definition: movenc.c:47
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
#define FOFFSET(x)
Definition: options.c:300

Definition at line 302 of file options.c.

const AVClass av_frame_class
static
Initial value:
= {
.class_name = "AVFrame",
.item_name = NULL,
.option = frame_options,
}
#define NULL
Definition: coverity.c:32
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static const AVOption frame_options[]
Definition: options.c:302

Definition at line 315 of file options.c.

Referenced by avcodec_get_frame_class().

const AVOption subtitle_rect_options[]
static
Initial value:
={
{"x", "", SROFFSET(x), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"y", "", SROFFSET(y), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"w", "", SROFFSET(w), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"h", "", SROFFSET(h), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"type", "", SROFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
{"flags", "", SROFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, 1, 0, "flags"},
{"forced", "", SROFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, 1, 0},
{NULL},
}
#define NULL
Definition: coverity.c:32
static int flags
Definition: log.c:57
#define SROFFSET(x)
Definition: options.c:327
GLint GLenum type
Definition: opengl_enc.c:105

Definition at line 329 of file options.c.

const AVClass av_subtitle_rect_class
static
Initial value:
= {
.class_name = "AVSubtitleRect",
.item_name = NULL,
}
#define NULL
Definition: coverity.c:32
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static const AVOption subtitle_rect_options[]
Definition: options.c:329

Definition at line 340 of file options.c.

Referenced by avcodec_get_subtitle_rect_class().