comparison avcodec.h @ 2862:f4aea2c316cc libavcodec

AVOption first try
author michael
date Tue, 06 Sep 2005 12:51:56 +0000
parents 6f7428adc6ad
children 3b999ce45b37
comparison
equal deleted inserted replaced
2861:3b920e274b26 2862:f4aea2c316cc
19 #define FFMPEG_VERSION "CVS" 19 #define FFMPEG_VERSION "CVS"
20 20
21 #define AV_STRINGIFY(s) AV_TOSTRING(s) 21 #define AV_STRINGIFY(s) AV_TOSTRING(s)
22 #define AV_TOSTRING(s) #s 22 #define AV_TOSTRING(s) #s
23 23
24 #define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+2) 24 #define LIBAVCODEC_VERSION_INT ((49<<16)+(1<<8)+0)
25 #define LIBAVCODEC_VERSION 49.0.2 25 #define LIBAVCODEC_VERSION 49.1.0
26 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT 26 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
27 27
28 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) 28 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
29 29
30 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000) 30 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000)
669 FF_COMMON_FRAME 669 FF_COMMON_FRAME
670 } AVFrame; 670 } AVFrame;
671 671
672 #define DEFAULT_FRAME_RATE_BASE 1001000 672 #define DEFAULT_FRAME_RATE_BASE 1001000
673 673
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 } AVOption;
702
674 /** 703 /**
675 * Used by av_log 704 * Used by av_log
676 */ 705 */
677 typedef struct AVCLASS AVClass; 706 typedef struct AVCLASS AVClass;
678 struct AVCLASS { 707 struct AVCLASS {
679 const char* class_name; 708 const char* class_name;
680 const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext 709 const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
681 or AVFormatContext, which begin with an AVClass. 710 or AVFormatContext, which begin with an AVClass.
682 Needed because av_log is in libavcodec and has no visibility 711 Needed because av_log is in libavcodec and has no visibility
683 of AVIn/OutputFormat */ 712 of AVIn/OutputFormat */
713 AVOption *option;
684 }; 714 };
685 715
686 /** 716 /**
687 * main external api structure. 717 * main external api structure.
688 */ 718 */
1845 * - decoding: set by user. 1875 * - decoding: set by user.
1846 */ 1876 */
1847 enum AVDiscard skip_frame; 1877 enum AVDiscard skip_frame;
1848 } AVCodecContext; 1878 } AVCodecContext;
1849 1879
1850 1880 int av_set_string(void *obj, const char *name, const char *val);
1851 /** 1881 int av_set_double(void *obj, const char *name, double n);
1852 * AVOption. 1882 int av_set_q(void *obj, const char *name, AVRational n);
1853 */ 1883 int av_set_int(void *obj, const char *name, int64_t n);
1854 typedef struct AVOption { 1884 const char *av_get_string(void *obj, const char *name);
1855 /** options' name */ 1885 double av_get_double(void *obj, const char *name);
1856 const char *name; /* if name is NULL, it indicates a link to next */ 1886
1857 /** short English text help or const struct AVOption* subpointer */
1858 const char *help; // const struct AVOption* sub;
1859 /** offset to context structure where the parsed value should be stored */
1860 int offset;
1861 /** options' type */
1862 int type;
1863 #define FF_OPT_TYPE_BOOL 1 ///< boolean - true,1,on (or simply presence)
1864 #define FF_OPT_TYPE_DOUBLE 2 ///< double
1865 #define FF_OPT_TYPE_INT 3 ///< integer
1866 #define FF_OPT_TYPE_STRING 4 ///< string (finished with \0)
1867 #define FF_OPT_TYPE_MASK 0x1f ///< mask for types - upper bits are various flags
1868 //#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option
1869 #define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40)
1870 #define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80)
1871 /** min value (min == max -> no limits) */
1872 double min;
1873 /** maximum value for double/int */
1874 double max;
1875 /** default boo [0,1]l/double/int value */
1876 double defval;
1877 /**
1878 * default string value (with optional semicolon delimited extra option-list
1879 * i.e. option1;option2;option3
1880 * defval might select other then first argument as default
1881 */
1882 const char *defstr;
1883 #define FF_OPT_MAX_DEPTH 10
1884 } AVOption;
1885 1887
1886 /** 1888 /**
1887 * AVCodec. 1889 * AVCodec.
1888 */ 1890 */
1889 typedef struct AVCodec { 1891 typedef struct AVCodec {