Merge pull request #242 from mstorsjo/simplify-debug-file-locations
Simplify debugging code by always writing trace files to the current directory
This commit is contained in:
commit
5616ddb3a5
@ -53,8 +53,8 @@ void_t* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) {
|
|||||||
|
|
||||||
#ifdef MEMORY_CHECK
|
#ifdef MEMORY_CHECK
|
||||||
if (pMemCheckMalloc == NULL) {
|
if (pMemCheckMalloc == NULL) {
|
||||||
pMemCheckMalloc = WelsFopen (".\\mem_check_malloc.txt", "at+");
|
pMemCheckMalloc = WelsFopen ("mem_check_malloc.txt", "at+");
|
||||||
pMemCheckFree = WelsFopen (".\\mem_check_free.txt", "at+");
|
pMemCheckFree = WelsFopen ("mem_check_free.txt", "at+");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kpTag != NULL) {
|
if (kpTag != NULL) {
|
||||||
|
@ -113,10 +113,6 @@ typedef struct TagWelsSvcCodingParam {
|
|||||||
SDLayerParam sDependencyLayers[MAX_DEPENDENCY_LAYER];
|
SDLayerParam sDependencyLayers[MAX_DEPENDENCY_LAYER];
|
||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
#ifdef ENABLE_TRACE_FILE
|
|
||||||
str_t sTracePath[MAX_FNAME_LEN]; // log file for wels encoder
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint32_t uiGopSize; // GOP size (at maximal frame rate: 16)
|
uint32_t uiGopSize; // GOP size (at maximal frame rate: 16)
|
||||||
uint32_t uiIntraPeriod; // intra period (multiple of GOP size as desired)
|
uint32_t uiIntraPeriod; // intra period (multiple of GOP size as desired)
|
||||||
int32_t iNumRefFrame; // number of reference frame used
|
int32_t iNumRefFrame; // number of reference frame used
|
||||||
|
@ -2085,8 +2085,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar
|
|||||||
if (wlog == WelsLogDefault) {
|
if (wlog == WelsLogDefault) {
|
||||||
str_t fname[MAX_FNAME_LEN] = {0};
|
str_t fname[MAX_FNAME_LEN] = {0};
|
||||||
|
|
||||||
WelsSnprintf (fname, MAX_FNAME_LEN, "%swels_svc_encoder_trace.txt",
|
WelsSnprintf (fname, MAX_FNAME_LEN, "wels_svc_encoder_trace.txt");
|
||||||
pCodingParam->sTracePath); // confirmed_safe_unsafe_usage
|
|
||||||
|
|
||||||
|
|
||||||
pCtx->pFileLog = WelsFopen (fname, "wt+");
|
pCtx->pFileLog = WelsFopen (fname, "wt+");
|
||||||
|
@ -428,11 +428,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara
|
|||||||
fclose (pSmt->pFSliceDiff);
|
fclose (pSmt->pFSliceDiff);
|
||||||
pSmt->pFSliceDiff = NULL;
|
pSmt->pFSliceDiff = NULL;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
pSmt->pFSliceDiff = fopen ("slice_time.txt", "wt+");
|
||||||
pSmt->pFSliceDiff = fopen (".\\slice_time.txt", "wt+");
|
|
||||||
#else
|
|
||||||
pSmt->pFSliceDiff = fopen ("/tmp/slice_time.txt", "wt+");
|
|
||||||
#endif//_WIN32
|
|
||||||
#endif//MT_DEBUG
|
#endif//MT_DEBUG
|
||||||
|
|
||||||
#if defined(ENABLE_TRACE_MT)
|
#if defined(ENABLE_TRACE_MT)
|
||||||
|
@ -264,7 +264,6 @@ void WelsReopenTraceFile (void* pCtx, str_t* pCurPath) {
|
|||||||
#ifdef ENABLE_TRACE_FILE
|
#ifdef ENABLE_TRACE_FILE
|
||||||
sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx;
|
sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx;
|
||||||
if (wlog == WelsLogDefault) {
|
if (wlog == WelsLogDefault) {
|
||||||
str_t strTraceFile[MAX_FNAME_LEN] = {0};
|
|
||||||
int32_t len = 0;
|
int32_t len = 0;
|
||||||
if (pEncCtx->pFileLog != NULL) {
|
if (pEncCtx->pFileLog != NULL) {
|
||||||
WelsFclose (pEncCtx->pFileLog);
|
WelsFclose (pEncCtx->pFileLog);
|
||||||
@ -274,14 +273,7 @@ void WelsReopenTraceFile (void* pCtx, str_t* pCurPath) {
|
|||||||
len = STRNLEN (pCurPath, MAX_FNAME_LEN - 1); // confirmed_safe_unsafe_usage
|
len = STRNLEN (pCurPath, MAX_FNAME_LEN - 1); // confirmed_safe_unsafe_usage
|
||||||
if (len >= MAX_FNAME_LEN)
|
if (len >= MAX_FNAME_LEN)
|
||||||
return;
|
return;
|
||||||
STRNCPY (strTraceFile, MAX_FNAME_LEN, pCurPath, len); // confirmed_safe_unsafe_usage
|
pEncCtx->pFileLog = WelsFopen ("wels_encoder_trace.txt", "wt+"); // confirmed_safe_unsafe_usage
|
||||||
#ifdef __GNUC__
|
|
||||||
STRCAT (strTraceFile, MAX_FNAME_LEN - len, "/wels_encoder_trace.txt"); // confirmed_safe_unsafe_usage
|
|
||||||
#elif _WIN32
|
|
||||||
STRCAT (strTraceFile, MAX_FNAME_LEN - len, "\\wels_encoder_trace.txt"); // confirmed_safe_unsafe_usage
|
|
||||||
#else
|
|
||||||
#endif//__GNUC__
|
|
||||||
pEncCtx->pFileLog = WelsFopen (strTraceFile, "wt+"); // confirmed_safe_unsafe_usage
|
|
||||||
}
|
}
|
||||||
#endif//ENABLE_TRACE_FILE
|
#endif//ENABLE_TRACE_FILE
|
||||||
}
|
}
|
||||||
|
@ -407,20 +407,6 @@ int CWelsH264SVCEncoder::Initialize2 (void* argv, const INIT_TYPE iInitType) {
|
|||||||
InitPic (m_pSrcPicList[i], iColorspace, m_iMaxPicWidth, m_iMaxPicHeight);
|
InitPic (m_pSrcPicList[i], iColorspace, m_iMaxPicWidth, m_iMaxPicHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OUTPUT_BIT_STREAM) || defined(ENABLE_TRACE_FILE)
|
|
||||||
str_t fpath[MAX_FNAME_LEN] = {0};
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
WelsSnprintf (fpath, MAX_FNAME_LEN, "/tmp/"); // confirmed_safe_unsafe_usage
|
|
||||||
|
|
||||||
#else//__GNUC__
|
|
||||||
|
|
||||||
WelsSnprintf (fpath, MAX_FNAME_LEN, ".\\"); // confirmed_safe_unsafe_usage
|
|
||||||
#endif //__GNUC__
|
|
||||||
|
|
||||||
strcpy (pCfg->sTracePath, fpath); // confirmed_safe_unsafe_usage
|
|
||||||
|
|
||||||
#endif //#if defined(OUTPUT_BIT_STREAM) || defined(ENABLE_TRACE_FILE)
|
|
||||||
|
|
||||||
if (WelsInitEncoderExt (&m_pEncContext, pCfg)) {
|
if (WelsInitEncoderExt (&m_pEncContext, pCfg)) {
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n");
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n");
|
||||||
Uninitialize();
|
Uninitialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user