0


[RK3588 Android12]修改开机logo和播放开机视频

1.修改开机logo

替换kernel-5.10/logo.bmp和logo_kernel.bmp两个图片文件即可修改开机logo,替换后编译报错
error: out/target/product/rk3588_s/boot.img too large (50720768 > 41943040)
修改device/rockchip/common/build/rockchip/Partitions.mk
BOARD_BOOTIMAGE_PARTITION_SIZE的值,将该值改大一些。

diff --git a/device/rockchip/common/build/rockchip/Partitions.mk b/device/rockchip/common/build/rockchip/Partitions.mk
index e80da5f360..31331b3e9a 100644--- a/device/rockchip/common/build/rockchip/Partitions.mk
+++ b/device/rockchip/common/build/rockchip/Partitions.mk
@@ -72,7+72,7 @@ else
     BOARD_BOOTIMAGE_PARTITION_SIZE ?=67108864
     BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE ?=41943040else-    BOARD_BOOTIMAGE_PARTITION_SIZE ?=41943040+    BOARD_BOOTIMAGE_PARTITION_SIZE ?=67108864
   endif
   ifneq($(strip $(TARGET_DEVICE_DIR)),)
     #$(info $(TARGET_DEVICE_DIR)/parameter.txt not found! Use default BOARD_SYSTEMIMAGE_PARTITION_SIZE=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))

2.播放开机视频

查看源码framework/base/cmds/bootanimation/BootAnimation.cpp
可以看到视频存放位置
static const char DATA_BOOTVIDEO_FILE[] = “/data/local/bootanimation.ts”;
static const char SYSTEM_BOOTVIDEO_FILE[] = “/product/media/bootanimation.ts”;

将视频放在device/rockchip/rk3588/下,并改名为bootanimation.ts;
修改device/rockchip/rk3588/device.mk,添加
PRODUCT_COPY_FILES +=
$(LOCAL_PATH)/bootanimation.ts:/product/media/bootanimation.ts
以及
persist.sys.bootvideo.enable = true

diff --git a/device/rockchip/rk3588/device.mk b/device/rockchip/rk3588/device.mk
index deb58c1578..6b8b89a535 100644--- a/device/rockchip/rk3588/device.mk
+++ b/device/rockchip/rk3588/device.mk
@@ -78,7+78,8 @@ PRODUCT_COPY_FILES += \
 PRODUCT_COPY_FILES += \
        device/rockchip/rk3588/camera_test/reset_camera.sh:vendor/etc/camera/reset_camera.sh \
        device/rockchip/rk3588/camera_test/rkaiq_tool_server:vendor/bin/rkaiq_tool_server
-+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/bootanimation.ts:/product/media/bootanimation.ts
 #
 #addRockchip properties here
 #
@@ -103,4+104,5 @@ PRODUCT_PROPERTY_OVERRIDES += \
                 ro.kernel.android.checkjni=0 \
                 ro.build.shutdown_timeout=6 \
                 persist.enable_task_snapshots=false \
-                ro.vendor.frameratelock=true
+                ro.vendor.frameratelock=true \
+                persist.sys.bootvideo.enable = true

修改device/rockchip/common/device.mk,注释掉以下内容
#PRODUCT_COPY_FILES +=
$(LOCAL_PATH)/bootanimation.zip:/system/media/bootanimation.zip

diff --git a/device/rockchip/common/device.mk b/device/rockchip/common/device.mk
index 1907370db6..c7fa0bffba 100644--- a/device/rockchip/common/device.mk
+++ b/device/rockchip/common/device.mk
@@ -829,7+829,7 @@ elseifeq($(TARGET_BOARD_PLATFORM_PRODUCT),atv)
   PRODUCT_PROPERTY_OVERRIDES += \
        ro.target.product=atv \
        ro.com.google.clientidbase=android-rockchip-tv
-  PRODUCT_COPY_FILES += \
+  #PRODUCT_COPY_FILES += \
        $(LOCAL_PATH)/bootanimation.zip:/system/media/bootanimation.zip
 
   $(call inherit-product, device/rockchip/common/modules/rockchip_apps_box.mk)

3.开机视频播放异常

开机视频会出现不居中显示问题,这主要是开机视频使用的是原始的显示设备宽高,当系统服务起来后,DisplayManagerService获取到display的override信息后会更新分辨率配置信息,因此修改bootanimation获取显示设备的宽高值解决该问题,
修改framework/base/cmds/bootanimation/BootAnimation.cpp中的status_t BootAnimation::readyToRun() 函数,添加如下代码

diff --git a/frameworks/base/cmds/bootanimation/BootAnimation.cpp b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
index 26345c12fd..97e58d039b 100644--- a/frameworks/base/cmds/bootanimation/BootAnimation.cpp
+++ b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
@@ -515,7+515,30 @@ status_t BootAnimation::readyToRun(){
     mMaxWidth = android::base::GetIntProperty("ro.surface_flinger.max_graphics_width",0);
     mMaxHeight = android::base::GetIntProperty("ro.surface_flinger.max_graphics_height",0);
     ui::Size resolution = displayMode.resolution;-    resolution =limitSurfaceSize(resolution.width, resolution.height);++int override_width =0, override_height =0;+char buf[PROPERTY_VALUE_MAX]={0};+char*val;++property_get("persist.display.size_force", buf,"");+if(buf[0]=='\0'){+property_get("ro.config.size_override", buf,"");+}+    val =strtok(buf,",");+if(val !=NULL){+      override_width =atoi(val);+}+    val =strtok(NULL,",");+if(val !=NULL){+      override_height =atoi(val);+}++if(override_width !=0&& override_height !=0){+      resolution.width = override_width;+      resolution.height = override_height;+}else{+       resolution =limitSurfaceSize(resolution.width, resolution.height);+}// create the native surface
     sp<SurfaceControl> control =session()->createSurface(String8("BootAnimation"),
             resolution.getWidth(), resolution.getHeight(), PIXEL_FORMAT_RGB_565);

解决音视频不同步问题,修改device/rockchip/rk3588/device.mk,添加persist.sys.bootvideo.delaytime = 3

diff --git a/device/rockchip/rk3588/device.mk b/device/rockchip/rk3588/device.mk
index deb58c1578..5c058c87fe 100644--- a/device/rockchip/rk3588/device.mk
+++ b/device/rockchip/rk3588/device.mk
@@ -103,4+104,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
                 ro.kernel.android.checkjni=0 \
                 ro.build.shutdown_timeout=6 \
                 persist.enable_task_snapshots=false \
-                ro.vendor.frameratelock=true
+                ro.vendor.frameratelock=true \
+                persist.sys.bootvideo.enable = true \
+                persist.sys.bootvideo.delaytime =3
标签: 音视频 git java

本文转载自: https://blog.csdn.net/zsq122021821/article/details/128392186
版权归原作者 ~生而为赢~ 所有, 如有侵权,请联系我们删除。

“[RK3588 Android12]修改开机logo和播放开机视频”的评论:

还没有评论