From: Caisking Date: Fri, 26 Sep 2025 06:30:59 +0000 (+0800) Subject: 增加帧率对外接口以及修改参数 X-Git-Tag: V1.0.9_20251128_194606_LN~250^2~45^2~11 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=28fc63c7e38dfad79be45944e1685a66ca137833;p=mirrors%2FFD230.git 增加帧率对外接口以及修改参数 --- 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