You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8KB

  1. #ifndef AVOPT_H
  2. #define AVOPT_H
  3. /**
  4. * @file opt.h
  5. * AVOptions
  6. */
  7. enum AVOptionType{
  8. FF_OPT_TYPE_FLAGS,
  9. FF_OPT_TYPE_INT,
  10. FF_OPT_TYPE_INT64,
  11. FF_OPT_TYPE_DOUBLE,
  12. FF_OPT_TYPE_FLOAT,
  13. FF_OPT_TYPE_STRING,
  14. FF_OPT_TYPE_RATIONAL,
  15. FF_OPT_TYPE_CONST=128,
  16. };
  17. /**
  18. * AVOption.
  19. */
  20. typedef struct AVOption {
  21. const char *name;
  22. /**
  23. * short English text help.
  24. * @fixme what about other languages
  25. */
  26. const char *help;
  27. int offset; ///< offset to context structure where the parsed value should be stored
  28. enum AVOptionType type;
  29. double default_val;
  30. double min;
  31. double max;
  32. int flags;
  33. #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
  34. #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
  35. #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
  36. #define AV_OPT_FLAG_AUDIO_PARAM 8
  37. #define AV_OPT_FLAG_VIDEO_PARAM 16
  38. #define AV_OPT_FLAG_SUBTITLE_PARAM 32
  39. //FIXME think about enc-audio, ... style flags
  40. const char *unit;
  41. } AVOption;
  42. AVOption *av_set_string(void *obj, const char *name, const char *val);
  43. AVOption *av_set_double(void *obj, const char *name, double n);
  44. AVOption *av_set_q(void *obj, const char *name, AVRational n);
  45. AVOption *av_set_int(void *obj, const char *name, int64_t n);
  46. double av_get_double(void *obj, const char *name, AVOption **o_out);
  47. AVRational av_get_q(void *obj, const char *name, AVOption **o_out);
  48. int64_t av_get_int(void *obj, const char *name, AVOption **o_out);
  49. const char *av_get_string(void *obj, const char *name, AVOption **o_out, char *buf, int buf_len);
  50. AVOption *av_next_option(void *obj, AVOption *last);
  51. int av_opt_show(void *obj, void *av_log_obj);
  52. #endif