auto enable codec2 if dmabuf_heap or ion available
This commit is contained in:
Ziyang Zhou
2022-08-14 09:45:39 +08:00
parent 8d88bbd75c
commit 25c5f2a89e
3 changed files with 9 additions and 2 deletions

1
c2.mk
View File

@@ -1,3 +1,4 @@
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
hardware/redroid/c2/redroid.c2.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/redroid.c2.rc \ hardware/redroid/c2/redroid.c2.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/redroid.c2.rc \
hardware/redroid/c2/redroid.c2.sh:$(TARGET_COPY_OUT_VENDOR)/bin/redroid.c2.sh \
hardware/redroid/c2/mediaswcodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaswcodec.policy \ hardware/redroid/c2/mediaswcodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaswcodec.policy \

View File

@@ -1,6 +1,5 @@
on init on init
setprop debug.stagefright.c2inputsurface -1 exec -- /vendor/bin/redroid.c2.sh
setprop debug.stagefright.ccodec 4
on init && property:ro.boot.use_dmabufheaps=* on init && property:ro.boot.use_dmabufheaps=*
setprop debug.c2.use_dmabufheaps ${ro.boot.use_dmabufheaps} setprop debug.c2.use_dmabufheaps ${ro.boot.use_dmabufheaps}

7
redroid.c2.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/system/bin/sh
# enable codec2 only when dmabuf_heap or ion available
if [ -c /dev/dma_heap/system ] || [ -c /dev/ion ];then
setprop debug.stagefright.c2inputsurface -1
setprop debug.stagefright.ccodec 4
fi