Optimized the NDK interface specification of DisplaySoloist.

Signed-off-by: Klein-CK<chenke76@huawei.com>

Change-Id: Ia48c33187d1b8bc3fbe6742b588a706b79e1b3c3
This commit is contained in:
Klein-CK 2024-08-25 15:54:00 +08:00
parent 4dc7d00e3c
commit 3ee8623e5e
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;
}