Skip to content

Commit df8bd03

Browse files
committed
vcomp/lavc: print codec supp pixfmts with LL_INFO
print the codec supported formats always (normally) By default, most of the output is in VERBOSE except the the finally selected pixfmt. At least this information displayed by default may be useful (eg. to point out if/that suboptimal pixfmt is used).
1 parent b229c20 commit df8bd03

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,17 +783,14 @@ static int vaapi_init(struct AVCodecContext *s){
783783
void
784784
print_codec_supp_pix_fmts(const enum AVPixelFormat *const codec_pix_fmts)
785785
{
786-
log_msg(log_level,
787-
MOD_NAME "Codec supported pixel formats: " TBOLD("%s") "\n",
788-
get_avpixfmts_names(codec_pix_fmts));
786+
MSG(INFO, "Codec supported pixel formats: " TBOLD("%s") "\n",
787+
get_avpixfmts_names(codec_pix_fmts));
789788
}
790789

791790
void
792791
print_pix_fmts(const list<enum AVPixelFormat> &req_pix_fmts,
793792
const enum AVPixelFormat *const codec_pix_fmts)
794793
{
795-
print_codec_supp_pix_fmts(codec_pix_fmts);
796-
797794
// available pixel formats with respect to input pixel format
798795
enum AVPixelFormat pixfmts[AV_PIX_FMT_NB];
799796
enum AVPixelFormat *pixfmts_it = pixfmts;
@@ -1232,22 +1229,24 @@ static bool configure_with(struct state_video_compress_libav *s, struct video_de
12321229
// It is done in a loop because some pixel formats that are reported
12331230
// by codec can actually fail (typically YUV444 in hevc_nvenc for Maxwell
12341231
// cards).
1232+
const AVPixelFormat *const codec_pix_fmts =
1233+
avc_get_supported_pix_fmts(nullptr, codec);
12351234
list<enum AVPixelFormat> requested_pix_fmt = get_requested_pix_fmts(desc.color_spec, s->req_conv_prop);
12361235
auto requested_pix_fmt_it = requested_pix_fmt.cbegin();
12371236
set<AVPixelFormat> fmts_tried;
12381237
while ((pix_fmt = get_first_matching_pix_fmt(
12391238
requested_pix_fmt_it, requested_pix_fmt.cend(),
1240-
avc_get_supported_pix_fmts(nullptr, codec))) !=
1239+
codec_pix_fmts)) !=
12411240
AV_PIX_FMT_NONE) {
12421241
fmts_tried.insert(pix_fmt);
12431242
if(try_open_codec(s, pix_fmt, desc, ug_codec, codec)){
12441243
break;
12451244
}
12461245
}
12471246

1247+
print_codec_supp_pix_fmts(codec_pix_fmts);
12481248
if (pix_fmt == AV_PIX_FMT_NONE || log_level >= LOG_LEVEL_VERBOSE) {
1249-
print_pix_fmts(requested_pix_fmt,
1250-
avc_get_supported_pix_fmts(nullptr, codec));
1249+
print_pix_fmts(requested_pix_fmt, codec_pix_fmts);
12511250
}
12521251

12531252
if (pix_fmt == AV_PIX_FMT_NONE && get_commandline_param("lavc-use-codec") == NULL) {

0 commit comments

Comments
 (0)