From 28fc63c7e38dfad79be45944e1685a66ca137833 Mon Sep 17 00:00:00 2001 From: Caisking Date: Fri, 26 Sep 2025 14:30:59 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=B8=A7=E7=8E=87=E5=AF=B9?= =?utf8?q?=E5=A4=96=E6=8E=A5=E5=8F=A3=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?utf8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../thunderbird/include/ThunderBirdModel.h | 9 +++++ .../thunderbird/src/ThunderBirdModel.cpp | 34 +++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index 2c6005feb..cad401fc6 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -169,6 +169,14 @@ namespace OHOS // 表情切换函数 bool SwitchExpression(const char* eyeShape, const char* eyeColor); + // 减低视频帧率 + void LowFrequence(); + // 恢复视频帧率 + void HighFrequence(); + + void at_set_fps(uint32_t freq); + uint32_t at_get_fps(void); + private: ThunderBirdModel(); virtual ~ThunderBirdModel(); @@ -199,6 +207,7 @@ namespace OHOS bool m_countUpActive; // 计数定时器是否激活 int m_countUpValue; // 当前计数值 int m_countUpTarget; // 计数目标值 + uint32_t m_currentFps; // 当前帧率 // IMEI状态管理 bool m_imeiValid = false; // IMEI是否有效标志位 diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index e5705a6f4..9870c7e2f 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -29,12 +29,19 @@ #include "custom_runtime.h" #include "ln_api.h" #include "kv_store.h" -#include "AppViewIDs.h" -#include "NativeRegisterManager.h" + #include "AppViewIDs.h" + #include "NativeRegisterManager.h" + #include "graphic_service_wrapper.h" + #define JUHEPINGTAI 1 #if JUHEPINGTAI #include "websocket_server_manager.h" #endif + + //最低视频帧率 + #define LOW_FREQUENCE 25 + //最高视频帧率 + #define HIGH_FREQUENCE 60 namespace OHOS { enum OTA_STATUS @@ -63,6 +70,7 @@ m_reminderHideActive(false), m_reminderHideTime(0), m_otaCountdownActive(false), m_otaCountdownValue(0), m_countUpActive(false), m_countUpValue(0), m_countUpTarget(0), + m_currentFps(60), // 默认60FPS m_simStatus(0), m_cat1PowerStatus(0), m_signalStrength(0), m_networkStatus(0), m_networkType(0), m_hasNetwork(false), m_networkStatusChanged(false) @@ -1497,5 +1505,27 @@ return result; } + //减低视频帧率 开启对话调用开启 + void ThunderBirdModel::LowFrequence() + { + SetFrequence(LOW_FREQUENCE); + } + //恢复视频帧率 关闭对话调用关闭 + void ThunderBirdModel::HighFrequence() + { + SetFrequence(HIGH_FREQUENCE); + } + + //at测试接口 不能外部调用 + void ThunderBirdModel::at_set_fps(uint32_t freq) + { + SetFrequence(freq); + m_currentFps = freq; // 保存当前帧率 + } + + uint32_t ThunderBirdModel::at_get_fps(void) + { + return m_currentFps; + } } \ No newline at end of file -- 2.17.1