mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 20:40:27 +00:00
debug-dump: print usage with "help"
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user