video_jbuff_log.c 734 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "video_jbuff_log.h"
  2. #include "video_jbuff_defines.h"
  3. #include "stdarg.h "
  4. static VideoJBufferLogCallBack g_log_func = {0};
  5. void ex_video_jitterbuffer_log(int level, const char* file, int line, const char *fmt, ...)
  6. {
  7. va_list vl;
  8. if (g_log_func.log_fn != NULL) {
  9. va_start(vl, fmt);
  10. g_log_func.log_fn(g_log_func.userdata, level, file, line, fmt, vl);
  11. va_end(vl);
  12. }
  13. }
  14. void video_jitterbuffer_setup_log(VideoJBufferLogCallBack *log_func)
  15. {
  16. if (log_func) {
  17. g_log_func.log_fn = log_func->log_fn;
  18. g_log_func.userdata = log_func->userdata;
  19. } else {
  20. g_log_func.log_fn = NULL;
  21. g_log_func.userdata = NULL;
  22. }
  23. }
  24. void video_jitterbuffer_unsetup_log()
  25. {
  26. g_log_func.log_fn = NULL;
  27. g_log_func.userdata = NULL;
  28. }