FFmpeg
Data Structures | Macros | Functions | Variables
opt.c File Reference
#include <limits.h>
#include <stdio.h>
#include "libavutil/common.h"
#include "libavutil/channel_layout.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/rational.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"

Go to the source code of this file.

Data Structures

struct  TestContext
 
struct  ChildContext
 

Macros

#define OFFSET(x)   offsetof(TestContext, x)
 
#define TEST_FLAG_COOL   01
 
#define TEST_FLAG_LAME   02
 
#define TEST_FLAG_MU   04
 
#define OFFSET(x)   offsetof(ChildContext, x)
 

Functions

static const char * test_get_name (void *ctx)
 
static const char * child_get_name (void *ctx)
 
static void * test_child_next (void *obj, void *prev)
 
static void log_callback_help (void *ptr, int level, const char *fmt, va_list vl)
 
int main (void)
 

Variables

static const AVOptionArrayDef array_str
 
static const AVOptionArrayDef array_dict
 
static const AVOption test_options []
 
static const AVOption child_options []
 
static const AVClass child_class
 
static const AVClass test_class
 

Macro Definition Documentation

◆ OFFSET [1/2]

#define OFFSET (   x)    offsetof(TestContext, x)

Definition at line 136 of file opt.c.

◆ TEST_FLAG_COOL

#define TEST_FLAG_COOL   01

Definition at line 75 of file opt.c.

◆ TEST_FLAG_LAME

#define TEST_FLAG_LAME   02

Definition at line 76 of file opt.c.

◆ TEST_FLAG_MU

#define TEST_FLAG_MU   04

Definition at line 77 of file opt.c.

◆ OFFSET [2/2]

#define OFFSET (   x)    offsetof(ChildContext, x)

Definition at line 136 of file opt.c.

Function Documentation

◆ test_get_name()

static const char* test_get_name ( void *  ctx)
static

Definition at line 124 of file opt.c.

◆ child_get_name()

static const char* child_get_name ( void *  ctx)
static

Definition at line 144 of file opt.c.

◆ test_child_next()

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

Definition at line 156 of file opt.c.

◆ log_callback_help()

static void log_callback_help ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
)
static

Definition at line 172 of file opt.c.

Referenced by main().

◆ main()

int main ( void  )

Definition at line 177 of file opt.c.

Variable Documentation

◆ array_str

const AVOptionArrayDef array_str
static
Initial value:
= {
.sep = '|',
.def = "str0|str\\|1|str\\\\2",
}

Definition at line 79 of file opt.c.

◆ array_dict

const AVOptionArrayDef array_dict
static
Initial value:
= {
.def = "k00=v\\\\\\\\00:k01=v\\,01,k10=v\\\\=1\\\\:0",
}

Definition at line 84 of file opt.c.

◆ test_options

const AVOption test_options[]
static

Definition at line 89 of file opt.c.

◆ child_options

const AVOption child_options[]
static
Initial value:
= {
{"child_num64", "set num 64bit", OFFSET(child_num64), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, 100, 1 },
{"child_num", "set child_num", OFFSET(child_num), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 100, 1 },
{ NULL },
}

Definition at line 138 of file opt.c.

◆ child_class

const AVClass child_class
static
Initial value:
= {
.class_name = "ChildContext",
.item_name = child_get_name,
.option = child_options,
}

Definition at line 149 of file opt.c.

Referenced by main().

◆ test_class

const AVClass test_class
static
Initial value:
= {
.class_name = "TestContext",
.item_name = test_get_name,
.option = test_options,
.child_next = test_child_next,
}

Definition at line 164 of file opt.c.

Referenced by main().

test_get_name
static const char * test_get_name(void *ctx)
Definition: opt.c:124
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:246
child_options
static const AVOption child_options[]
Definition: opt.c:138
child_get_name
static const char * child_get_name(void *ctx)
Definition: opt.c:144
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: opt.c:136
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:245
test_child_next
static void * test_child_next(void *obj, void *prev)
Definition: opt.c:156
test_options
static const AVOption test_options[]
Definition: opt.c:89