!14311 displaySoloist的ND接口规范整改

Merge pull request !14311 from Klein-CK/2d_0825
This commit is contained in:
openharmony_ci 2024-08-27 02:28:37 +00:00 committed by Gitee
commit 7ab1d41d6a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,7 @@
*/
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -32,6 +32,7 @@ OH_DisplaySoloist* OH_DisplaySoloist_Create(bool useExclusiveThread)
soloistManager.InsertUseExclusiveThreadFlag(soloistId->GetId(), useExclusiveThread);
OH_DisplaySoloist* displaySoloist = new OH_DisplaySoloist({ soloistId });
HGM_LOGI("[DisplaySoloist] Create DisplaySoloist SoloistId: %{public}d", soloistId->GetId());
return displaySoloist;
}
@ -50,6 +51,7 @@ int32_t OH_DisplaySoloist_Destroy(OH_DisplaySoloist* displaySoloist)
SoloistIdType soloistId = displaySoloist->soloistId_->GetId();
RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance();
soloistManager.RemoveSoloist(soloistId);
HGM_LOGI("[DisplaySoloist] Destroy DisplaySoloist SoloistId: %{public}d", soloistId);
delete displaySoloist;
displaySoloist = nullptr;
@ -73,6 +75,7 @@ int32_t OH_DisplaySoloist_Start(OH_DisplaySoloist* displaySoloist,
RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance();
soloistManager.InsertOnVsyncCallback(soloistId, callback, data);
soloistManager.Start(soloistId);
HGM_LOGI("[DisplaySoloist] Start DisplaySoloist SoloistId: %{public}d", soloistId);
return EXEC_SUCCESS;
}
@ -91,6 +94,7 @@ int32_t OH_DisplaySoloist_Stop(OH_DisplaySoloist* displaySoloist)
SoloistIdType soloistId = displaySoloist->soloistId_->GetId();
RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance();
soloistManager.Stop(soloistId);
HGM_LOGI("[DisplaySoloist] Stop DisplaySoloist SoloistId: %{public}d", soloistId);
return EXEC_SUCCESS;
}
@ -116,5 +120,7 @@ int32_t OH_DisplaySoloist_SetExpectedFrameRateRange(OH_DisplaySoloist* displaySo
SoloistIdType soloistId = displaySoloist->soloistId_->GetId();
RSDisplaySoloistManager& soloistManager = RSDisplaySoloistManager::GetInstance();
soloistManager.InsertFrameRateRange(soloistId, frameRateRange);
HGM_LOGI("[DisplaySoloist] SoloistId: %{public}d SetExpectedFrameRateRange{%{public}d, %{public}d, %{public}d}",
soloistId, frameRateRange.min_, frameRateRange.max_, frameRateRange.preferred_);
return EXEC_SUCCESS;
}

View File

@ -55,6 +55,9 @@ void RSRenderDisplaySync::SetExpectedFrameRateRange(const FrameRateRange& range)
if (expectedFrameRateRange_ != range) {
expectedFrameRateRange_ = range;
isSkipCountUpdate_ = true;
RS_LOGI("[RenderAnimation] Id: %{public}" PRIu64 " SetExpectedFrameRateRange"
"{%{public}d, %{public}d, %{public}d}", GetId(), expectedFrameRateRange_.min_,
expectedFrameRateRange_.max_, expectedFrameRateRange_.preferred_);
}
}
@ -111,6 +114,8 @@ bool RSRenderDisplaySync::OnFrameSkip(uint64_t timestamp, int64_t period, bool i
RS_OPTIONAL_TRACE_NAME_FMT(
"RSRenderDisplaySync::OnFrameSkip preferred: [%d] currentPeroid: [%d] isFrameSkip:[%d]",
expectedFrameRateRange_.preferred_, currentPeriod_, isFrameSkip);
RS_LOGD("[RenderAnimation] Id: %{public}" PRIu64 " preferred: %{public}d "
"isFrameSkip: %{public}d", GetId(), expectedFrameRateRange_.preferred_, isFrameSkip);
return isFrameSkip;
}