Skip to content

Commit

Permalink
fix(nvenc): Enable refresh only on supported Cards
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElixZammuto committed Dec 23, 2024
1 parent 115aa6b commit 574fdb8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/nvenc/nvenc_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,20 @@ namespace nvenc {
set_minqp_if_enabled(config.min_qp_hevc);
fill_h264_hevc_vui(format_config.hevcVUIParameters);
if (client_config.enableIntraRefresh == 1) {
format_config.enableIntraRefresh = 1;
format_config.singleSliceIntraRefresh = 1;
format_config.intraRefreshPeriod = 300;
format_config.intraRefreshCnt = 299;
if (get_encoder_cap(NV_ENC_CAPS_SUPPORT_INTRA_REFRESH)) {
format_config.enableIntraRefresh = 1;
format_config.intraRefreshPeriod = 300;
format_config.intraRefreshCnt = 299;

Check warning on line 328 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L326-L328

Added lines #L326 - L328 were not covered by tests
if (get_encoder_cap(NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH)) {
format_config.singleSliceIntraRefresh = 1;

Check warning on line 330 in src/nvenc/nvenc_base.cpp

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_base.cpp#L330

Added line #L330 was not covered by tests
}
else {
BOOST_LOG(warning) << "NvEnc: Single Slice Intra Refresh not supported";
}
}
else {
BOOST_LOG(error) << "NvEnc: Client asked for intra-refresh but the encoder does not support intra-refresh";
}
}
break;
}
Expand Down

0 comments on commit 574fdb8

Please sign in to comment.