Skip to content

Commit dd33af2

Browse files
yawenyangfxVPLsdm
authored andcommittedJan 21, 2025
[Decode] Refine VPL log level control to support auto triage
1.refine log level control
1 parent 6a21db7 commit dd33af2

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed
 

‎_studio/mfx_lib/shared/src/mfx_common_int.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2009-2024 Intel Corporation
1+
// Copyright (c) 2009-2025 Intel Corporation
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -54,6 +54,8 @@ mfxExtBuffer* GetExtendedBufferInternal(mfxExtBuffer** extBuf, mfxU32 numExtBuf,
5454

5555
mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId)
5656
{
57+
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckFrameInfoCommon");
58+
5759
MFX_CHECK_NULL_PTR1(info);
5860

5961
MFX_CHECK(info->Width && info->Width % 16 == 0, MFX_ERR_INVALID_VIDEO_PARAM);
@@ -97,11 +99,15 @@ mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId)
9799
case MFX_FOURCC_IMC3:
98100
if (codecId != MFX_CODEC_JPEG)
99101
{
102+
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
100103
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
101104
}
102105
break;
103106
default:
107+
{
108+
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
104109
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
110+
}
105111
}
106112

107113
MFX_CHECK((!info->BitDepthLuma || (info->BitDepthLuma >= 8)) &&
@@ -122,7 +128,10 @@ mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId)
122128
break;
123129

124130
default:
131+
{
132+
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
125133
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
134+
}
126135
}
127136
}
128137

@@ -225,6 +234,8 @@ mfxStatus CheckFrameInfoDecVideoProcCsc(mfxFrameInfo *info, mfxU32 codecId)
225234

226235
mfxStatus CheckFrameInfoCodecs(mfxFrameInfo *info, mfxU32 codecId)
227236
{
237+
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckFrameInfoCodecs");
238+
228239
mfxStatus sts = CheckFrameInfoCommon(info, codecId);
229240
MFX_CHECK_STS(sts);
230241

@@ -419,6 +430,8 @@ mfxStatus UpdateCscOutputFormat(mfxVideoParam *par, mfxFrameAllocRequest *reques
419430

420431
static mfxStatus CheckVideoParamCommon(mfxVideoParam *in, eMFXHWType type)
421432
{
433+
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckVideoParamCommon");
434+
422435
MFX_CHECK_NULL_PTR1(in);
423436

424437
mfxStatus sts = CheckFrameInfoCodecs(&in->mfx.FrameInfo, in->mfx.CodecId);

‎_studio/shared/include/mfx_trace.h

-6
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,10 @@ typedef enum
205205
// enumeration of the TXT log levels
206206
typedef enum
207207
{
208-
#ifndef NDEBUG
209208
MFX_TXTLOG_LEVEL_MAX = 1, //include API Func, API PARAMS and internal Func
210209
MFX_TXTLOG_LEVEL_API_AND_INTERNAL = 2, //include API Func and internal Func
211210
MFX_TXTLOG_LEVEL_API_AND_PARAMS = 3, //include API Func and API PARAMS
212211
MFX_TXTLOG_LEVEL_API = 4, //include API Func
213-
#else
214-
MFX_TXTLOG_LEVEL_API_AND_PARAMS = 1, //include API Func, API PARAMS
215-
MFX_TXTLOG_LEVEL_API = 2, //include API Func
216-
MFX_TXTLOG_LEVEL_MAX = 3 //include API Func, API PARAMS and internal Func
217-
#endif
218212
} mfxTxtLogLevel;
219213

220214
typedef enum _MEDIA_EVENT_TYPE

‎_studio/shared/mfx_trace/src/mfx_trace.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ inline bool MFXTrace_IsPrintableCategoryAndLevel(mfxTraceU32 m_OutputInitilized,
332332
{
333333
logFlag = true;
334334
}
335-
#ifndef NDEBUG
336335
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_INTERNAL)
337336
{
338337
if (level != MFX_TRACE_LEVEL_API_PARAMS)
@@ -341,9 +340,6 @@ inline bool MFXTrace_IsPrintableCategoryAndLevel(mfxTraceU32 m_OutputInitilized,
341340
}
342341
}
343342
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_PARAMS)
344-
#else
345-
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_PARAMS)
346-
#endif
347343
{
348344
if (level == MFX_TRACE_LEVEL_API_PARAMS || level == MFX_TRACE_LEVEL_API)
349345
{

‎_studio/shared/src/libmfx_core_hw.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2007-2024 Intel Corporation
1+
// Copyright (c) 2007-2025 Intel Corporation
22
//
33
// Permission is hereby granted, free of charge, to any person obtaining a copy
44
// of this software and associated documentation files (the "Software"), to deal
@@ -31,6 +31,8 @@ using namespace UMC;
3131

3232
mfxU32 ChooseProfile(mfxVideoParam const* param, eMFXHWType)
3333
{
34+
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "ChooseProfile");
35+
3436
mfxU32 profile = UMC::VA_VLD;
3537

3638
// video accelerator is needed for decoders only

0 commit comments

Comments
 (0)