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.

103 lines
2.9KB

  1. /*
  2. * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef LOG_H
  21. #define LOG_H
  22. #include <stdarg.h>
  23. /**
  24. * Used by av_log
  25. */
  26. typedef struct AVCLASS AVClass;
  27. struct AVCLASS {
  28. const char* class_name;
  29. const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
  30. or AVFormatContext, which begin with an AVClass.
  31. Needed because av_log is in libavcodec and has no visibility
  32. of AVIn/OutputFormat */
  33. const struct AVOption *option;
  34. };
  35. /* av_log API */
  36. #if LIBAVUTIL_VERSION_INT < (50<<16)
  37. #define AV_LOG_QUIET -1
  38. #define AV_LOG_FATAL 0
  39. #define AV_LOG_ERROR 0
  40. #define AV_LOG_WARNING 1
  41. #define AV_LOG_INFO 1
  42. #define AV_LOG_VERBOSE 1
  43. #define AV_LOG_DEBUG 2
  44. #else
  45. #define AV_LOG_QUIET -8
  46. /**
  47. * something went really wrong and we will crash now
  48. */
  49. #define AV_LOG_PANIC 0
  50. /**
  51. * something went wrong and recovery is not possible
  52. * like no header in a format which depends on it or a combination
  53. * of parameters which are not allowed
  54. */
  55. #define AV_LOG_FATAL 8
  56. /**
  57. * something went wrong and cannot losslessly be recovered
  58. * but not all future data is affected
  59. */
  60. #define AV_LOG_ERROR 16
  61. /**
  62. * something somehow does not look correct / something which may or may not
  63. * lead to some problems like use of -vstrict -2
  64. */
  65. #define AV_LOG_WARNING 24
  66. #define AV_LOG_INFO 32
  67. #define AV_LOG_VERBOSE 40
  68. /**
  69. * stuff which is only useful for libav* developers
  70. */
  71. #define AV_LOG_DEBUG 48
  72. #endif
  73. extern int av_log_level;
  74. #ifdef __GNUC__
  75. extern void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
  76. #else
  77. extern void av_log(void*, int level, const char *fmt, ...);
  78. #endif
  79. #if LIBAVUTIL_VERSION_INT < (50<<16)
  80. extern void av_vlog(void*, int level, const char *fmt, va_list);
  81. extern int av_log_get_level(void);
  82. extern void av_log_set_level(int);
  83. extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
  84. extern void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
  85. #else
  86. extern void (*av_vlog)(void*, int, const char*, va_list);
  87. #endif
  88. #endif /* LOG_H */