Skip to content

Commit

Permalink
[Decode] Refine VPL log level control to support auto triage
Browse files Browse the repository at this point in the history
1.refine log level control
  • Loading branch information
yawenyan authored and gfxVPLsdm committed Jan 21, 2025
1 parent 6a21db7 commit dd33af2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
15 changes: 14 additions & 1 deletion _studio/mfx_lib/shared/src/mfx_common_int.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009-2024 Intel Corporation
// Copyright (c) 2009-2025 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -54,6 +54,8 @@ mfxExtBuffer* GetExtendedBufferInternal(mfxExtBuffer** extBuf, mfxU32 numExtBuf,

mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckFrameInfoCommon");

MFX_CHECK_NULL_PTR1(info);

MFX_CHECK(info->Width && info->Width % 16 == 0, MFX_ERR_INVALID_VIDEO_PARAM);
Expand Down Expand Up @@ -97,11 +99,15 @@ mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId)
case MFX_FOURCC_IMC3:
if (codecId != MFX_CODEC_JPEG)
{
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
}
break;
default:
{
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
}
}

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

default:
{
MFX_LTRACE_MSG(MFX_TRACE_LEVEL_CRITICAL_INFO, "MFX_ERR_INVALID_VIDEO_PARAM");
MFX_RETURN(MFX_ERR_INVALID_VIDEO_PARAM);
}
}
}

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

mfxStatus CheckFrameInfoCodecs(mfxFrameInfo *info, mfxU32 codecId)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckFrameInfoCodecs");

mfxStatus sts = CheckFrameInfoCommon(info, codecId);
MFX_CHECK_STS(sts);

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

static mfxStatus CheckVideoParamCommon(mfxVideoParam *in, eMFXHWType type)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "CheckVideoParamCommon");

MFX_CHECK_NULL_PTR1(in);

mfxStatus sts = CheckFrameInfoCodecs(&in->mfx.FrameInfo, in->mfx.CodecId);
Expand Down
6 changes: 0 additions & 6 deletions _studio/shared/include/mfx_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,10 @@ typedef enum
// enumeration of the TXT log levels
typedef enum
{
#ifndef NDEBUG
MFX_TXTLOG_LEVEL_MAX = 1, //include API Func, API PARAMS and internal Func
MFX_TXTLOG_LEVEL_API_AND_INTERNAL = 2, //include API Func and internal Func
MFX_TXTLOG_LEVEL_API_AND_PARAMS = 3, //include API Func and API PARAMS
MFX_TXTLOG_LEVEL_API = 4, //include API Func
#else
MFX_TXTLOG_LEVEL_API_AND_PARAMS = 1, //include API Func, API PARAMS
MFX_TXTLOG_LEVEL_API = 2, //include API Func
MFX_TXTLOG_LEVEL_MAX = 3 //include API Func, API PARAMS and internal Func
#endif
} mfxTxtLogLevel;

typedef enum _MEDIA_EVENT_TYPE
Expand Down
4 changes: 0 additions & 4 deletions _studio/shared/mfx_trace/src/mfx_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ inline bool MFXTrace_IsPrintableCategoryAndLevel(mfxTraceU32 m_OutputInitilized,
{
logFlag = true;
}
#ifndef NDEBUG
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_INTERNAL)
{
if (level != MFX_TRACE_LEVEL_API_PARAMS)
Expand All @@ -341,9 +340,6 @@ inline bool MFXTrace_IsPrintableCategoryAndLevel(mfxTraceU32 m_OutputInitilized,
}
}
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_PARAMS)
#else
else if (g_Level == MFX_TXTLOG_LEVEL_API_AND_PARAMS)
#endif
{
if (level == MFX_TRACE_LEVEL_API_PARAMS || level == MFX_TRACE_LEVEL_API)
{
Expand Down
4 changes: 3 additions & 1 deletion _studio/shared/src/libmfx_core_hw.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2024 Intel Corporation
// Copyright (c) 2007-2025 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -31,6 +31,8 @@ using namespace UMC;

mfxU32 ChooseProfile(mfxVideoParam const* param, eMFXHWType)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_INTERNAL, "ChooseProfile");

mfxU32 profile = UMC::VA_VLD;

// video accelerator is needed for decoders only
Expand Down

0 comments on commit dd33af2

Please sign in to comment.