[feat] add VideoQuality configuration option to limit maximum video resolution

This commit is contained in:
dijunkun
2025-11-11 10:07:35 +08:00
parent b28f1dca81
commit 2ad32ec2b4
4 changed files with 7 additions and 3 deletions

View File

@@ -495,6 +495,8 @@ int Render::CreateConnectionPeer() {
: false;
params_.enable_turn = config_center_->IsEnableTurn();
params_.enable_srtp = config_center_->IsEnableSrtp();
params_.video_quality =
static_cast<VideoQuality>(config_center_->GetVideoQuality());
params_.on_receive_video_buffer = nullptr;
params_.on_receive_audio_buffer = OnReceiveAudioBufferCb;
params_.on_receive_data_buffer = OnReceiveDataBufferCb;

View File

@@ -225,6 +225,8 @@ void Render::OnReceiveVideoBufferCb(const XVideoFrame* video_frame,
props->video_height_ = video_frame->height;
props->video_size_ = video_frame->size;
LOG_ERROR("receive: {}x{}", props->video_width_, props->video_height_);
if (need_to_update_render_rect) {
render->UpdateRenderRect();
}

View File

@@ -82,11 +82,11 @@ int Render::SettingWindow() {
{
const char* video_quality_items[] = {
localization::video_quality_high[localization_language_index_]
localization::video_quality_low[localization_language_index_]
.c_str(),
localization::video_quality_medium[localization_language_index_]
.c_str(),
localization::video_quality_low[localization_language_index_]
localization::video_quality_high[localization_language_index_]
.c_str()};
settings_items_offset += settings_items_padding;