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

Go to the source code of this file.

Data Structures

struct  TestContext
 

Macros

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

Functions

static const char * test_get_name (void *ctx)
 
int main (void)
 

Variables

static const AVOption test_options []
 
static const AVClass test_class
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 38 of file opt.c.

◆ TEST_FLAG_COOL

#define TEST_FLAG_COOL   01

Definition at line 40 of file opt.c.

◆ TEST_FLAG_LAME

#define TEST_FLAG_LAME   02

Definition at line 41 of file opt.c.

◆ TEST_FLAG_MU

#define TEST_FLAG_MU   04

Definition at line 42 of file opt.c.

Function Documentation

◆ test_get_name()

static const char* test_get_name ( void ctx)
static

Definition at line 56 of file opt.c.

◆ main()

int main ( void  )

Definition at line 67 of file opt.c.

Variable Documentation

◆ test_options

const AVOption test_options[]
static
Initial value:
= {
{ "num", "set num", OFFSET(num), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100 },
{ "toggle", "set toggle", OFFSET(toggle), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1 },
{ "rational", "set rational", OFFSET(rational), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, 10 },
{ "string", "set string", OFFSET(string), AV_OPT_TYPE_STRING, { 0 }, CHAR_MIN, CHAR_MAX },
{ "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX, 0, "flags"},
{ "cool", "set cool flag ", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_COOL }, INT_MIN, INT_MAX, 0, "flags"},
{ "lame", "set lame flag ", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_LAME }, INT_MIN, INT_MAX, 0, "flags"},
{ "mu", "set mu flag ", 0, AV_OPT_TYPE_CONST, { .i64 = TEST_FLAG_MU }, INT_MIN, INT_MAX, 0, "flags"},
{ NULL },
}
#define OFFSET(x)
Definition: opt.c:38
static int flags
Definition: log.c:50
NULL
Definition: eval.c:55
#define TEST_FLAG_LAME
Definition: opt.c:41
#define TEST_FLAG_MU
Definition: opt.c:42
#define TEST_FLAG_COOL
Definition: opt.c:40

Definition at line 44 of file opt.c.

◆ test_class

const AVClass test_class
static
Initial value:
= {
"TestContext",
}
static const AVOption test_options[]
Definition: opt.c:44
static const char * test_get_name(void *ctx)
Definition: opt.c:56

Definition at line 61 of file opt.c.