@@ -42,7 +42,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
|
#define MAX_LOG_SIZE 1024
|
||||||
/*
|
/*
|
||||||
* Function pointer declaration for various tool sets
|
* Function pointer declaration for various tool sets
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +56,8 @@ typedef struct TagLogContext {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...) __attribute__ ((__format__ (__printf__, 3,
|
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...) __attribute__ ((__format__ (__printf__,
|
||||||
|
3,
|
||||||
4)));
|
4)));
|
||||||
#else
|
#else
|
||||||
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...);
|
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
|
#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
|
||||||
|
#include "codec_app_def.h"
|
||||||
float WelsCalcPsnr (const void* kpTarPic,
|
float WelsCalcPsnr (const void* kpTarPic,
|
||||||
const int32_t kiTarStride,
|
const int32_t kiTarStride,
|
||||||
const void* kpRefPic,
|
const void* kpRefPic,
|
||||||
@@ -50,8 +50,27 @@ float WelsCalcPsnr (const void* kpTarPic,
|
|||||||
|
|
||||||
void WelsLog (SLogContext* logCtx, int32_t iLevel, const char* kpFmt, ...) {
|
void WelsLog (SLogContext* logCtx, int32_t iLevel, const char* kpFmt, ...) {
|
||||||
va_list vl;
|
va_list vl;
|
||||||
|
char pTraceTag[MAX_LOG_SIZE];
|
||||||
|
switch (iLevel) {
|
||||||
|
case WELS_LOG_ERROR:
|
||||||
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Error:");
|
||||||
|
break;
|
||||||
|
case WELS_LOG_WARNING:
|
||||||
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Warning:");
|
||||||
|
break;
|
||||||
|
case WELS_LOG_INFO:
|
||||||
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Info:");
|
||||||
|
break;
|
||||||
|
case WELS_LOG_DEBUG:
|
||||||
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Debug:");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Detail:");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
WelsStrcat(pTraceTag,MAX_LOG_SIZE,kpFmt);
|
||||||
va_start (vl, kpFmt);
|
va_start (vl, kpFmt);
|
||||||
logCtx->pfLog (logCtx->pLogCtx, iLevel, kpFmt, vl);
|
logCtx->pfLog (logCtx->pLogCtx, iLevel, pTraceTag, vl);
|
||||||
va_end (vl);
|
va_end (vl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ welsCodecTrace::~welsCodecTrace() {
|
|||||||
m_fpTrace = NULL;
|
m_fpTrace = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_LOG_SIZE 1024
|
|
||||||
|
|
||||||
void welsCodecTrace::StaticCodecTrace (void* pCtx, const int32_t iLevel, const char* Str_Format, va_list vl) {
|
void welsCodecTrace::StaticCodecTrace (void* pCtx, const int32_t iLevel, const char* Str_Format, va_list vl) {
|
||||||
welsCodecTrace* self = (welsCodecTrace*) pCtx;
|
welsCodecTrace* self = (welsCodecTrace*) pCtx;
|
||||||
|
|||||||
Reference in New Issue
Block a user