add -d 1 option: suppress audio-video packet data in debug output

This commit is contained in:
F. Duncanh
2025-02-20 02:15:14 -05:00
parent c864b46981
commit 890948bf3d
8 changed files with 39 additions and 16 deletions

View File

@@ -31,6 +31,7 @@ extern "C" {
#define LOGGER_NOTICE 5 /* normal but significant condition */
#define LOGGER_INFO 6 /* informational */
#define LOGGER_DEBUG 7 /* debug-level messages */
#define LOGGER_DEBUG_DATA 8 /* debug-level messages including audio/video packet data */
typedef void (*logger_callback_t)(void *cls, int level, const char *msg);

View File

@@ -421,6 +421,7 @@ raop_rtp_thread_udp(void *arg)
assert(raop_rtp);
bool logger_debug = (logger_get_level(raop_rtp->logger) >= LOGGER_DEBUG);
bool logger_debug_data = (logger_get_level(raop_rtp->logger) >= LOGGER_DEBUG_DATA);
raop_rtp->ntp_start_time = raop_ntp_get_local_time();
raop_rtp->rtp_clock_started = false;
@@ -636,7 +637,7 @@ raop_rtp_thread_udp(void *arg)
audio_data.ntp_time_remote = rtp_time_to_client_ntp(raop_rtp, rtp_timestamp);
audio_data.ntp_time_local = raop_ntp_convert_remote_time(raop_rtp->ntp, audio_data.ntp_time_remote);
if (logger_debug) {
if (logger_debug_data) {
uint64_t ntp_now = raop_ntp_get_local_time();
int64_t latency = (audio_data.ntp_time_local ? ((int64_t) ntp_now) - ((int64_t) audio_data.ntp_time_local) : 0);
logger_log(raop_rtp->logger, LOGGER_DEBUG,

View File

@@ -195,6 +195,7 @@ raop_rtp_mirror_thread(void *arg)
uint64_t ntp_timestamp_local = 0;
unsigned char nal_start_code[4] = { 0x00, 0x00, 0x00, 0x01 };
bool logger_debug = (logger_get_level(raop_rtp_mirror->logger) >= LOGGER_DEBUG);
bool logger_debug_data = (logger_get_level(raop_rtp_mirror->logger) >= LOGGER_DEBUG_DATA);
bool h265_video = false;
video_codec_t codec = VIDEO_CODEC_UNKNOWN;
const char h264[] = "h264";
@@ -396,7 +397,7 @@ raop_rtp_mirror_thread(void *arg)
// counting nano seconds since last boot.
ntp_timestamp_local = raop_ntp_convert_remote_time(raop_rtp_mirror->ntp, ntp_timestamp_remote);
if (logger_debug) {
if (logger_debug_data) {
uint64_t ntp_now = raop_ntp_get_local_time();
int64_t latency = (ntp_timestamp_local ? ((int64_t) ntp_now) - ((int64_t) ntp_timestamp_local) : 0);
logger_log(raop_rtp_mirror->logger, LOGGER_DEBUG,