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.

82 lines
2.7KB

  1. /*
  2. * AVOptions
  3. * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef AVOPT_H
  20. #define AVOPT_H
  21. /**
  22. * @file opt.h
  23. * AVOptions
  24. */
  25. enum AVOptionType{
  26. FF_OPT_TYPE_FLAGS,
  27. FF_OPT_TYPE_INT,
  28. FF_OPT_TYPE_INT64,
  29. FF_OPT_TYPE_DOUBLE,
  30. FF_OPT_TYPE_FLOAT,
  31. FF_OPT_TYPE_STRING,
  32. FF_OPT_TYPE_RATIONAL,
  33. FF_OPT_TYPE_CONST=128,
  34. };
  35. /**
  36. * AVOption.
  37. */
  38. typedef struct AVOption {
  39. const char *name;
  40. /**
  41. * short English text help.
  42. * @fixme what about other languages
  43. */
  44. const char *help;
  45. int offset; ///< offset to context structure where the parsed value should be stored
  46. enum AVOptionType type;
  47. double default_val;
  48. double min;
  49. double max;
  50. int flags;
  51. #define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
  52. #define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
  53. #define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
  54. #define AV_OPT_FLAG_AUDIO_PARAM 8
  55. #define AV_OPT_FLAG_VIDEO_PARAM 16
  56. #define AV_OPT_FLAG_SUBTITLE_PARAM 32
  57. //FIXME think about enc-audio, ... style flags
  58. const char *unit;
  59. } AVOption;
  60. AVOption *av_set_string(void *obj, const char *name, const char *val);
  61. AVOption *av_set_double(void *obj, const char *name, double n);
  62. AVOption *av_set_q(void *obj, const char *name, AVRational n);
  63. AVOption *av_set_int(void *obj, const char *name, int64_t n);
  64. double av_get_double(void *obj, const char *name, AVOption **o_out);
  65. AVRational av_get_q(void *obj, const char *name, AVOption **o_out);
  66. int64_t av_get_int(void *obj, const char *name, AVOption **o_out);
  67. const char *av_get_string(void *obj, const char *name, AVOption **o_out, char *buf, int buf_len);
  68. AVOption *av_next_option(void *obj, AVOption *last);
  69. int av_opt_show(void *obj, void *av_log_obj);
  70. void av_opt_set_defaults(void *s);
  71. #endif