[feat] add SRTP switch in settings

This commit is contained in:
dijunkun
2025-09-24 20:27:56 +08:00
parent aea9505c4c
commit 88c75f94e4
8 changed files with 56 additions and 5 deletions

View File

@@ -161,6 +161,23 @@ int Render::SettingWindow() {
ImGui::Checkbox("##enable_turn", &enable_turn_);
}
ImGui::Separator();
{
ImGui::SetCursorPosY(182);
ImGui::Text(
"%s",
localization::enable_srtp[localization_language_index_].c_str());
if (ConfigCenter::LANGUAGE::CHINESE == localization_language_) {
ImGui::SetCursorPosX(ENABLE_SRTP_CHECKBOX_PADDING_CN);
} else {
ImGui::SetCursorPosX(ENABLE_SRTP_CHECKBOX_PADDING_EN);
}
ImGui::SetCursorPosY(180);
ImGui::Checkbox("##enable_srtp", &enable_srtp_);
}
if (stream_window_inited_) {
ImGui::EndDisabled();
}
@@ -170,7 +187,7 @@ int Render::SettingWindow() {
} else {
ImGui::SetCursorPosX(SETTINGS_OK_BUTTON_PADDING_EN);
}
ImGui::SetCursorPosY(190.0f);
ImGui::SetCursorPosY(220.0f);
ImGui::PopStyleVar();
// OK
@@ -227,6 +244,14 @@ int Render::SettingWindow() {
}
enable_turn_last_ = enable_turn_;
// SRTP
if (enable_srtp_) {
config_center_.SetSrtp(true);
} else {
config_center_.SetSrtp(false);
}
enable_srtp_last_ = enable_srtp_;
SaveSettingsIntoCacheFile();
settings_window_pos_reset_ = true;