From 00abbbb05920f2bfa48d98ca4b8a0fb2a94ff050 Mon Sep 17 00:00:00 2001 From: Ukn Unknown <4031821+uknunknown@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:20:44 -0700 Subject: [PATCH] move vainfo logs to transcoding category logs - move vainfo logs to transcoding category logs --- src/transcoding/codec/vainfo.c | 60 +++++++++++++++++----------------- src/tvhlog.c | 2 +- src/tvhlog.h | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/transcoding/codec/vainfo.c b/src/transcoding/codec/vainfo.c index cca42a13b..f99435133 100644 --- a/src/transcoding/codec/vainfo.c +++ b/src/transcoding/codec/vainfo.c @@ -145,7 +145,7 @@ get_config_attributes(VADisplay va_dpy, VAProfile profile, VAEntrypoint entrypoi if (attrib_list[VAConfigAttribEncMaxRefFrames].value & (~VA_ATTRIB_NOT_SUPPORTED)) { if (show_log) { - tvhinfo(LS_VAINFO, " %-35s: l0=%d, l1=%d", vaConfigAttribTypeStr(attrib_list[VAConfigAttribEncMaxRefFrames].type), + tvhinfo_transcode(LST_VAINFO, " %-35s: l0=%d, l1=%d", vaConfigAttribTypeStr(attrib_list[VAConfigAttribEncMaxRefFrames].type), attrib_list[VAConfigAttribEncMaxRefFrames].value & 0xffff, (attrib_list[VAConfigAttribEncMaxRefFrames].value >> 16) & 0xffff); } @@ -155,7 +155,7 @@ get_config_attributes(VADisplay va_dpy, VAProfile profile, VAEntrypoint entrypoi temp++; // limit to max space available in ui if (temp > MAX_B_FRAMES) { - tvherror(LS_VAINFO, "show_config_attributes() failed to set max B frames (vainfo:%d --> max=%d)", temp, MAX_B_FRAMES); + tvherror_transcode(LST_VAINFO, "show_config_attributes() failed to set max B frames (vainfo:%d --> max=%d)", temp, MAX_B_FRAMES); temp = MAX_B_FRAMES; } switch (codec) { @@ -184,20 +184,20 @@ get_config_attributes(VADisplay va_dpy, VAProfile profile, VAEntrypoint entrypoi encoder_vp9lp_maxBfreames = temp; break; default: - tvherror(LS_VAINFO, "codec not available: codec=%d", codec); + tvherror_transcode(LST_VAINFO, "codec not available: codec=%d", codec); break; } } if (attrib_list[VAConfigAttribEncQualityRange].value != VA_ATTRIB_NOT_SUPPORTED) { if (show_log) { - tvhinfo(LS_VAINFO, " %-35s: number of supported quality levels is %d", vaConfigAttribTypeStr(attrib_list[VAConfigAttribEncQualityRange].type), + tvhinfo_transcode(LST_VAINFO, " %-35s: number of supported quality levels is %d", vaConfigAttribTypeStr(attrib_list[VAConfigAttribEncQualityRange].type), attrib_list[VAConfigAttribEncQualityRange].value <= 1 ? 1 : attrib_list[VAConfigAttribEncQualityRange].value); } temp = attrib_list[VAConfigAttribEncQualityRange].value <= 1 ? 1 : attrib_list[VAConfigAttribEncQualityRange].value; // limit to max space available in ui if (temp > MAX_QUALITY) { - tvherror(LS_VAINFO, "show_config_attributes() failed to set max quality (vainfo:%d --> max=%d)", temp, MAX_QUALITY); + tvherror_transcode(LST_VAINFO, "show_config_attributes() failed to set max quality (vainfo:%d --> max=%d)", temp, MAX_QUALITY); temp = MAX_QUALITY; } switch (codec) { @@ -226,7 +226,7 @@ get_config_attributes(VADisplay va_dpy, VAProfile profile, VAEntrypoint entrypoi encoder_vp9lp_maxQuality = temp; break; default: - tvherror(LS_VAINFO, "codec not available: codec=%d", codec); + tvherror_transcode(LST_VAINFO, "codec not available: codec=%d", codec); break; } } @@ -247,28 +247,28 @@ int init(int show_log) va_dpy = va_open_display_drm(); if (NULL == va_dpy) { - tvherror(LS_VAINFO, "vaGetDisplay() failed"); + tvherror_transcode(LST_VAINFO, "vaGetDisplay() failed"); ret_val = 2; \ goto error_open_display; } va_status = vaInitialize(va_dpy, &major_version, &minor_version); if (va_status != VA_STATUS_SUCCESS) { - tvherror(LS_VAINFO, "vaInitialize failed with error code %d (%s)", va_status, vaErrorStr(va_status)); + tvherror_transcode(LST_VAINFO, "vaInitialize failed with error code %d (%s)", va_status, vaErrorStr(va_status)); ret_val = 3; goto error_Initialize; } if (show_log) - tvhinfo(LS_VAINFO, "VA-API version: %d.%d", major_version, minor_version); + tvhinfo_transcode(LST_VAINFO, "VA-API version: %d.%d", major_version, minor_version); driver = vaQueryVendorString(va_dpy); if (show_log) - tvhinfo(LS_VAINFO, "Driver version: %s", driver ? driver : ""); + tvhinfo_transcode(LST_VAINFO, "Driver version: %s", driver ? driver : ""); num_entrypoint = vaMaxNumEntrypoints(va_dpy); entrypoints = malloc(num_entrypoint * sizeof(VAEntrypoint)); if (!entrypoints) { - tvherror(LS_VAINFO, "Failed to allocate memory for entrypoint list"); + tvherror_transcode(LST_VAINFO, "Failed to allocate memory for entrypoint list"); ret_val = -1; goto error_entrypoints; } @@ -277,14 +277,14 @@ int init(int show_log) profile_list = malloc(max_num_profiles * sizeof(VAProfile)); if (!profile_list) { - tvherror(LS_VAINFO, "Failed to allocate memory for profile list"); + tvherror_transcode(LST_VAINFO, "Failed to allocate memory for profile list"); ret_val = 5; goto error_profile_list; } va_status = vaQueryConfigProfiles(va_dpy, profile_list, &num_profiles); if (va_status != VA_STATUS_SUCCESS) { - tvherror(LS_VAINFO, "vaQueryConfigProfiles failed with error code %d (%s)", va_status, vaErrorStr(va_status)); + tvherror_transcode(LST_VAINFO, "vaQueryConfigProfiles failed with error code %d (%s)", va_status, vaErrorStr(va_status)); ret_val = 6; goto error_QueryConfigProfiles; } @@ -297,14 +297,14 @@ int init(int show_log) continue; if (va_status != VA_STATUS_SUCCESS) { - tvherror(LS_VAINFO, "vaQueryConfigEntrypoints failed with error code %d (%s)", va_status, vaErrorStr(va_status)); + tvherror_transcode(LST_VAINFO, "vaQueryConfigEntrypoints failed with error code %d (%s)", va_status, vaErrorStr(va_status)); ret_val = 4; goto error_QueryConfigProfiles; } for (entrypoint = 0; entrypoint < num_entrypoint; entrypoint++) { if (show_log) - tvhinfo(LS_VAINFO, " %-32s: %s", vaProfileStr(profile), vaEntrypointStr(entrypoints[entrypoint])); + tvhinfo_transcode(LST_VAINFO, " %-32s: %s", vaProfileStr(profile), vaEntrypointStr(entrypoints[entrypoint])); // h264 if (profile == VAProfileH264High || profile == VAProfileH264ConstrainedBaseline || profile == VAProfileH264Main) { if (entrypoints[entrypoint] == VAEntrypointEncSlice) { @@ -312,7 +312,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_H264); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } if (entrypoints[entrypoint] == VAEntrypointEncSliceLP) { @@ -320,7 +320,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_H264_LOW_POWER); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } } @@ -331,7 +331,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_HEVC); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } if (entrypoints[entrypoint] == VAEntrypointEncSliceLP) { @@ -339,7 +339,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_HEVC_LOW_POWER); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } } @@ -350,7 +350,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_VP8); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } if (entrypoints[entrypoint] == VAEntrypointEncSliceLP) { @@ -358,7 +358,7 @@ int init(int show_log) // extract attributes ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_VP8_LOW_POWER); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } } @@ -368,14 +368,14 @@ int init(int show_log) encoder_vp9_isavailable = 1; ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_VP9); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } if (entrypoints[entrypoint] == VAEntrypointEncSliceLP) { encoder_vp9lp_isavailable = 1; ret_val = get_config_attributes(va_dpy, profile_list[i], entrypoints[entrypoint], show_log, VAINFO_VP9_LOW_POWER); if (ret_val) { - tvherror(LS_VAINFO, "Failed to get config attributes (error %d)", ret_val); + tvherror_transcode(LST_VAINFO, "Failed to get config attributes (error %d)", ret_val); } } } @@ -426,7 +426,7 @@ int vainfo_init(int show_log) #if ENABLE_VAAPI int ret = init(show_log); if (ret) { - tvherror(LS_VAINFO, "vainfo_init() error: %d", ret); + tvherror_transcode(LST_VAINFO, "vainfo_init() error: %d", ret); return ret; } #endif @@ -449,7 +449,7 @@ int vainfo_encoder_isavailable(int codec) #if ENABLE_VAAPI if (vainfo_probe_enabled) { if (!init_done) - tvherror(LS_VAINFO, "vainfo_init() was not run or generated errors"); + tvherror_transcode(LST_VAINFO, "vainfo_init() was not run or generated errors"); switch (codec) { case VAINFO_H264: return encoder_h264_isavailable; @@ -468,7 +468,7 @@ int vainfo_encoder_isavailable(int codec) case VAINFO_VP9_LOW_POWER: return encoder_vp9lp_isavailable; default: - tvherror(LS_VAINFO, "codec not available: codec=%d", codec); + tvherror_transcode(LST_VAINFO, "codec not available: codec=%d", codec); return CODEC_IS_NOT_AVAILABLE; } } @@ -492,7 +492,7 @@ int vainfo_encoder_maxBfreames(int codec) #if ENABLE_VAAPI if (vainfo_probe_enabled) { if (!init_done) - tvherror(LS_VAINFO, "vainfo_init() was not run or generated errors"); + tvherror_transcode(LST_VAINFO, "vainfo_init() was not run or generated errors"); switch (codec) { case VAINFO_H264: return encoder_h264_maxBfreames; @@ -511,7 +511,7 @@ int vainfo_encoder_maxBfreames(int codec) case VAINFO_VP9_LOW_POWER: return encoder_vp9lp_maxBfreames; default: - tvherror(LS_VAINFO, "codec not available: codec=%d", codec); + tvherror_transcode(LST_VAINFO, "codec not available: codec=%d", codec); return MIN_B_FRAMES; } } @@ -535,7 +535,7 @@ int vainfo_encoder_maxQuality(int codec) #if ENABLE_VAAPI if (vainfo_probe_enabled) { if (!init_done) - tvherror(LS_VAINFO, "vainfo_init() was not run or generated errors"); + tvherror_transcode(LST_VAINFO, "vainfo_init() was not run or generated errors"); switch (codec) { case VAINFO_H264: return encoder_h264_maxQuality; @@ -554,7 +554,7 @@ int vainfo_encoder_maxQuality(int codec) case VAINFO_VP9_LOW_POWER: return encoder_vp9lp_maxQuality; default: - tvherror(LS_VAINFO, "codec not available: codec=%d", codec); + tvherror_transcode(LST_VAINFO, "codec not available: codec=%d", codec); return MIN_QUALITY; } } diff --git a/src/tvhlog.c b/src/tvhlog.c index 303b70f89..6d1050105 100644 --- a/src/tvhlog.c +++ b/src/tvhlog.c @@ -179,7 +179,6 @@ tvhlog_subsys_t tvhlog_subsystems[] = { [LS_TSFILE] = { "tsfile", N_("MPEG-TS File") }, [LS_TSDEBUG] = { "tsdebug", N_("MPEG-TS Input Debug") }, [LS_CODEC] = { "codec", N_("Codec") }, - [LS_VAINFO] = { "vainfo", N_("VAINFO") }, #if ENABLE_DDCI [LS_DDCI] = { "ddci", N_("DD-CI") }, #endif @@ -212,6 +211,7 @@ tvhlog_subsys_t tvhlog_transcode_subsystems[] = { [LST_NVENC] = { "nvenc", N_("NVENC") }, [LST_OMX] = { "omx", N_("OMX") }, [LST_VAAPI] = { "vaapi", N_("VA-API") }, + [LST_VAINFO] = { "vainfo", N_("VAINFO") }, }; // delimiter ': ' has 2 chars diff --git a/src/tvhlog.h b/src/tvhlog.h index ad4969f5d..b1edd6b67 100644 --- a/src/tvhlog.h +++ b/src/tvhlog.h @@ -198,7 +198,6 @@ enum { LS_TSFILE, LS_TSDEBUG, LS_CODEC, - LS_VAINFO, #if ENABLE_DDCI LS_DDCI, #endif @@ -227,6 +226,7 @@ enum { LST_NVENC, LST_OMX, LST_VAAPI, + LST_VAINFO, LST_LAST /* keep this last */ }; -- 2.47.3