use idr param & deal with narrowing conversion warns

This commit is contained in:
aomiki
2025-10-29 19:19:22 +01:00
committed by xytovl
parent 4908f50a00
commit 1635bdabce
2 changed files with 7 additions and 8 deletions
+6 -7
View File
@@ -130,16 +130,14 @@ static void check_profile_guid_supported(std::shared_ptr<video_encoder_nvenc_sha
}
}
NV_ENC_RC_PARAMS video_encoder_nvenc::get_rc_params(int bitrate)
NV_ENC_RC_PARAMS video_encoder_nvenc::get_rc_params(uint64_t bitrate)
{
NV_ENC_RC_PARAMS rc_params{
return {
.rateControlMode = NV_ENC_PARAMS_RC_CBR,
.averageBitRate = bitrate,
.vbvBufferSize = bitrate / fps,
.vbvInitialDelay = bitrate / fps,
.averageBitRate = static_cast<uint32_t>(bitrate),
.vbvBufferSize = static_cast<uint32_t>(bitrate / fps),
.vbvInitialDelay = static_cast<uint32_t>(bitrate / fps),
.multiPass = NV_ENC_TWO_PASS_QUARTER_RESOLUTION};
return rc_params;
}
video_encoder_nvenc::video_encoder_nvenc(
@@ -432,6 +430,7 @@ std::optional<video_encoder::data> video_encoder_nvenc::encode(bool idr, std::ch
try
{
NVENC_CHECK(shared_state->fn.nvEncReconfigureEncoder(session_handle, &reconfig_params));
idr = true;
U_LOG_I("nvenc: reconfiguring bitrate succeeded, new value: %d", bitrate);
}
catch (const std::exception & e)