diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-10-27 19:40:52 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-11-02 23:02:42 -0400 |
commit | d162ecbaffe845c9707da5d2f6cab11f343ef00e (patch) | |
tree | 0f4312565334c3dc0f167c5648508c150d2c5dec /media/libcubeb/src/cubeb_log.h | |
parent | 21b3f6247403c06f85e1f45d219f87549862198f (diff) | |
download | UXP-d162ecbaffe845c9707da5d2f6cab11f343ef00e.tar UXP-d162ecbaffe845c9707da5d2f6cab11f343ef00e.tar.gz UXP-d162ecbaffe845c9707da5d2f6cab11f343ef00e.tar.lz UXP-d162ecbaffe845c9707da5d2f6cab11f343ef00e.tar.xz UXP-d162ecbaffe845c9707da5d2f6cab11f343ef00e.zip |
Issue #1267 - Part 1: Update libcubeb to a1200c34.
Diffstat (limited to 'media/libcubeb/src/cubeb_log.h')
-rw-r--r-- | media/libcubeb/src/cubeb_log.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/media/libcubeb/src/cubeb_log.h b/media/libcubeb/src/cubeb_log.h index bca98c96f..a79976bb3 100644 --- a/media/libcubeb/src/cubeb_log.h +++ b/media/libcubeb/src/cubeb_log.h @@ -8,6 +8,8 @@ #ifndef CUBEB_LOG #define CUBEB_LOG +#include "cubeb/cubeb.h" + #ifdef __cplusplus extern "C" { #endif @@ -18,8 +20,10 @@ extern "C" { #define PRINTF_FORMAT(fmt, args) #endif -extern cubeb_log_level g_log_level; -extern cubeb_log_callback g_log_callback PRINTF_FORMAT(1, 2); +extern cubeb_log_level g_cubeb_log_level; +extern cubeb_log_callback g_cubeb_log_callback PRINTF_FORMAT(1, 2); +void cubeb_async_log(const char * fmt, ...); +void cubeb_async_log_reset_threads(); #ifdef __cplusplus } @@ -29,9 +33,15 @@ extern cubeb_log_callback g_log_callback PRINTF_FORMAT(1, 2); #define LOG(msg, ...) LOG_INTERNAL(CUBEB_LOG_NORMAL, msg, ##__VA_ARGS__) #define LOG_INTERNAL(level, fmt, ...) do { \ - if (g_log_callback && level <= g_log_level) { \ - g_log_callback("%s:%d: " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ + if (g_cubeb_log_callback && level <= g_cubeb_log_level) { \ + g_cubeb_log_callback("%s:%d: " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ } \ } while(0) +/* Asynchronous verbose logging, to log in real-time callbacks. */ +#define ALOGV(fmt, ...) \ +do { \ + cubeb_async_log(fmt, ##__VA_ARGS__); \ +} while(0) + #endif // CUBEB_LOG |