-// Convert libopenh264 log level to equivalent ffmpeg log level.
-static int libopenh264_to_ffmpeg_log_level(int libopenh264_log_level)
-{
- if (libopenh264_log_level >= WELS_LOG_DETAIL) return AV_LOG_TRACE;
- else if (libopenh264_log_level >= WELS_LOG_DEBUG) return AV_LOG_DEBUG;
- else if (libopenh264_log_level >= WELS_LOG_INFO) return AV_LOG_VERBOSE;
- else if (libopenh264_log_level >= WELS_LOG_WARNING) return AV_LOG_WARNING;
- else if (libopenh264_log_level >= WELS_LOG_ERROR) return AV_LOG_ERROR;
- else return AV_LOG_QUIET;
-}
-
-// This function will be provided to the libopenh264 library. The function will be called
-// when libopenh264 wants to log a message (error, warning, info, etc.). The signature for
-// this function (defined in .../codec/api/svc/codec_api.h) is:
-//
-// typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
-
-static void libopenh264_trace_callback(void *ctx, int level, const char *msg)
-{
- // The message will be logged only if the requested EQUIVALENT ffmpeg log level is
- // less than or equal to the current ffmpeg log level.
- int equiv_ffmpeg_log_level = libopenh264_to_ffmpeg_log_level(level);
- av_log(ctx, equiv_ffmpeg_log_level, "%s\n", msg);
-}
-