mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-30 10:41:29 +00:00
add boot extra video path
Signed-off-by: chenq <chenqiang157@huawei.com>
This commit is contained in:
parent
2dabf02e24
commit
350bfe0396
@ -29,6 +29,7 @@ public:
|
||||
std::string GetSoundUrl();
|
||||
std::string GetCustomCfgFile();
|
||||
std::string GetBootVideoPath();
|
||||
std::string GetBootExtraVideoPath();
|
||||
int32_t GetRotateScreenId();
|
||||
int32_t GetRotateDegree();
|
||||
void ParserCustomCfgFile();
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
std::string custPicZipPath = {};
|
||||
std::string custSoundsPath = {};
|
||||
std::string custVideoPath = {};
|
||||
std::string custExtraVideoPath = {};
|
||||
int32_t rotateScreenId = -1;
|
||||
int32_t rotateDegree = 0;
|
||||
};
|
||||
|
@ -318,8 +318,10 @@ void BootAnimation::PlayVideo()
|
||||
.userData_ = this,
|
||||
.callback_ = std::bind(&BootAnimation::CloseVideoPlayer, this),
|
||||
};
|
||||
LOGI("PlayVideo setVideo screenId:%{public}d", (int32_t)defaultId_);
|
||||
bootVideoPlayer_ = std::make_shared<BootVideoPlayer>();
|
||||
bootVideoPlayer_->SetVideoPath(animationConfig_.GetBootVideoPath());
|
||||
bootVideoPlayer_->SetVideoPath(
|
||||
defaultId_ == 0 ? animationConfig_.GetBootVideoPath() : animationConfig_.GetBootExtraVideoPath());
|
||||
bootVideoPlayer_->SetPlayerSurface(rsSurfaceNode_ ? rsSurfaceNode_->GetSurface() : nullptr);
|
||||
bootVideoPlayer_->SetCallback(&fcb_);
|
||||
if (!bootVideoPlayer_->PlayVideo()) {
|
||||
|
@ -117,6 +117,14 @@ std::string BootAnimationConfig::GetBootVideoPath()
|
||||
return custConfig_.custVideoPath;
|
||||
}
|
||||
|
||||
std::string BootAnimationConfig::GetBootExtraVideoPath()
|
||||
{
|
||||
if (custConfig_.custExtraVideoPath.empty()) {
|
||||
return GetBootVideoPath();
|
||||
}
|
||||
return custConfig_.custExtraVideoPath;
|
||||
}
|
||||
|
||||
int32_t BootAnimationConfig::GetRotateScreenId()
|
||||
{
|
||||
return custConfig_.rotateScreenId;
|
||||
|
@ -75,6 +75,11 @@ bool ReadCustomBootConfig(const std::string& path, BootCustomConfig& aniconfig)
|
||||
aniconfig.custVideoPath = custVideoPath->valuestring;
|
||||
LOGI("cust video path: %{public}s", aniconfig.custVideoPath.c_str());
|
||||
}
|
||||
cJSON* custExtraVideoPath = cJSON_GetObjectItem(overallData, "cust.bootanimation.video.extra");
|
||||
if (custExtraVideoPath != nullptr && custExtraVideoPath->valuestring != nullptr) {
|
||||
aniconfig.custExtraVideoPath = custExtraVideoPath->valuestring;
|
||||
LOGI("cust extra video path: %{public}s", aniconfig.custExtraVideoPath.c_str());
|
||||
}
|
||||
cJSON* rotateScreenJson = cJSON_GetObjectItem(overallData, "cust.bootanimation.rotate.screenid");
|
||||
if (rotateScreenJson != nullptr && rotateScreenJson->valuestring != nullptr) {
|
||||
aniconfig.rotateScreenId = std::stoi(rotateScreenJson->valuestring);
|
||||
|
Loading…
Reference in New Issue
Block a user