debug-dump: print usage with "help"

This commit is contained in:
Martin Pulec
2023-10-04 12:15:00 +02:00
parent b62566ca72
commit 16fa09eebc
2 changed files with 13 additions and 5 deletions

View File

@@ -299,6 +299,12 @@ bool parse_log_cfg(const char *conf_str,
}
#ifdef DEBUG
#define DUMP_FILE_USAGE \
"* debug-dump=<module>[=<n>][,<module2>[=<n>]\n" \
" Dumps specified buffer to a file for debugging, n-th buffer may " \
"be selected, name is <module>.dump.\n" \
" Avaiable modules: lavc-avframe, lavd-avframe\n"
ADD_TO_PARAM("debug-dump", DUMP_FILE_USAGE);
void debug_file_dump(const char *key, void (*serialize)(const void *data, FILE *), void *data) {
const char *dump_file_val = get_commandline_param("debug-dump");
static thread_local unordered_map<string, int> skip_map;
@@ -306,6 +312,13 @@ void debug_file_dump(const char *key, void (*serialize)(const void *data, FILE *
return;
}
if (strcmp(dump_file_val, "help") == 0) {
color_printf("\n" TBOLD("debug-dump") " usage:\n");
printf("%s\n", DUMP_FILE_USAGE);
exit_uv(0);
return;
}
// check if key is contained
string not_first = string(",") + key;
int skip_n = 0;

View File

@@ -1076,11 +1076,6 @@ ADD_TO_PARAM("audio-disable-adaptive-buffer", "* audio-disable-adaptive-buffer\n
" Disables audio adaptive playback buffer (CoreAudio/JACK)\n");
ADD_TO_PARAM("color", "* color=CT\n"
" [experimental] Color space to use, C - colorimetry: 0 - undefined, 1 - BT.709, 2 - BT.2020/2100, 3 - P3; T - transfer fn: 0 - undefined, 1 - 709, 2 - HLG; 3 - PQ (signalized to GLFW on mac, NDI receiver)\n");
#ifdef DEBUG
ADD_TO_PARAM("debug-dump", "* debug-dump=<module>[=<n>][,<module2>[=<n>]\n"
" Dumps specified buffer for debugging, n-th buffer may be selected, name is <module>.dump.\n"
" Avaiable modules: lavd-uncompressed\n");
#endif
ADD_TO_PARAM("incompatible", "* incompatible\n"
" Features that may possibly not be compatible with at least older or even any other UG version.\n");
ADD_TO_PARAM("low-latency-audio", "* low-latency-audio[=ultra]\n"