Android11.0(R) MTK平台添加新分区

本文涉及的产品
函数计算FC,每月免费额度15元,12个月
简介: Android11.0(R) MTK平台添加新分区

mtk 平台增加一个新分区test,修改文件列表如下


  modified:   device/mediatek/mt6765/init.mt6765.rc
  modified:   device/mediatek/mt6765/sepolicy/basic/device.te
  modified:   device/mediatek/mt6765/sepolicy/basic/file_contexts
  modified:   device/mediatek/mt6765/ueventd.mt6765.emmc.rc
  modified:   device/mediatek/sepolicy/basic/non_plat/fsck.te
  modified:   device/mediatek/sepolicy/basic/non_plat/init.te
  modified:   vendor/mediatek/proprietary/hardware/fstab/mt6765/fstab.in.mt6765
  modified:   vendor/mediatek/proprietary/tools/ptgen/MT6765/partition_table_emmc_ab.csv  

1、分区表中添加分区参数(配置分区文件格式、大小、对应img名称等)


配置表格式后缀为.csv,通过在 device 目录下搜索,找到目标平台文件夹下的配置表


vendor/mediatek/proprietary/tools/ptgen/MT6765/partition_table_emmc_ab.csv


hqrGAU.png


2、修改 fstab 文件添加分区的挂载和系统启动时挂载权限


device/mediatek/mt6765/init.mt6765.rc

     mkdir /mnt/cd-rom 0000 system system
+# Create test mount pointer
+    mkdir /test 0711 system system
+
 # change lk_env permission
     chown root system /proc/lk_env
     chmod 0660 /proc/lk_env

vendor/mediatek/proprietary/hardware/fstab/mt6765/fstab.in.mt6765

 DEVPATH(nvdata)     /mnt/vendor/nvdata      ext4   FS_FLAG_COMMIT   FSMGR_FLAG_FMT
 DEVPATH(nvcfg)      /mnt/vendor/nvcfg       ext4   FS_FLAG_COMMIT   FSMGR_FLAG_FMT
+DEVPATH(test)      /test         ext4   FS_FLAG_DISCARD   FSMGR_FLAG_FMT

3、添加分区权限规则


device/mediatek/mt6765/ueventd.mt6765.emmc.rc


 /dev/block/platform/bootdevice/by-name/md1img_a  0640    root    system
 /dev/block/platform/bootdevice/by-name/md1img_b  0640    root    system
 /dev/block/platform/bootdevice/by-name/md1dsp    0660    root    system
+/dev/block/platform/bootdevice/by-name/test             0640    root    system

4、添加挂载分区的selinux权限


device/mediatek/mt6765/sepolicy/basic/device.te


type gps_emi_device, dev_type;
+type test_block_device, dev_type;


device/mediatek/mt6765/sepolicy/basic/file_contexts

 /dev/gps_emi(/.*)? u:object_r:gps_emi_device:s0
+/dev/block/platform/mtk-msdc\.0/[0-9]+\.msdc0/by-name/test u:object_r:test_block_device:s0


device/mediatek/sepolicy/basic/non_plat/init.te

 allow init para_block_device:blk_file w_file_perms;
+allow init test_block_device:blk_file rw_file_perms;

device/mediatek/sepolicy/basic/non_plat/fsck.te

 allow fsck oem_block_device:blk_file rw_file_perms;
+allow fsck test_block_device:blk_file rw_file_perms;

5、其它


本来弄完这些步骤后就能看到 /dev/block/by-name/test 分区节点了

后来又尝试了下和 Q 版本一样增加编译 test.img 规则代码,最终不成功

一直卡在最后一步生成 system.img 报错信息如下


FAILED: out/target/product/65gt/test.img
/bin/bash -c "(mkdir -p out/target/product/65gt/test ) && (mkdir -p out/target/product/65gt/obj/PACKAGING/test_intermediates && rm -rf out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"test_fs_type=ext4\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"test_size=8388608\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"test_selinux_fc=out/target/product/65gt/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg_mke2fs\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"fs_type=ext4\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"f2fs_sparse_flag=-S\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"system_verity_block_device=/dev/block/by-name/system\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"vendor_verity_block_device=/dev/block/by-name/vendor\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_avbtool=avbtool\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_add_hashtree_footer_args=--hash_algorithm sha256 --prop com.android.build.system.fingerprint:\$(cat out/target/product/65gt/build_fingerprint.txt) --prop com.android.build.system.os_version:11 --prop com.android.build.system.security_patch:2021-07-05\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_other_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_other_add_hashtree_footer_args=--rollback_index 1625443200\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_other_key_path=device/mediatek/system/common/oem_prvk.pem\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_other_algorithm=SHA256_RSA2048\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_vendor_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_vendor_add_hashtree_footer_args=--hash_algorithm sha256 --prop com.android.build.vendor.fingerprint:\$(cat out/target/product/65gt/build_fingerprint.txt) --prop com.android.build.vendor.os_version:11 --prop com.android.build.vendor.security_patch:2021-07-05\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_product_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_product_add_hashtree_footer_args=--hash_algorithm sha256 --prop com.android.build.product.fingerprint:\$(cat out/target/product/65gt/build_fingerprint.txt) --prop com.android.build.product.os_version:11 --prop com.android.build.product.security_patch:2021-07-05\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_ext_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_system_ext_add_hashtree_footer_args=--prop com.android.build.system_ext.fingerprint:\$(cat out/target/product/65gt/build_fingerprint.txt) --prop com.android.build.system_ext.os_version:11 --prop com.android.build.system_ext.security_patch:2021-07-05\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_odm_hashtree_enable=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"avb_odm_add_hashtree_footer_args=--hash_algorithm sha256 --prop com.android.build.odm.fingerprint:\$(cat out/target/product/65gt/build_fingerprint.txt) --prop com.android.build.odm.os_version:11\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"recovery_as_boot=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"root_dir=out/target/product/65gt/root\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"use_dynamic_partition_size=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (echo \"skip_fsck=true\" >>  out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt ) && (PATH=out/host/linux-x86/bin/:system/extras/ext4_utils/:\$PATH out/host/linux-x86/bin/build_image out/target/product/65gt/test out/target/product/65gt/obj/PACKAGING/test_intermediates/test_image_info.txt out/target/product/65gt/test.img out/target/product/65gt/system ) && (size=\$(for i in out/target/product/65gt/test.img; do stat -c \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"out/target/product/65gt/test.img\" | tr \" \" +); maxsize=\$((8388608)); if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > \$maxsize)\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
2020-08-14 09:56:25 - build_image.py - ERROR   : Failed to build out/target/product/65gt/test.img from out/target/product/65gt/test
Out of space? Out of inodes? The tree size of out/target/product/65gt/test is 4096 bytes (0 MB), with reserved space of 0 bytes (0 MB).
The max image size for filesystem files is 8388608 bytes (8 MB), out of a total partition size of 8388608 bytes (8 MB).
Traceback (most recent call last):
  File "/linux/alps/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py", line 174, in _run_module_as_main
  File "/linux/alps/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py", line 72, in _run_code
  File "/linux/alps/out/host/linux-x86/bin/build_image/__main__.py", line 12, in <module>
  File "/linux/alps/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py", line 174, in _run_module_as_main
  File "/linux/alps/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py", line 72, in _run_code
  File "/linux/alps/out/host/linux-x86/bin/build_image/build_image.py", line 821, in <module>
  File "/linux/alps/out/host/linux-x86/bin/build_image/build_image.py", line 813, in main
  File "/linux/alps/out/host/linux-x86/bin/build_image/build_image.py", line 488, in BuildImage
  File "/linux/alps/out/host/linux-x86/bin/build_image/build_image.py", line 345, in BuildImageMkfs
  File "/linux/alps/out/host/linux-x86/bin/build_image/common.py", line 281, in RunAndCheckOutput
common.ExternalError: Failed to run command '['mkuserimg_mke2fs', '-s', 'out/target/product/65gt/test', 'out/target/product/65gt/test.img', 'ext4', 'test', '8388608', '-D', 'out/target/product/65gt/system', '-L', 'test', '--inode_size', '256', 'out/target/product/65gt/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin']' (exit code 4):
09:56:21 mkuserimg_mke2fs.py INFO: Env: {'MKE2FS_CONFIG': '/linux/alps/out/soong/.temp/tmpCm0ao_'}
09:56:21 mkuserimg_mke2fs.py INFO: Running: mke2fs -L test -I 256 -M /test -E android_sparse -t ext4 -b 4096 out/target/product/65gt/test.img 2048
09:56:23 mkuserimg_mke2fs.py INFO: Env: {}
09:56:23 mkuserimg_mke2fs.py INFO: Running: e2fsdroid -p out/target/product/65gt/system -S out/target/product/65gt/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin -f out/target/product/65gt/test -a /test out/target/product/65gt/test.img
09:56:25 mkuserimg_mke2fs.py ERROR: Failed to run e2fsdroid_cmd: set_selinux_xattr: No such file or directory searching for label "/test"
e2fsdroid: No such file or directory while configuring the file system
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 2048 4k blocks and 2048 inodes
Allocating group tables: 0/1   done                            
Writing inode tables: 0/1   done                            
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: 0/1   done
set_selinux_xattr: No such file or directory searching for label "/test"
e2fsdroid: No such file or directory while configuring the file system


应该是和 R 版本启用了 V-AB 分区有关系

最终烧写后 adb shell 查看新加 test 分区如图


4PDl7D.png

6、更新一波


咳咳,此更新来自遥远的2089年,先整个图证明下


43i474.png

test.img 成功编译,并且烧录后根节点存在 /test

此次修改文件列表如下

  modified:   build/make/core/Makefile
  modified:   build/make/core/board_config.mk
  modified:   build/make/core/config.mk
  modified:   build/make/core/envsetup.mk
  modified:   build/make/core/main.mk
  modified:   build/make/tools/releasetools/build_image.py
  modified:   build/make/tools/releasetools/common.py
  modified:   device/mediatek/mt6765/sepolicy/basic/device.te
  modified:   device/mediatek/mt6765/sepolicy/basic/file_contexts
  modified:   device/mediateksample/k65v1_64_bsp/BoardConfig.mk
  modified:   system/core/rootdir/Android.mk
  modified:   vendor/mediatek/proprietary/tools/ptgen/MT6765/partition_table_emmc_ab.csv


6.1、增加 test.img 对应编译代码


build/make/core/Makefile

$(hide) echo "ext_mkuserimg=$(notdir $(MKEXTUSERIMG))" >> $(1)
$(if $(BOARD_TESTIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "test_fs_type=$(BOARD_TESTIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_TESTIMAGE_PARTITION_SIZE),$(hide) echo "test_size=$(BOARD_TESTIMAGE_PARTITION_SIZE)" >> $(1))
$(hide) echo "test_selinux_fc=$(SELINUX_FC)" >> $(1)
$(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1))
..............
 # test image ------------------------------------------------------
#
INTERNAL_TESTIMAGE_FILES := \
 $(filter $(TARGET_OUT_TEST)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
testimage_intermediates := \
 $(call intermediates-dir-for,PACKAGING,test)
BUILT_TESTIMAGE_TARGET := $(PRODUCT_OUT)/test.img
define build-testimage-target
 $(call pretty,"Target test fs image: $(INSTALLED_TESTIMAGE_TARGET)")
 @mkdir -p $(TARGET_OUT_TEST)
 @mkdir -p $(testimage_intermediates) && rm -rf $(testimage_intermediates)/test_image_info.txt
 $(call generate-userimage-prop-dictionary, $(testimage_intermediates)/test_image_info.txt,skip_fsck=true)
 $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
 ./build/tools/releasetools/build_image.py \
 $(TARGET_OUT_TEST) $(testimage_intermediates)/test_image_info.txt $(INSTALLED_TESTIMAGE_TARGET) $(TARGET_OUT)
 $(hide) $(call assert-max-image-size,$(INSTALLED_TESTIMAGE_TARGET),$(BOARD_TESTIMAGE_PARTITION_SIZE))
endef
# We just build this directly to the install location.
INSTALLED_TESTIMAGE_TARGET := $(BUILT_TESTIMAGE_TARGET)
$(INSTALLED_TESTIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_TESTIMAGE_FILES)
  $(build-testimage-target)
.PHONY: testimage-nodeps
testimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
  $(build-testimage-target)
# -----------------------------------------------------------------
# data partition image
INTERNAL_USERDATAIMAGE_FILES := \
    $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))


build/make/core/board_config.mk

@@ -72,6 +72,7 @@ _board_strip_readonly_list += \
   BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE \
   BOARD_ODMIMAGE_PARTITION_SIZE \
   BOARD_ODMIMAGE_FILE_SYSTEM_TYPE \
+  BOARD_TESTIMAGE_PARTITION_SIZE \

build/make/core/config.mk

@@ -1213,6 +1213,7 @@ dont_bother_goals := out \
     snod systemimage-nodeps \
     userdataimage-nodeps \
     cacheimage-nodeps \
+    testimage-nodeps \
     bptimage-nodeps \
     vnod vendorimage-nodeps \
     pnod productimage-nodeps \

build/make/core/envsetup.mk

@@ -580,6 +580,7 @@ $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_METRIC_TESTS := $(TARGET_OUT_DATA
   $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_METRIC_TESTS \
 TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache
+TARGET_OUT_TEST := $(PRODUCT_OUT)/test
 .KATI_READONLY := TARGET_OUT_CACHE

build/make/core/main.mk


 @@ -1394,6 +1394,9 @@ endif
 .PHONY: cacheimage
 cacheimage: $(INSTALLED_CACHEIMAGE_TARGET)
+.PHONY: testimage
+testimage: $(INSTALLED_TESTIMAGE_TARGET)
+
 .PHONY: bptimage
 bptimage: $(INSTALLED_BPTIMAGE_TARGET)
@@ -1449,6 +1452,7 @@ droidcore: $(filter $(HOST_OUT_ROOT)/%,$(modules_to_install)) \
     $(INSTALLED_VBMETAIMAGE_TARGET) \
     $(INSTALLED_USERDATAIMAGE_TARGET) \
     $(INSTALLED_CACHEIMAGE_TARGET) \
+    $(INSTALLED_TESTIMAGE_TARGET) \
     $(INSTALLED_BPTIMAGE_TARGET) \
     $(INSTALLED_VENDORIMAGE_TARGET) \
     $(INSTALLED_VENDOR_BOOTIMAGE_TARGET) \


build/make/tools/releasetools/build_image.py

@@ -614,6 +614,10 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
     copy_prop("cache_fs_type", "fs_type")
     copy_prop("cache_size", "partition_size")
     copy_prop("cache_selinux_fc", "selinux_fc")
+  elif mount_point == "test":
+    copy_prop("test_fs_type", "fs_type")
+    copy_prop("test_size", "partition_size")
+    copy_prop("test_selinux_fc", "selinux_fc")
   elif mount_point == "vendor":
     copy_prop("avb_vendor_hashtree_enable", "avb_hashtree_enable")
     copy_prop("avb_vendor_add_hashtree_footer_args",
@@ -787,6 +791,8 @@ def main(argv):
       mount_point = "data"
     elif image_filename == "cache.img":
       mount_point = "cache"
+    elif image_filename == "test.img":
+      mount_point = "test"
     elif image_filename == "vendor.img":
       mount_point = "vendor"
     elif image_filename == "odm.img":

build/make/tools/releasetools/common.py

   makeint("vendor_size")
   makeint("userdata_size")
   makeint("cache_size")
+  makeint("test_size")
   makeint("recovery_size")
   makeint("fstab_version")

device/mediateksample/k65v1_64_bsp/BoardConfig.mk

 BOARD_VENDOR_RAMDISK_KERNEL_MODULES +=
 # For Wifi
 BOARD_VENDOR_RAMDISK_KERNEL_MODULES +=
+
+BOARD_TESTIMAGE_FILE_SYSTEM_TYPE := ext4
+# BOARD_TESTIMAGE_PARTITION_SIZE := 0

system/core/rootdir/Android.mk

@@ -125,6 +125,7 @@ ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
 else
   LOCAL_POST_INSTALL_CMD += ; ln -sf /data/cache $(TARGET_ROOT_OUT)/cache
 endif
+LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/test
 ifdef BOARD_ROOT_EXTRA_SYMLINKS

device/mediatek/mt6765/sepolicy/basic/device.te

type gps_emi_device, dev_type;
+type test_file, dev_type;


device/mediatek/mt6765/sepolicy/basic/file_contexts

 /dev/gps_emi(/.*)? u:object_r:gps_emi_device:s0
+# Label
+/test(/.*)? u:object_r:test_file:s0


6.2、test.img 编译排错分析


错误一、 Not enough space to build proposed filesystem while setting up superblock


ERROR : Failed to build out/target/product/65gt/test.img from out/target/product/65gt/test

Out of space? Out of inodes? The tree size of out/target/product/65gt/test is 8192 bytes (0 MB), with reserved space of 0 bytes (0 MB).

The max image size for filesystem files is 20480 bytes (0 MB), out of a total partition size of 20480 bytes (0 MB)


这个问题我一直是以为分区大小太小,每次我修改 BOARD_TESTIMAGE_PARTITION_SIZE 的值,对应报错 log 中 bytes 就是其对应值


后来我研究了下流程,看了 odm 发现仅仅只是定义 BOARD_ODMIMAGE_PARTITION_SIZE,并未赋值


那就在同样的地方定义 BOARD_TESTIMAGE_PARTITION_SIZE ,再次编译未在报错


错误二、 ERROR: Failed to run e2fsdroid_cmd: set_selinux_xattr: No such file or directory searching for label “/test”


这个问题也是最一早就发现的,一开始没解决。后来找了找根据这篇


https://forum.xda-developers.com/t/android-los17-build-on-gcloud.4088065/


中提到解决办法增加 /test 规则最终解决。


6.3、烧写工具加载指定 img 文件路径


还是回到最初的 partition_table_emmc_ab.csv


43FmNj.png

一开始没注意这里面需要直接指定是否 DownLoad 和 对应 img,对照了 usedata.img 照抄就行


编译成功后,烧写工具中就自动加载 test.img


这个文件也挺有迷惑性,vendor\mediatek\proprietary\tools\ptgen\MT6765\emmc.yaml


里面配置和烧写对应规则及其相似。


android LOS17 build on gCloud

Android 新增一个分区

相关实践学习
【文生图】一键部署Stable Diffusion基于函数计算
本实验教你如何在函数计算FC上从零开始部署Stable Diffusion来进行AI绘画创作,开启AIGC盲盒。函数计算提供一定的免费额度供用户使用。本实验答疑钉钉群:29290019867
建立 Serverless 思维
本课程包括: Serverless 应用引擎的概念, 为开发者带来的实际价值, 以及让您了解常见的 Serverless 架构模式
目录
相关文章
|
6天前
|
编解码 开发工具 Android开发
Android平台RTMP直播推送模块技术接入说明
大牛直播SDK跨平台RTMP直播推送模块,始于2015年,支持Windows、Linux(x64_64架构|aarch64)、Android、iOS平台,支持采集推送摄像头、屏幕、麦克风、扬声器、编码前、编码后数据对接,功能强大,性能优异,配合大牛直播SDK的SmartPlayer播放器,轻松实现毫秒级的延迟体验,满足大多数行业的使用场景。RTMP直播推送模块数据源,支持编码前、编码后数据对接
|
7天前
|
编解码 网络协议 开发工具
Android平台RTSP|RTMP直播播放器技术接入说明
大牛直播SDK自2015年发布RTSP、RTMP直播播放模块,迭代从未停止,SmartPlayer功能强大、性能强劲、高稳定、超低延迟、超低资源占用。无需赘述,全自研内核,行业内一致认可的跨平台RTSP、RTMP直播播放器。本文以Android平台为例,介绍下如何集成RTSP、RTMP播放模块。
|
6天前
|
开发工具 Android开发 开发者
Android平台如何不推RTMP|不发布RTSP流|不实时录像|不回传GB28181数据时实时快照?
本文介绍了一种在Android平台上实现实时截图快照的方法,尤其适用于无需依赖系统接口的情况,如在RTMP推送、RTSP服务或GB28181设备接入等场景下进行截图。通过底层模块(libSmartPublisher.so)实现了截图功能,封装了`SnapShotImpl.java`类来管理截图流程。此外,提供了关键代码片段展示初始化SDK实例、执行截图、以及在Activity销毁时释放资源的过程。此方案还考虑到了快照数据的灵活处理需求,符合GB/T28181-2022的技术规范。对于寻求更灵活快照机制的开发者来说,这是一个值得参考的设计思路。
|
7天前
|
存储 编解码 网络协议
Android平台GB28181执法记录仪硬件选型和国标技术实现探讨
前几年,我们在做Android平台GB28181设备接入模块的时候,第一个使用场景想到的就是用在公检法应急指挥等场景下的执法记录仪,本篇blog,我们主要围绕Android平台GB28181执法记录仪的硬件选型、设备接入、音视频流配置、流媒体传输、存储和管理、控制与控制中心等方面进行设计,探讨下Android平台GB28181设备接入模块在执法记录仪行业的应用。
Android平台GB28181执法记录仪硬件选型和国标技术实现探讨
|
6天前
|
Java Android开发 iOS开发
探索安卓与iOS开发的差异:平台选择对项目成功的影响
在移动应用开发的世界中,选择正确的平台是关键。本文通过比较安卓和iOS开发的核心差异,揭示平台选择如何影响应用的性能、用户体验和市场覆盖。我们将深入探讨各自的开发环境、编程语言、用户界面设计原则以及发布流程,以帮助开发者和企业做出明智的决策。
27 9
|
7天前
|
编解码 网络协议 开发工具
Android平台如何实现多路低延迟RTSP|RTMP播放?
本文档详细介绍了大牛直播SDK在Android平台上实现RTSP与RTMP流媒体播放及录像功能的技术细节。早在2015年,SDK的第一版就已经支持了多实例播放,并且通过简单的实例封装就能轻松实现。文档中提供了代码示例,展示了如何开启播放、停止播放以及开始和停止录像等功能。此外,SDK还提供了丰富的配置选项,例如设置录像目录、文件大小限制、转码选项等。总结部分列出了该SDK的关键特性,包括但不限于高稳定性和低延迟的播放能力、多实例支持、事件回调、硬解码支持、网络状态监控以及复杂的网络环境处理等。这些功能使得SDK能够应对各种应用场景,特别是在对延迟和稳定性有极高要求的情况下表现优异。
|
6天前
|
Java 开发工具 Android开发
安卓与iOS开发环境对比:选择合适的平台
【8月更文挑战第14天】在移动应用开发的广阔天地中,安卓和iOS是两座巍峨的山峰,各自拥有独特的生态环境和开发文化。本文旨在深入探讨这两大平台的开发环境,揭示它们在编程语言、工具支持、社区生态以及市场趋势方面的差异与联系。我们将穿梭于代码之外,以宏观的视角审视开发者面临的选择,并提供实用的建议,帮助那些站在十字路口的开发者们做出明智的决策。文章不仅着眼于技术层面的比较,还将触及两个平台如何塑造开发者的思维模式和职业生涯。
|
7天前
|
编解码 网络协议 vr&ar
Android平台下VR头显如何低延迟播放4K以上超高分辨率RTSP|RTMP流
这段内容讲述了VR头显中实现高分辨率视频播放的技术背景与实现方法,并强调了其重要性。高分辨率对于提升VR体验至关重要,它能提供更清晰的画面、增强沉浸感、补偿透镜放大效应,并维持宽广视场角下的图像质量。文中提到的大牛直播SDK具备极低的延迟(200-400ms),支持多种协议与格式,并具有丰富的功能特性,如多实例播放、事件回调、视频及音频格式支持等。此外,提供了基于Unity的播放器示例代码,展示了如何配置播放参数并开始播放。最后,作者指出此类技术在远程控制、虚拟仿真等应用场景中的重要意义。
|
7天前
|
监控 开发工具 Android开发
Android平台实现RTSP拉流转发至轻量级RTSP服务
为满足Android平台上从外部RTSP摄像头拉流并提供轻量级RTSP服务的需求,利用大牛直播SDK实现了相关功能。SDK支持开始与停止拉流、音频视频数据回调处理及RTSP服务的启动与发布等操作。拉流仅需将未解码数据回调,对性能影响小。音频和视频数据经由特定接口传递给发布端进行处理。此外,SDK还提供了获取RTSP会话数量的功能。此方案适用于监控和巡检等低延迟应用场景,并支持二次水印添加等功能。
|
1天前
|
移动开发 Android开发 iOS开发
揭秘移动开发之谜:安卓与iOS之间的技术鸿沟有多深?探索两大平台的开发差异及其对应用性能和用户体验的惊人影响!
【8月更文挑战第19天】在移动应用开发领域,安卓与iOS占据主导地位。两者在技术架构、开发工具及市场分布上各有特色。本文通过案例对比分析,展示安卓使用Java/Kotlin与iOS采用Swift/Objective-C的语言差异;探讨iOS统一细腻设计与安卓自定义Material Design的UI区别;并讨论安卓广泛市场覆盖与iOS高用户价值对开发者策略的影响。理解这些差异有助于制定有效的开发计划。