From 4217e091fefe540a0aab767e4a0a2454808cb4aa Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Sat, 6 Mar 2021 22:53:21 +0100 Subject: [PATCH] avformat/librist: increase default loglevel Also remove AV_LOG_SIMULATE from the list as it is not used directly, and do not use panic level on unknown loglevel, but make them warn. Also fix mapping of NOTICE/INFO/VERBOSE and add documentation about when the option should actually be used. Signed-off-by: Marton Balint --- doc/protocols.texi | 4 +++- libavformat/librist.c | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index 11005b0849d..eaf7b526088 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -718,7 +718,9 @@ Set internal RIST buffer size for retransmission of data. Set maximum packet size for sending data. 1316 by default. @item log_level -Set loglevel for RIST logging messages. +Set loglevel for RIST logging messages. You only need to set this if you +explicitly want to enable debug level messages or packet loss simulation, +otherwise the regular loglevel is respected. @item secret Set override of encryption secret, by default is unset. diff --git a/libavformat/librist.c b/libavformat/librist.c index 2fb3162f86a..2296bfa0793 100644 --- a/libavformat/librist.c +++ b/libavformat/librist.c @@ -64,7 +64,7 @@ static const AVOption librist_options[] = { { "advanced", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_ADVANCED}, 0, 0, .flags = D|E, "profile" }, { "buffer_size", "set buffer_size", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, .flags = D|E }, { "pkt_size", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64=1316}, 1, MAX_PAYLOAD_SIZE, .flags = D|E }, - { "log_level", "set loglevel", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, .flags = D|E }, + { "log_level", "set loglevel", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64=RIST_LOG_INFO}, -1, INT_MAX, .flags = D|E }, { "secret", "set encryption secret",OFFSET(secret), AV_OPT_TYPE_STRING,{.str=NULL}, 0, 0, .flags = D|E }, { "encryption","set encryption type",OFFSET(encryption), AV_OPT_TYPE_INT ,{.i64=0}, 0, INT_MAX, .flags = D|E }, { NULL } @@ -87,12 +87,11 @@ static int log_cb(void *arg, enum rist_log_level log_level, const char *msg) switch (log_level) { case RIST_LOG_ERROR: level = AV_LOG_ERROR; break; case RIST_LOG_WARN: level = AV_LOG_WARNING; break; - case RIST_LOG_NOTICE: level = AV_LOG_VERBOSE; break; - case RIST_LOG_INFO: level = AV_LOG_INFO; break; + case RIST_LOG_NOTICE: level = AV_LOG_INFO; break; + case RIST_LOG_INFO: level = AV_LOG_VERBOSE; break; case RIST_LOG_DEBUG: level = AV_LOG_DEBUG; break; case RIST_LOG_DISABLE: level = AV_LOG_QUIET; break; - case RIST_LOG_SIMULATE: level = AV_LOG_TRACE; break; - default: level = AV_LOG_PANIC; + default: level = AV_LOG_WARNING; } av_log(arg, level, "%s", msg); -- 2.39.2