Mercurial > libavcodec.hg
comparison avcodec.h @ 2874:b6def74f5811 libavcodec
flags and named constants with type checking of course for AVOption
spliting AVOption specific stuff out of avcodec.h into opt.h
author | michael |
---|---|
date | Sun, 11 Sep 2005 14:22:42 +0000 |
parents | 55809f38eb63 |
children | d0b61801ea47 |
comparison
equal
deleted
inserted
replaced
2873:55809f38eb63 | 2874:b6def74f5811 |
---|---|
10 #ifdef __cplusplus | 10 #ifdef __cplusplus |
11 extern "C" { | 11 extern "C" { |
12 #endif | 12 #endif |
13 | 13 |
14 #include "avutil.h" | 14 #include "avutil.h" |
15 #include "opt.h" | |
15 #include <sys/types.h> /* size_t */ | 16 #include <sys/types.h> /* size_t */ |
16 | 17 |
17 //FIXME the following 2 really dont belong in here | 18 //FIXME the following 2 really dont belong in here |
18 #define FFMPEG_VERSION_INT 0x000409 | 19 #define FFMPEG_VERSION_INT 0x000409 |
19 #define FFMPEG_VERSION "CVS" | 20 #define FFMPEG_VERSION "CVS" |
669 FF_COMMON_FRAME | 670 FF_COMMON_FRAME |
670 } AVFrame; | 671 } AVFrame; |
671 | 672 |
672 #define DEFAULT_FRAME_RATE_BASE 1001000 | 673 #define DEFAULT_FRAME_RATE_BASE 1001000 |
673 | 674 |
674 enum AVOptionType{ | |
675 FF_OPT_TYPE_INT, | |
676 FF_OPT_TYPE_INT64, | |
677 FF_OPT_TYPE_DOUBLE, | |
678 FF_OPT_TYPE_FLOAT, | |
679 FF_OPT_TYPE_STRING, | |
680 FF_OPT_TYPE_RATIONAL, | |
681 FF_OPT_TYPE_CONST=128, | |
682 }; | |
683 | |
684 /** | |
685 * AVOption. | |
686 */ | |
687 typedef struct AVOption { | |
688 const char *name; | |
689 | |
690 /** | |
691 * short English text help. | |
692 * @fixme what about other languages | |
693 */ | |
694 const char *help; | |
695 int offset; ///< offset to context structure where the parsed value should be stored | |
696 enum AVOptionType type; | |
697 | |
698 double default_val; | |
699 double min; | |
700 double max; | |
701 | |
702 int flags; | |
703 #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding | |
704 #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding | |
705 #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ... | |
706 #define AV_OPT_FLAG_AUDIO_PARAM 8 | |
707 #define AV_OPT_FLAG_VIDEO_PARAM 16 | |
708 #define AV_OPT_FLAG_SUBTITLE_PARAM 32 | |
709 //FIXME think about enc-audio, ... style flags | |
710 } AVOption; | |
711 | |
712 /** | 675 /** |
713 * Used by av_log | 676 * Used by av_log |
714 */ | 677 */ |
715 typedef struct AVCLASS AVClass; | 678 typedef struct AVCLASS AVClass; |
716 struct AVCLASS { | 679 struct AVCLASS { |
1884 * - encoding: unused | 1847 * - encoding: unused |
1885 * - decoding: set by user. | 1848 * - decoding: set by user. |
1886 */ | 1849 */ |
1887 enum AVDiscard skip_frame; | 1850 enum AVDiscard skip_frame; |
1888 } AVCodecContext; | 1851 } AVCodecContext; |
1889 | |
1890 AVOption *av_set_string(void *obj, const char *name, const char *val); | |
1891 AVOption *av_set_double(void *obj, const char *name, double n); | |
1892 AVOption *av_set_q(void *obj, const char *name, AVRational n); | |
1893 AVOption *av_set_int(void *obj, const char *name, int64_t n); | |
1894 double av_get_double(void *obj, const char *name, AVOption **o_out); | |
1895 AVRational av_get_q(void *obj, const char *name, AVOption **o_out); | |
1896 int64_t av_get_int(void *obj, const char *name, AVOption **o_out); | |
1897 const char *av_get_string(void *obj, const char *name, AVOption **o_out, char *buf, int buf_len); | |
1898 AVOption *av_next_option(void *obj, AVOption *last); | |
1899 int av_opt_show(void *obj, FILE *f); | |
1900 | 1852 |
1901 /** | 1853 /** |
1902 * AVCodec. | 1854 * AVCodec. |
1903 */ | 1855 */ |
1904 typedef struct AVCodec { | 1856 typedef struct AVCodec { |