11-22-2018, 03:49 PM
(11-21-2018, 07:05 PM)gaggleoxfoggy Wrote: I'm not getting anywhere with this.
You should check MPP (HW accelerated video encoding/decoding) and direct DRM (output image composing). DRM windows for rk3328 are described here (eg. win0 - SDR/HDR (best for video output), win1 - SDR (best for video OSD) and win2 - SDR with limited size (best for cursor)). I prepared working proof of concept example (post). You can use bionic-lxde-rock64-0.7.9-1067-arm64.img.xz.
- check/prepare developent environment
Code:# apt list --installed | egrep 'mpp|libdrm-rockchip'
libdrm-rockchip1/bionic,now 2.4.89-1ayufan1 arm64 [installed]
librockchip-mpp1/bionic,now 1.4.0-1ayufan3-2 arm64 [installed,automatic]
# apt install librockchip-mpp-dev libdrm-dev
# ls -l /usr/lib/aarch64-linux-gnu/libdrm.so /usr/lib/aarch64-linux-gnu/libdrm_rockchip.so /usr/lib/aarch64-linux-gnu/librockchip_mpp.so
lrwxrwxrwx 1 root root 15 Dec 19 2017 /usr/lib/aarch64-linux-gnu/libdrm.so -> libdrm.so.2.4.0
lrwxrwxrwx 1 root root 24 Dec 19 2017 /usr/lib/aarch64-linux-gnu/libdrm_rockchip.so -> libdrm_rockchip.so.1.0.0
lrwxrwxrwx 1 root root 20 Mar 2 2018 /usr/lib/aarch64-linux-gnu/librockchip_mpp.so -> librockchip_mpp.so.1
# ls /usr/include/rockchip/ /usr/include/libdrm/
/usr/include/libdrm/:
... drm_mode.h ... rockchip_rga.h ... drm.h ... rockchip_drm.h .... drm_fourcc.h ... rockchip_drmif.h ...
/usr/include/rockchip/:
mpp_buffer.h mpp_err.h mpp_frame.h mpp_meta.h mpp_packet.h mpp_task.h rk_mpi.h rk_mpi_cmd.h rk_type.h vpu.h vpu_api.h - compile and check MPP/DRM example (beware - working directly to drm framebuffer (eg. working without xserver and replace original FB when running)).
Code:# git clone https://github.com/mcerveny/utils.git
# cd utils
# gcc -o mpi_dec -I/usr/include/rockchip -I/usr/include/libdrm -g -Wno-multichar mpi_dec.c -lrockchip_mpp -lpthread -ldrm
# ./mpi_dec 2k60.hevc 16777220
Now there are verified MPP and DRM HW acceleration libraries.
I left this community in Aug 2019 due to PINE64 refusal to produce/deliver ROCK64-1G version 3 after more than one year of changing statuses to "planning", "evaluating", "releasing", "availability", "estimated availability" and finally "no schedule" . ROCK64 is dead platform without any advantage. Buy Raspberry PI 4 !