Statistics
| Branch: | Revision:

ffmpeg / libavcodec / opt.h @ d2d230a7

History | View | Annotate | Download (1.84 KB)

1
#ifndef AVOPT_H
2
#define AVOPT_H
3

    
4
/**
5
 * @file opt.h
6
 * AVOptions
7
 */
8

    
9
enum AVOptionType{
10
    FF_OPT_TYPE_FLAGS,
11
    FF_OPT_TYPE_INT,
12
    FF_OPT_TYPE_INT64,
13
    FF_OPT_TYPE_DOUBLE,
14
    FF_OPT_TYPE_FLOAT,
15
    FF_OPT_TYPE_STRING,
16
    FF_OPT_TYPE_RATIONAL,
17
    FF_OPT_TYPE_CONST=128,
18
};
19

    
20
/**
21
 * AVOption.
22
 */
23
typedef struct AVOption {
24
    const char *name;
25

    
26
    /**
27
     * short English text help.
28
     * @fixme what about other languages
29
     */
30
    const char *help;
31
    int offset;             ///< offset to context structure where the parsed value should be stored
32
    enum AVOptionType type;
33

    
34
    double default_val;
35
    double min;
36
    double max;
37

    
38
    int flags;
39
#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
40
#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
41
#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
42
#define AV_OPT_FLAG_AUDIO_PARAM     8
43
#define AV_OPT_FLAG_VIDEO_PARAM     16
44
#define AV_OPT_FLAG_SUBTITLE_PARAM  32
45
//FIXME think about enc-audio, ... style flags
46
    const char *unit;
47
} AVOption;
48

    
49

    
50
AVOption *av_set_string(void *obj, const char *name, const char *val);
51
AVOption *av_set_double(void *obj, const char *name, double n);
52
AVOption *av_set_q(void *obj, const char *name, AVRational n);
53
AVOption *av_set_int(void *obj, const char *name, int64_t n);
54
double av_get_double(void *obj, const char *name, AVOption **o_out);
55
AVRational av_get_q(void *obj, const char *name, AVOption **o_out);
56
int64_t av_get_int(void *obj, const char *name, AVOption **o_out);
57
const char *av_get_string(void *obj, const char *name, AVOption **o_out, char *buf, int buf_len);
58
AVOption *av_next_option(void *obj, AVOption *last);
59
int av_opt_show(void *obj, void *av_log_obj);
60

    
61
#endif