增加帧率对外接口以及修改参数
authorCaisking <Casiking@zhihuishixun.com>
Fri, 26 Sep 2025 06:30:59 +0000 (14:30 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Fri, 26 Sep 2025 06:30:59 +0000 (14:30 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp

index 2c6005f..cad401f 100644 (file)
@@ -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是否有效标志位
index e5705a6..9870c7e 100644 (file)
  #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)
        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