[feat] add screen capture frame rate option in settings window

This commit is contained in:
dijunkun
2025-10-15 17:28:36 +08:00
parent 22cc552e85
commit 09f34a81ad
9 changed files with 2121 additions and 1981 deletions

View File

@@ -1,5 +1,7 @@
#include "config_center.h"
#include "rd_log.h"
ConfigCenter::ConfigCenter() {}
ConfigCenter::~ConfigCenter() {}
@@ -14,6 +16,11 @@ int ConfigCenter::SetVideoQuality(VIDEO_QUALITY video_quality) {
return 0;
}
int ConfigCenter::SetVideoFrameRate(VIDEO_FRAME_RATE video_frame_rate) {
video_frame_rate_ = video_frame_rate;
return 0;
}
int ConfigCenter::SetVideoEncodeFormat(
VIDEO_ENCODE_FORMAT video_encode_format) {
video_encode_format_ = video_encode_format;
@@ -41,6 +48,11 @@ ConfigCenter::VIDEO_QUALITY ConfigCenter::GetVideoQuality() {
return video_quality_;
}
int ConfigCenter::GetVideoFrameRate() {
int fps = video_frame_rate_ == VIDEO_FRAME_RATE::FPS_30 ? 30 : 60;
return fps;
}
ConfigCenter::VIDEO_ENCODE_FORMAT ConfigCenter::GetVideoEncodeFormat() {
return video_encode_format_;
}

View File

@@ -11,6 +11,7 @@ class ConfigCenter {
public:
enum class LANGUAGE { CHINESE = 0, ENGLISH = 1 };
enum class VIDEO_QUALITY { LOW = 0, MEDIUM = 1, HIGH = 2 };
enum class VIDEO_FRAME_RATE { FPS_30 = 0, FPS_60 = 1 };
enum class VIDEO_ENCODE_FORMAT { AV1 = 0, H264 = 1 };
public:
@@ -20,6 +21,7 @@ class ConfigCenter {
public:
int SetLanguage(LANGUAGE language);
int SetVideoQuality(VIDEO_QUALITY video_quality);
int SetVideoFrameRate(VIDEO_FRAME_RATE video_frame_rate);
int SetVideoEncodeFormat(VIDEO_ENCODE_FORMAT video_encode_format);
int SetHardwareVideoCodec(bool hardware_video_codec);
int SetTurn(bool enable_turn);
@@ -28,6 +30,7 @@ class ConfigCenter {
public:
LANGUAGE GetLanguage();
VIDEO_QUALITY GetVideoQuality();
int GetVideoFrameRate();
VIDEO_ENCODE_FORMAT GetVideoEncodeFormat();
bool IsHardwareVideoCodec();
bool IsEnableTurn();
@@ -37,6 +40,7 @@ class ConfigCenter {
// Default value should be same with parameters in localization.h
LANGUAGE language_ = LANGUAGE::CHINESE;
VIDEO_QUALITY video_quality_ = VIDEO_QUALITY::MEDIUM;
VIDEO_FRAME_RATE video_frame_rate_ = VIDEO_FRAME_RATE::FPS_30;
VIDEO_ENCODE_FORMAT video_encode_format_ = VIDEO_ENCODE_FORMAT::AV1;
bool hardware_video_codec_ = false;
bool enable_turn_ = false;