#!/bin/bash -e

# Create dummy video node for chromium V4L2 VDA/VEA with rkmpp plugin
if [ ! -e /dev/video-dec0 ]
then
    echo dec > /dev/video-dec0
    chmod 660 /dev/video-dec0
    chown root:video /dev/video-dec0
fi
if [ ! -e /dev/video-enc0 ]
then
    echo enc > /dev/video-enc0
    chmod 660 /dev/video-enc0
    chown root:video /dev/video-enc0
fi

# The chromium using fixed pathes for libv4l2.so
ln -rsf /usr/lib/*/libv4l2.so.0 /usr/lib/libv4l2.so
if [ -e /usr/lib/aarch64-linux-gnu/ ]
then
    ln -Tsf lib /usr/lib64
fi
