log_level.dart 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2019 Taner Sener
  3. *
  4. * This file is part of FlutterFFmpeg.
  5. *
  6. * FlutterFFmpeg is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * FlutterFFmpeg 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
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with FlutterFFmpeg. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. class LogLevel {
  20. ///
  21. /// This log level is used to specify logs printed to stderr by ffmpeg.
  22. /// Logs that has this level are not filtered and always redirected.
  23. static const int AV_LOG_STDERR = -16;
  24. /// Print no output.
  25. static const int AV_LOG_QUIET = -8;
  26. /// Something went really wrong and we will crash now.
  27. static const int AV_LOG_PANIC = 0;
  28. /// Something went wrong and recovery is not possible.
  29. /// For example, no header was found for a format which depends
  30. /// on headers or an illegal combination of parameters is used.
  31. static const int AV_LOG_FATAL = 8;
  32. /// Something went wrong and cannot losslessly be recovered.
  33. /// However, not all future data is affected.
  34. static const int AV_LOG_ERROR = 16;
  35. /// Something somehow does not look correct. This may or may not
  36. /// lead to problems. An example would be the use of '-vstrict -2'.
  37. static const int AV_LOG_WARNING = 24;
  38. /// int Standard information.
  39. static const int AV_LOG_INFO = 32;
  40. /// Detailed information.
  41. static const int AV_LOG_VERBOSE = 40;
  42. /// Stuff which is only useful for libav* developers.
  43. static const int AV_LOG_DEBUG = 48;
  44. /// Extremely verbose debugging, useful for libav* development.
  45. static const int AV_LOG_TRACE = 56;
  46. /// Returns log level string from int
  47. static String levelToString(int level) {
  48. switch (level) {
  49. case LogLevel.AV_LOG_TRACE:
  50. return "TRACE";
  51. case LogLevel.AV_LOG_DEBUG:
  52. return "DEBUG";
  53. case LogLevel.AV_LOG_VERBOSE:
  54. return "VERBOSE";
  55. case LogLevel.AV_LOG_INFO:
  56. return "INFO";
  57. case LogLevel.AV_LOG_WARNING:
  58. return "WARNING";
  59. case LogLevel.AV_LOG_ERROR:
  60. return "ERROR";
  61. case LogLevel.AV_LOG_FATAL:
  62. return "FATAL";
  63. case LogLevel.AV_LOG_PANIC:
  64. return "PANIC";
  65. case LogLevel.AV_LOG_STDERR:
  66. return "STDERR";
  67. case LogLevel.AV_LOG_QUIET:
  68. default:
  69. return "";
  70. }
  71. }
  72. }