mirror of
https://github.com/Fishwaldo/meta-pine64.git
synced 2025-03-15 19:41:59 +00:00
* Bump release to 2.1
* Firefox VPU acceleration with v4l2-m2m support * Move Pinix Testing Repo * drop initramfs * Disable Suspect/Hibernate (due to errate on JH7110 this wont ever work) * add Plymouth Splash Screen at boot and drop psplash * add plymouth-themes * refactor rootfs-resize to be a proper systemd unit file * move konqueror to kde-gear layer * new upstream ffmpeg patches from starfive.
This commit is contained in:
parent
80ec1e442d
commit
f21fd77a47
44 changed files with 1612 additions and 367 deletions
|
@ -2,7 +2,7 @@ require conf/distro/poky.conf
|
||||||
|
|
||||||
DISTRO = "pinix"
|
DISTRO = "pinix"
|
||||||
DISTRO_NAME = "PinIx"
|
DISTRO_NAME = "PinIx"
|
||||||
DISTRO_VERSION = "2.0"
|
DISTRO_VERSION = "2.1"
|
||||||
DISTRO_CODENAME = "pinix"
|
DISTRO_CODENAME = "pinix"
|
||||||
SDK_VENDOR = "-pine64"
|
SDK_VENDOR = "-pine64"
|
||||||
TARGET_VENDOR = "-pine64"
|
TARGET_VENDOR = "-pine64"
|
||||||
|
@ -50,8 +50,10 @@ PACKAGE_CLASSES ?= "package_deb"
|
||||||
|
|
||||||
POKY_INIT_MANAGER:star64 = "systemd"
|
POKY_INIT_MANAGER:star64 = "systemd"
|
||||||
|
|
||||||
INITRAMFS_FSTYPES = "cpio.gz"
|
SPLASH="plymouth"
|
||||||
INITRAMFS_IMAGE = "star64-image-initramfs"
|
|
||||||
|
#INITRAMFS_FSTYPES = "cpio.gz"
|
||||||
|
#INITRAMFS_IMAGE = "star64-image-initramfs"
|
||||||
LICENSE_FLAGS_ACCEPTED = "commercial"
|
LICENSE_FLAGS_ACCEPTED = "commercial"
|
||||||
QT_LTS_GIT_PROTOCOL = "https"
|
QT_LTS_GIT_PROTOCOL = "https"
|
||||||
|
|
||||||
|
|
27
recipes-browser/refined-h264ify/refined-h264ify_3.1.0.bb
Normal file
27
recipes-browser/refined-h264ify/refined-h264ify_3.1.0.bb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
SUMMARY = "Firefox add on to enable youtube to only stream h264 videos"
|
||||||
|
HOMEPAGE = "https://addons.mozilla.org/en-US/firefox/addon/refined-h264ify/"
|
||||||
|
BUGTRACKER = "https://github.com/Edwin-Zarco/refined-h264ify/issues"
|
||||||
|
AUTHOR = "George Kiagiadakis <george.kiagiadakis@collabora.com> "
|
||||||
|
SECTION = "multimedia"
|
||||||
|
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=650b869bd8ff2aed59c62bad2a22a821"
|
||||||
|
|
||||||
|
|
||||||
|
SRC_URI = " \
|
||||||
|
https://addons.mozilla.org/firefox/downloads/file/4109282/refined_h264ify-3.1.0.xpi;name=extension \
|
||||||
|
https://raw.githubusercontent.com/Edwin-Zarco/refined-h264ify/master/LICENSE;name=license \
|
||||||
|
"
|
||||||
|
SRC_URI[extension.sha256sum] = "433c3d67e3d0d7d7fd4584cd049105d19daa7a47763b6a6f1a28e3697390ce4a"
|
||||||
|
SRC_URI[license.sha256sum] = "7c34d28e784b202aa4998f477fd0aa9773146952d7f6fa5971369fcdda59cf48"
|
||||||
|
|
||||||
|
S="${WORKDIR}"
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -d ${D}${libdir}/firefox/distribution/extensions
|
||||||
|
install -m 0644 ${WORKDIR}/refined_h264ify-3.1.0.xpi ${D}${libdir}/firefox/distribution/extensions/{ea422457-9756-4444-83f8-8e8d0f29d59c}.xpi
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES:${PN} += " \
|
||||||
|
${libdir}/firefox/distribution/extensions \
|
||||||
|
"
|
|
@ -1 +1 @@
|
||||||
deb [signed-by=/etc/apt/trusted.gpg.d/pinix.gpg] https://pine64.my-ho.st:8443/ pinix-testing all riscv64 pinetabv
|
deb [signed-by=/etc/apt/trusted.gpg.d/pinix.gpg] https://pine64.my-ho.st:8443/testing/ pinix-testing all riscv64 pinetabv
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
deb [signed-by=/etc/apt/trusted.gpg.d/pinix.gpg] https://pine64.my-ho.st:8443/ pinix-testing all riscv64 star64
|
deb [signed-by=/etc/apt/trusted.gpg.d/pinix.gpg] https://pine64.my-ho.st:8443/testing/ pinix-testing all riscv64 star64
|
||||||
|
|
|
@ -48,7 +48,6 @@ RDEPENDS:packagegroup-pinetabv-plasma = " \
|
||||||
kirigami-addons \
|
kirigami-addons \
|
||||||
kmenuedit \
|
kmenuedit \
|
||||||
konsole \
|
konsole \
|
||||||
konqueror \
|
|
||||||
kpipewire \
|
kpipewire \
|
||||||
kscreen \
|
kscreen \
|
||||||
kscreenlocker \
|
kscreenlocker \
|
||||||
|
@ -64,6 +63,7 @@ RDEPENDS:packagegroup-pinetabv-plasma = " \
|
||||||
liberation-fonts \
|
liberation-fonts \
|
||||||
mesa-demos \
|
mesa-demos \
|
||||||
milou \
|
milou \
|
||||||
|
pinetabv-base-files \
|
||||||
pipewire \
|
pipewire \
|
||||||
pipewire-alsa \
|
pipewire-alsa \
|
||||||
pipewire-alsa-card-profile \
|
pipewire-alsa-card-profile \
|
||||||
|
@ -120,6 +120,7 @@ RDEPENDS:packagegroup-pinetabv-plasma = " \
|
||||||
plasma-welcome \
|
plasma-welcome \
|
||||||
polkit-kde-agent-1 \
|
polkit-kde-agent-1 \
|
||||||
powerdevil \
|
powerdevil \
|
||||||
|
refined-h264ify \
|
||||||
sddm \
|
sddm \
|
||||||
sddm-kcm \
|
sddm-kcm \
|
||||||
systemd \
|
systemd \
|
||||||
|
|
|
@ -33,7 +33,6 @@ RDEPENDS:packagegroup-star64-minimal = " \
|
||||||
libgpiod-tools \
|
libgpiod-tools \
|
||||||
bluez5 \
|
bluez5 \
|
||||||
u-boot-tools \
|
u-boot-tools \
|
||||||
kernel-image-fitimage-initramfs \
|
|
||||||
xz \
|
xz \
|
||||||
usbutils \
|
usbutils \
|
||||||
elfutils \
|
elfutils \
|
||||||
|
@ -45,6 +44,9 @@ RDEPENDS:packagegroup-star64-minimal = " \
|
||||||
cmake \
|
cmake \
|
||||||
meson \
|
meson \
|
||||||
tree \
|
tree \
|
||||||
|
plymouth \
|
||||||
|
plymouth-themes \
|
||||||
|
linux-firmware-visionfive2-wave511 \
|
||||||
"
|
"
|
||||||
|
|
||||||
COMPATIBLE_MACHINE = "star64|pinetabv"
|
COMPATIBLE_MACHINE = "star64|pinetabv"
|
|
@ -45,7 +45,6 @@ RDEPENDS:packagegroup-star64-plasma = " \
|
||||||
kirigami-addons \
|
kirigami-addons \
|
||||||
kmenuedit \
|
kmenuedit \
|
||||||
konsole \
|
konsole \
|
||||||
konqueror \
|
|
||||||
kpipewire \
|
kpipewire \
|
||||||
kscreen \
|
kscreen \
|
||||||
kscreenlocker \
|
kscreenlocker \
|
||||||
|
@ -116,6 +115,7 @@ RDEPENDS:packagegroup-star64-plasma = " \
|
||||||
plasma-browser-integration \
|
plasma-browser-integration \
|
||||||
plasma-welcome \
|
plasma-welcome \
|
||||||
polkit-kde-agent-1 \
|
polkit-kde-agent-1 \
|
||||||
|
refined-h264ify \
|
||||||
sddm \
|
sddm \
|
||||||
sddm-kcm \
|
sddm-kcm \
|
||||||
systemd \
|
systemd \
|
||||||
|
|
|
@ -15,6 +15,7 @@ RDEPENDS:packagegroup-star64-weston = " \
|
||||||
sddm \
|
sddm \
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)} \
|
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)} \
|
||||||
firefox \
|
firefox \
|
||||||
|
refined-h264ify \
|
||||||
mesa-demos \
|
mesa-demos \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
23
recipes-core/pinetabv-base-files/pinetabv-base-files/COPYING
Normal file
23
recipes-core/pinetabv-base-files/pinetabv-base-files/COPYING
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#PineTabv Doesn't support Suspend. So lock instead.
|
||||||
|
HandleLidSwitch=lock
|
||||||
|
HandleLidSwitchExternalPower=lock
|
|
@ -0,0 +1,2 @@
|
||||||
|
[BatteryManagement]
|
||||||
|
BatteryCriticalAction=8
|
|
@ -0,0 +1,65 @@
|
||||||
|
[AC]
|
||||||
|
icon=battery-charging
|
||||||
|
|
||||||
|
[AC][DPMSControl]
|
||||||
|
idleTime=600
|
||||||
|
lockBeforeTurnOff=0
|
||||||
|
|
||||||
|
[AC][DimDisplay]
|
||||||
|
idleTime=300000
|
||||||
|
|
||||||
|
[AC][HandleButtonEvents]
|
||||||
|
lidAction=32
|
||||||
|
powerButtonAction=16
|
||||||
|
powerDownAction=16
|
||||||
|
triggerLidActionWhenExternalMonitorPresent=false
|
||||||
|
|
||||||
|
[AC][SuspendSession]
|
||||||
|
idleTime=900000
|
||||||
|
suspendThenHibernate=false
|
||||||
|
suspendType=8
|
||||||
|
|
||||||
|
[Battery]
|
||||||
|
icon=battery-060
|
||||||
|
|
||||||
|
[Battery][DPMSControl]
|
||||||
|
idleTime=300
|
||||||
|
lockBeforeTurnOff=0
|
||||||
|
|
||||||
|
[Battery][DimDisplay]
|
||||||
|
idleTime=120000
|
||||||
|
|
||||||
|
[Battery][HandleButtonEvents]
|
||||||
|
lidAction=32
|
||||||
|
powerButtonAction=16
|
||||||
|
powerDownAction=16
|
||||||
|
triggerLidActionWhenExternalMonitorPresent=false
|
||||||
|
|
||||||
|
[Battery][SuspendSession]
|
||||||
|
idleTime=600000
|
||||||
|
suspendThenHibernate=false
|
||||||
|
suspendType=8
|
||||||
|
|
||||||
|
[LowBattery]
|
||||||
|
icon=battery-low
|
||||||
|
|
||||||
|
[LowBattery][BrightnessControl]
|
||||||
|
value=30
|
||||||
|
|
||||||
|
[LowBattery][DPMSControl]
|
||||||
|
idleTime=120
|
||||||
|
lockBeforeTurnOff=0
|
||||||
|
|
||||||
|
[LowBattery][DimDisplay]
|
||||||
|
idleTime=60000
|
||||||
|
|
||||||
|
[LowBattery][HandleButtonEvents]
|
||||||
|
lidAction=32
|
||||||
|
powerButtonAction=16
|
||||||
|
powerDownAction=16
|
||||||
|
triggerLidActionWhenExternalMonitorPresent=false
|
||||||
|
|
||||||
|
[LowBattery][SuspendSession]
|
||||||
|
idleTime=300000
|
||||||
|
suspendThenHibernate=false
|
||||||
|
suspendType=8
|
37
recipes-core/pinetabv-base-files/pinetabv-base-files_1.0.bb
Normal file
37
recipes-core/pinetabv-base-files/pinetabv-base-files_1.0.bb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
SUMMARY = "Global Config Files for PineTabV"
|
||||||
|
DESCRIPTION ="Global Config Files for PineTabV"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://COPYING;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
SRC_URI += " \
|
||||||
|
file://COPYING \
|
||||||
|
file://powerdevilrc \
|
||||||
|
file://powermanagementprofilesrc \
|
||||||
|
file://lockscreen.conf \
|
||||||
|
"
|
||||||
|
|
||||||
|
S="${WORKDIR}"
|
||||||
|
|
||||||
|
RDEPENDS:${PN} += " \
|
||||||
|
systemd \
|
||||||
|
powerdevil \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_install:append() {
|
||||||
|
install -d ${D}${sysconfdir}/xdg/
|
||||||
|
install -m 0644 ${WORKDIR}/powerdevilrc ${D}${sysconfdir}/xdg/powerdevilrc
|
||||||
|
install -m 0644 ${WORKDIR}/powermanagementprofilesrc ${D}${sysconfdir}/xdg/powermanagementprofilesrc
|
||||||
|
install -d ${D}${sysconfdir}/systemd/logind.conf.d/
|
||||||
|
install -m 0644 ${WORKDIR}/lockscreen.conf ${D}${sysconfdir}/systemd/logind.conf.d/lockscreen.conf
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst_ontarget:${PN}() {
|
||||||
|
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
COMPATIBLE_MACHINE = "pinetabv"
|
||||||
|
|
||||||
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
43
recipes-core/plymouth-themes/plymouth-themes_1.0.bb
Normal file
43
recipes-core/plymouth-themes/plymouth-themes_1.0.bb
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
# SPDX-FileCopyrightText: 2023 Justin Hammond <justin@dynam.ac>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
DESCRIPTION = "Wings Themes For Plasma Desktop"
|
||||||
|
SUMMARY = "Wings Themes For Plasma Desktop"
|
||||||
|
HOMEPAGE = "https://github.com/L4ki/Wings-Plasma-Themes"
|
||||||
|
LICENSE = "GPL-3.0-only "
|
||||||
|
|
||||||
|
SRC_URI += " \
|
||||||
|
git://github.com/adi1090x/plymouth-themes.git;protocol=https;branch=master \
|
||||||
|
"
|
||||||
|
SRCREV="5d8817458d764bff4ff9daae94cf1bbaabf16ede"
|
||||||
|
|
||||||
|
S="${WORKDIR}/git"
|
||||||
|
|
||||||
|
LIC_FILES_CHKSUM=" \
|
||||||
|
file://LICENSE;md5=1ebbd3e34237af26da5dc08a4e440464 \
|
||||||
|
"
|
||||||
|
|
||||||
|
inherit allarch
|
||||||
|
|
||||||
|
RDEPENDS:${PN} = " \
|
||||||
|
plymouth \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -m 0755 -d ${D}${datadir}/plymouth/themes
|
||||||
|
cp -R --no-dereference --preserve=mode,links -v ${S}/pack_1/* ${D}${datadir}/plymouth/themes/
|
||||||
|
cp -R --no-dereference --preserve=mode,links -v ${S}/pack_2/* ${D}${datadir}/plymouth/themes/
|
||||||
|
cp -R --no-dereference --preserve=mode,links -v ${S}/pack_3/* ${D}${datadir}/plymouth/themes/
|
||||||
|
cp -R --no-dereference --preserve=mode,links -v ${S}/pack_4/* ${D}${datadir}/plymouth/themes/
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst:${PN}() {
|
||||||
|
sed -i 's/Theme=spinner/Theme=pixels/g' $D/${datadir}/plymouth/plymouthd.defaults
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FILES:${PN} = " \
|
||||||
|
${datadir}/plymouth/themes \
|
||||||
|
"
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
From 746c690f57b52e6fe21cc2a11b5bb71d25af3128 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
|
||||||
|
Date: Wed, 13 Dec 2017 16:15:57 +0100
|
||||||
|
Subject: [PATCH] Make full path to systemd-tty-ask-password-agent configurable
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [embedded specific]
|
||||||
|
|
||||||
|
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
|
||||||
|
---
|
||||||
|
configure.ac | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index aad673e..6b37179 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -48,7 +48,10 @@ PLYMOUTH_LIBS="-lm -lrt -ldl"
|
||||||
|
AC_SUBST(PLYMOUTH_CFLAGS)
|
||||||
|
AC_SUBST(PLYMOUTH_LIBS)
|
||||||
|
|
||||||
|
-AC_PATH_PROG([SYSTEMD_ASK_PASSWORD_AGENT], [systemd-tty-ask-password-agent])
|
||||||
|
+AC_ARG_WITH(systemd-tty-ask-password-agent, AS_HELP_STRING([--with-systemd-tty-ask-password-agent],[path of systemd-tty-ask-password-agent]),SYSTEMD_ASK_PASSWORD_AGENT=${withval},SYSTEMD_ASK_PASSWORD_AGENT=/bin/systemd-tty-ask-password-agent)
|
||||||
|
+AC_SUBST(SYSTEMD_ASK_PASSWORD_AGENT)
|
||||||
|
+
|
||||||
|
+# checked: UDEVADM is not used
|
||||||
|
AC_PATH_PROG([UDEVADM], [udevadm])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango],[enable building with pango, disabled there is no encryption prompts]),enable_pango=$enableval,enable_pango=yes)
|
||||||
|
--
|
||||||
|
2.9.5
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
From 0274e9d2470dfbc9c973182fea835228e2de79dd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Justin Hammond <justin@dynam.ac>
|
||||||
|
Date: Fri, 8 Sep 2023 16:59:04 +0000
|
||||||
|
Subject: [PATCH] ignore serial ports whene starting plymouthd
|
||||||
|
|
||||||
|
---
|
||||||
|
systemd-units/plymouth-halt.service.in | 2 +-
|
||||||
|
systemd-units/plymouth-kexec.service.in | 2 +-
|
||||||
|
systemd-units/plymouth-poweroff.service.in | 2 +-
|
||||||
|
systemd-units/plymouth-reboot.service.in | 2 +-
|
||||||
|
systemd-units/plymouth-start.service.in | 2 +-
|
||||||
|
5 files changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/systemd-units/plymouth-halt.service.in b/systemd-units/plymouth-halt.service.in
|
||||||
|
index cb87c1f..f948176 100644
|
||||||
|
--- a/systemd-units/plymouth-halt.service.in
|
||||||
|
+++ b/systemd-units/plymouth-halt.service.in
|
||||||
|
@@ -7,7 +7,7 @@ ConditionKernelCommandLine=!plymouth.enable=0
|
||||||
|
ConditionVirtualization=!container
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session
|
||||||
|
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session --ignore-serial-consoles
|
||||||
|
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
||||||
|
Type=forking
|
||||||
|
RemainAfterExit=yes
|
||||||
|
diff --git a/systemd-units/plymouth-kexec.service.in b/systemd-units/plymouth-kexec.service.in
|
||||||
|
index 22bc5bd..083b5b6 100644
|
||||||
|
--- a/systemd-units/plymouth-kexec.service.in
|
||||||
|
+++ b/systemd-units/plymouth-kexec.service.in
|
||||||
|
@@ -7,7 +7,7 @@ ConditionKernelCommandLine=!plymouth.enable=0
|
||||||
|
ConditionVirtualization=!container
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session
|
||||||
|
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session --ignore-serial-consoles
|
||||||
|
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
||||||
|
Type=forking
|
||||||
|
RemainAfterExit=yes
|
||||||
|
diff --git a/systemd-units/plymouth-poweroff.service.in b/systemd-units/plymouth-poweroff.service.in
|
||||||
|
index cf05e47..f450b68 100644
|
||||||
|
--- a/systemd-units/plymouth-poweroff.service.in
|
||||||
|
+++ b/systemd-units/plymouth-poweroff.service.in
|
||||||
|
@@ -7,7 +7,7 @@ ConditionKernelCommandLine=!plymouth.enable=0
|
||||||
|
ConditionVirtualization=!container
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session
|
||||||
|
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session --ignore-serial-consoles
|
||||||
|
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
||||||
|
Type=forking
|
||||||
|
RemainAfterExit=yes
|
||||||
|
diff --git a/systemd-units/plymouth-reboot.service.in b/systemd-units/plymouth-reboot.service.in
|
||||||
|
index 3624550..ddd34a0 100644
|
||||||
|
--- a/systemd-units/plymouth-reboot.service.in
|
||||||
|
+++ b/systemd-units/plymouth-reboot.service.in
|
||||||
|
@@ -7,7 +7,7 @@ ConditionKernelCommandLine=!plymouth.enable=0
|
||||||
|
ConditionVirtualization=!container
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=reboot --attach-to-session
|
||||||
|
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=reboot --attach-to-session --ignore-serial-consoles
|
||||||
|
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
||||||
|
Type=forking
|
||||||
|
RemainAfterExit=yes
|
||||||
|
diff --git a/systemd-units/plymouth-start.service.in b/systemd-units/plymouth-start.service.in
|
||||||
|
index 830a62d..d16c026 100644
|
||||||
|
--- a/systemd-units/plymouth-start.service.in
|
||||||
|
+++ b/systemd-units/plymouth-start.service.in
|
||||||
|
@@ -9,7 +9,7 @@ ConditionVirtualization=!container
|
||||||
|
IgnoreOnIsolate=true
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --pid-file=@plymouthruntimedir@/pid --attach-to-session
|
||||||
|
+ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=boot --pid-file=@plymouthruntimedir@/pid --attach-to-session --ignore-serial-consoles
|
||||||
|
ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash
|
||||||
|
Type=forking
|
||||||
|
RemainAfterExit=yes
|
|
@ -0,0 +1,35 @@
|
||||||
|
From f270f80d4c36a22a0f7b8de8fb6b1abef6f7b183 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
Date: Tue, 15 Feb 2022 16:23:10 +0800
|
||||||
|
Subject: [PATCH] plymouth : Add the retain-splash option
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Adding the "retain-splash” option to tell plymouth to keep the boot
|
||||||
|
splash’s contents on screen even after plymouth exits to make the
|
||||||
|
splash screen show more friendly on the system which boots so fast.
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate[embedded specific]
|
||||||
|
|
||||||
|
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
---
|
||||||
|
systemd-units/plymouth-quit.service.in | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/systemd-units/plymouth-quit.service.in b/systemd-units/plymouth-quit.service.in
|
||||||
|
index ed9f9b9..147e9ee 100644
|
||||||
|
--- a/systemd-units/plymouth-quit.service.in
|
||||||
|
+++ b/systemd-units/plymouth-quit.service.in
|
||||||
|
@@ -3,7 +3,7 @@ Description=Terminate Plymouth Boot Screen
|
||||||
|
After=rc-local.service plymouth-start.service systemd-user-sessions.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-ExecStart=-@PLYMOUTH_CLIENT_DIR@/plymouth quit
|
||||||
|
+ExecStart=-@PLYMOUTH_CLIENT_DIR@/plymouth quit --retain-splash
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
TimeoutSec=20
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
9
recipes-core/plymouth/plymouth/display-manager.conf
Normal file
9
recipes-core/plymouth/plymouth/display-manager.conf
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Conflicts=plymouth-quit.service
|
||||||
|
After=plymouth-quit.service rc-local.service plymouth-start.service systemd-user-sessions.service
|
||||||
|
OnFailure=plymouth-quit.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=-/bin/plymouth deactivate
|
||||||
|
ExecStartPost=-/bin/sleep 30
|
||||||
|
ExecStartPost=-/bin/plymouth quit --retain-splash
|
|
@ -1,2 +0,0 @@
|
||||||
PACKAGECONFIG:remove:jh7110 = "initrd"
|
|
||||||
PACKAGECONFIG:append:jh7110 = " drm "
|
|
104
recipes-core/plymouth/plymouth_22.02.122.bb
Normal file
104
recipes-core/plymouth/plymouth_22.02.122.bb
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
SUMMARY = "Plymouth is a project from Fedora providing a flicker-free graphical boot process."
|
||||||
|
|
||||||
|
DESCRIPTION = "Plymouth is an application that runs very early in the boot process \
|
||||||
|
(even before the root filesystem is mounted!) that provides a \
|
||||||
|
graphical boot animation while the boot process happens in the background. \
|
||||||
|
"
|
||||||
|
|
||||||
|
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/Plymouth"
|
||||||
|
SECTION = "base"
|
||||||
|
|
||||||
|
LICENSE = "GPL-2.0-or-later"
|
||||||
|
|
||||||
|
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
|
||||||
|
|
||||||
|
DEPENDS = "libcap libpng cairo dbus udev cantarell-fonts"
|
||||||
|
DEPENDS:append:libc-musl = " musl-rpmatch"
|
||||||
|
PROVIDES = "virtual/psplash"
|
||||||
|
RPROVIDES:${PN} = "virtual-psplash virtual-psplash-support"
|
||||||
|
RDEPENDS:${PN} += " cantarell-fonts"
|
||||||
|
|
||||||
|
SRC_URI = "http://www.freedesktop.org/software/plymouth/releases/${BPN}-${PV}.tar.xz \
|
||||||
|
file://0001-Make-full-path-to-systemd-tty-ask-password-agent-con.patch \
|
||||||
|
file://0001-plymouth-Add-the-retain-splash-option.patch \
|
||||||
|
file://0001-ignore-serial-ports-whene-starting-plymouthd.patch \
|
||||||
|
file://display-manager.conf \
|
||||||
|
"
|
||||||
|
|
||||||
|
PR="r2"
|
||||||
|
|
||||||
|
SRC_URI[sha256sum] = "100551442221033ce868c447ad6c74d831d209c18ae232b98ae0207e34eadaeb"
|
||||||
|
|
||||||
|
EXTRA_OECONF += " --enable-shared --disable-static --disable-gtk --disable-documentation \
|
||||||
|
--with-logo=${LOGO} \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd-integration --with-systemd-tty-ask-password-agent=${base_bindir}/systemd-tty-ask-password-agent', '--disable-systemd-integration', d)} \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge','--without-system-root-install','--with-system-root-install',d)} \
|
||||||
|
"
|
||||||
|
|
||||||
|
PACKAGECONFIG ??= "pango initrd"
|
||||||
|
PACKAGECONFIG:append:x86 = " drm"
|
||||||
|
PACKAGECONFIG:append:x86-64 = " drm"
|
||||||
|
PACKAGECONFIG:append:jh7110 = " drm"
|
||||||
|
PACKAGECONFIG:remove:jh7110 = "initrd"
|
||||||
|
|
||||||
|
PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
|
||||||
|
PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
|
||||||
|
PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
|
||||||
|
PACKAGECONFIG[initrd] = ",,,"
|
||||||
|
|
||||||
|
LOGO ??= "${datadir}/plymouth/bizcom.png"
|
||||||
|
|
||||||
|
inherit autotools pkgconfig systemd gettext
|
||||||
|
|
||||||
|
LDFLAGS:append:libc-musl = " -lrpmatch"
|
||||||
|
|
||||||
|
do_install:append() {
|
||||||
|
# Remove /var/run from package as plymouth will populate it on startup
|
||||||
|
rm -fr "${D}${localstatedir}/run"
|
||||||
|
|
||||||
|
if ! ${@bb.utils.contains('PACKAGECONFIG', 'initrd', 'true', 'false', d)}; then
|
||||||
|
rm -rf "${D}${libexecdir}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install:append:jh7110() {
|
||||||
|
install -d ${D}${sysconfdir}/systemd/system/display-manager.service.d
|
||||||
|
install -m 0644 ${WORKDIR}/display-manager.conf ${D}${sysconfdir}/systemd/system/display-manager.service.d
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'initrd', '${PN}-initrd ', '', d)}"
|
||||||
|
PACKAGES =+ "${PN}-set-default-theme"
|
||||||
|
|
||||||
|
FILES:${PN}-initrd = "${libexecdir}/plymouth/*"
|
||||||
|
FILES:${PN}-set-default-theme = "${sbindir}/plymouth-set-default-theme"
|
||||||
|
|
||||||
|
FILES:${PN} += "${systemd_unitdir}/system/*"
|
||||||
|
CONFFILES:${PN} += "${sysconfdir}/plymouth/plymouthd.conf"
|
||||||
|
FILES:${PN}-dbg += "${libdir}/plymouth/renderers/.debug"
|
||||||
|
|
||||||
|
|
||||||
|
RDEPENDS:${PN}-initrd = "bash dracut"
|
||||||
|
RDEPENDS:${PN}-set-default-theme = "bash"
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE:${PN} = "plymouth-start.service"
|
||||||
|
|
||||||
|
pkg_postinst_ontarget:${PN}() {
|
||||||
|
if [ -f /boot/uEnv.txt ]; then
|
||||||
|
if [ $(grep -c "rootwait splash quiet" /boot/uEnv.txt) -eq 0 ]; then
|
||||||
|
sed -i 's/rootwait/rootwait splash quiet/g' /boot/uEnv.txt
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f /boot/vf5_uEnv.txt ]; then
|
||||||
|
if [ $(grep -c "rootwait splash quiet" /boot/vf5_uEnv.txt) -eq 0 ]; then
|
||||||
|
sed -i 's/rootwait/rootwait splash quiet/g' /boot/vf5_uEnv.txt
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RREPLACES:${PN} += " \
|
||||||
|
psplash \
|
||||||
|
"
|
||||||
|
RCONFLICTS:${PN} += " \
|
||||||
|
psplash \
|
||||||
|
"
|
|
@ -1,19 +0,0 @@
|
||||||
SUMMARY = "A psplash customization recipe"
|
|
||||||
DESCRIPTION ="This recipe allows personalization of pshlash colors and image"
|
|
||||||
LICENSE = "GPL-2.0-or-later"
|
|
||||||
LIC_FILES_CHKSUM = "file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0"
|
|
||||||
|
|
||||||
# Logo image file name as in /files folder
|
|
||||||
SPLASH_IMAGE_NAME = "logo.png"
|
|
||||||
|
|
||||||
# Color values in R,G,B format "0x00,0x00, 0x00"
|
|
||||||
BACKGROUND_COLOR = "0xff,0xff,0xff"
|
|
||||||
TEXT_COLOR = "0xff,0x00,0x00"
|
|
||||||
BAR_COLOR = "0x6d,0x6d,0x70"
|
|
||||||
BAR_BACKGROUND_COLOR = "0xff,0xff,0xff"
|
|
||||||
|
|
||||||
# Overide MACHINE_PSPLASH_PKG name
|
|
||||||
# add you own override if misssing
|
|
||||||
MACHINE_PSPLASH_PKG:qemuall = "default"
|
|
||||||
MACHINE_PSPLASH_PKG:qemux86-64 = "default"
|
|
||||||
MACHINE_PSPLASH_PKG:rpi = "raspberrypi"
|
|
|
@ -1,76 +0,0 @@
|
||||||
# PINE64 Branding
|
|
||||||
|
|
||||||
## Name
|
|
||||||
|
|
||||||
The PINE64 name should always be capitalized in official communications.
|
|
||||||
|
|
||||||
## Logo
|
|
||||||
|
|
||||||
The PINE64 logo consists of our pinecone icon and the "PINE64" text. Both elements are always in this visual order; the icon then the text.
|
|
||||||
|
|
||||||
The text in this logo is laid in the font "Jesaya Regular", which can be found on [DaFont](https://www.dafont.com/jesaya-free.font), or its original source [Typodermic Fonts](https://typodermicfonts.com/jesaya/)
|
|
||||||
|
|
||||||
### Standard
|
|
||||||
|
|
||||||
The standard logo variant features the pinecone icon to the left of the PINE64 text.
|
|
||||||
|
|
||||||
Use the standard variant whenever horizontal space will allow. For example, at the top of most letter-size documents or as a main component of a splash screen in landscape orientation.
|
|
||||||
|
|
||||||
This logo is available in three colourways to suit the situation:
|
|
||||||
|
|
||||||
#### Original
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The original colourway features our pinecone icon in our branded blue colour scheme with black text. It should be used in all situations where a white or almost-white background can be guaranteed.
|
|
||||||
|
|
||||||
You should use this version of the logo whenever the background suits.
|
|
||||||
|
|
||||||
#### Black-on-white
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The black-on-white colourway replaces the branded blue pinecone with a black pinecone. This version of the logo is suitable for situations where the background is light but not white, or if there is a gradient that clashes with the standard variant.
|
|
||||||
|
|
||||||
#### White-on-black
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
The white-on-black colourway keeps the monochromatic design of black-on-white but is suitable for use on dark backgrounds.
|
|
||||||
|
|
||||||
Avoid combining the brand colour pinecone with white text on a black background.
|
|
||||||
|
|
||||||
### Stacked
|
|
||||||
|
|
||||||
The stacked logo variant features our pinecone on top of the "PINE64" text.
|
|
||||||
|
|
||||||
This variant is suitable for spaces where horizontal space is limited, such as when it is used as a main element on a portrait screen.
|
|
||||||
|
|
||||||
Guidance for using the colourways available for this logo is the same as the standard logo. The only exception is that the black-on-white colourway takes the place of the standard colourway as the default option.
|
|
||||||
|
|
||||||
#### Black-on-white
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### White-on-black
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Icon
|
|
||||||
|
|
||||||
The pinecone icon represents the growth of our community: From a single stem, in many interesting segments, all leading up toward our goals.
|
|
||||||
|
|
||||||
That said, the icon should only be used in one of these formats when one of the logo variants has already been displayed. Notable followers of this rule include the PineBook Pro, which ships with a sticker with the standard logo variation attached. Notable exceptions include the PineTab and PinePhone, which are unbranded except for the pinecone icon.
|
|
||||||
|
|
||||||
Various example colourways are shown here.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
Binary file not shown.
Before Width: | Height: | Size: 57 KiB |
|
@ -1,51 +0,0 @@
|
||||||
include customize.bb
|
|
||||||
MACHINE_PSPLASH_PKG ?= "default"
|
|
||||||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
|
||||||
SPLASH_IMAGES:forcevariable = "file://${SPLASH_IMAGE_NAME} \
|
|
||||||
file://${SPLASH_IMAGE_NAME};outsuffix=${MACHINE_PSPLASH_PKG} \
|
|
||||||
"
|
|
||||||
|
|
||||||
# TASKS
|
|
||||||
|
|
||||||
def setPsplashColors(srcdir, BACKGROUND_COLOR, TEXT_COLOR, BAR_COLOR, BAR_BACKGROUND_COLOR):
|
|
||||||
import re
|
|
||||||
import stat
|
|
||||||
path = f"{srcdir}/psplash-colors.h"
|
|
||||||
f = open(path, "r")
|
|
||||||
psplash_colors = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
psplash_colors = re.sub("BACKGROUND_COLOR .*", f"BACKGROUND_COLOR {BACKGROUND_COLOR}", psplash_colors, 1)
|
|
||||||
psplash_colors = re.sub("TEXT_COLOR .*", f"TEXT_COLOR {TEXT_COLOR}", psplash_colors, 1)
|
|
||||||
psplash_colors = re.sub("BAR_COLOR .*", f"BAR_COLOR {BAR_COLOR}", psplash_colors, 1)
|
|
||||||
psplash_colors = re.sub("BAR_BACKGROUND_COLOR .*", f"BAR_BACKGROUND_COLOR {BAR_BACKGROUND_COLOR}", psplash_colors, 1)
|
|
||||||
|
|
||||||
# enable reading and writing permission
|
|
||||||
os.chmod(path, stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG )
|
|
||||||
f = open(path, "w")
|
|
||||||
f.write(psplash_colors)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
python do_display_banner() {
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
bb.plain("* META-SPLASH *");
|
|
||||||
bb.plain("* Applying custom psplash image *");
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
}
|
|
||||||
|
|
||||||
addtask display_banner before do_build
|
|
||||||
|
|
||||||
do_compile:prepend() {
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
bb.plain("* Applying custom psplash colors *");
|
|
||||||
bb.plain("***********************************************");
|
|
||||||
|
|
||||||
srcdir = d.getVar('S')
|
|
||||||
setPsplashColors(
|
|
||||||
srcdir,
|
|
||||||
d.getVar('BACKGROUND_COLOR'),
|
|
||||||
d.getVar('TEXT_COLOR'),
|
|
||||||
d.getVar('BAR_COLOR'),
|
|
||||||
d.getVar('BAR_BACKGROUND_COLOR')
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
SUMMARY = "Resize rootfs to fill userdata partition."
|
|
||||||
|
|
||||||
LICENSE = "Apache-2.0"
|
|
||||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
|
||||||
|
|
||||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
||||||
|
|
||||||
ALLOW_EMPTY:${PN} = "1"
|
|
||||||
|
|
||||||
pkg_postinst_ontarget:${PN}() {
|
|
||||||
root=$(eval $(lsblk -oMOUNTPOINT,NAME -P -M | grep 'MOUNTPOINT="/"'); echo $NAME)
|
|
||||||
if [[ "$root" == *"mmcblk"* ]]; then
|
|
||||||
echo "Resizing $root partition to fill SDCard..."
|
|
||||||
psplash-write "MSG Resizing $root partition to fill SDCard..." || true
|
|
||||||
sgdisk -e /dev/${root:0:-2}
|
|
||||||
partprobe
|
|
||||||
echo yes | parted ---pretend-input-tty /dev/${root:0:-2} resizepart ${root:0-1} 100%
|
|
||||||
partprobe
|
|
||||||
resize2fs /dev/$root
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
RDEPENDS:${PN} += "e2fsprogs-resize2fs parted util-linux gptfdisk"
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Resize RootFS
|
||||||
|
ConditionPathExists=!/etc/.rootfsresized
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=systemd-remount-fs.service plymouth-start.service
|
||||||
|
Before=sysinit.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/resize-rootfs.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sysinit.target
|
18
recipes-core/resize-rootfs/resize-rootfs/resize-rootfs.sh
Normal file
18
recipes-core/resize-rootfs/resize-rootfs/resize-rootfs.sh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/sh
|
||||||
|
root=$(eval $(lsblk -oMOUNTPOINT,NAME -P -M | grep 'MOUNTPOINT="/"'); echo $NAME)
|
||||||
|
if [[ "$root" == *"mmcblk"* ]]; then
|
||||||
|
echo "Resizing $root partition to fill SD Card..."
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card..." || true
|
||||||
|
sgdisk -e /dev/${root:0:-2} || true
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card....." || true
|
||||||
|
partprobe || true
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card......." || true
|
||||||
|
echo yes | parted ---pretend-input-tty /dev/${root:0:-2} resizepart ${root:0-1} 100% || true
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card........." || true
|
||||||
|
partprobe || true
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card........." || true
|
||||||
|
resize2fs /dev/$root || true
|
||||||
|
plymouth display-message --text="Resizing $root partition to fill SD Card...........Done!" || true
|
||||||
|
touch /etc/.rootfsresized || true
|
||||||
|
echo "Resize $root done!"
|
||||||
|
fi
|
28
recipes-core/resize-rootfs/resize-rootfs_1.1.bb
Normal file
28
recipes-core/resize-rootfs/resize-rootfs_1.1.bb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
SUMMARY = "Resize rootfs to fill userdata partition."
|
||||||
|
|
||||||
|
LICENSE = "Apache-2.0"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||||
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
|
||||||
|
SRC_URI = " \
|
||||||
|
file://resize-rootfs.sh \
|
||||||
|
file://resize-rootfs.service \
|
||||||
|
"
|
||||||
|
inherit systemd
|
||||||
|
|
||||||
|
S = "${WORKDIR}"
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -d ${D}${systemd_unitdir}/system
|
||||||
|
install -m 0644 ${WORKDIR}/resize-rootfs.service ${D}${systemd_unitdir}/system
|
||||||
|
install -d ${D}${bindir}
|
||||||
|
install -m 0755 ${WORKDIR}/resize-rootfs.sh ${D}${bindir}
|
||||||
|
}
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE:${PN} = "resize-rootfs.service"
|
||||||
|
|
||||||
|
RDEPENDS:${PN} += "e2fsprogs-resize2fs parted util-linux gptfdisk"
|
||||||
|
|
||||||
|
FILES:${PN} += "${systemd_unitdir}/system/resize-rootfs.service \
|
||||||
|
${bindir}/resize-rootfs.sh \
|
||||||
|
"
|
|
@ -1,31 +0,0 @@
|
||||||
# Simple initramfs image. Mostly used for live images.
|
|
||||||
DESCRIPTION = "Small image capable of booting a device. The kernel includes \
|
|
||||||
the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
|
|
||||||
first 'init' program more efficiently."
|
|
||||||
|
|
||||||
INITRAMFS_SCRIPTS ?= "\
|
|
||||||
initramfs-framework-base \
|
|
||||||
linux-firmware-visionfive2-imggpu \
|
|
||||||
linux-firmware-visionfive2-wave420l \
|
|
||||||
linux-firmware-visionfive2-wave511 \
|
|
||||||
"
|
|
||||||
|
|
||||||
PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
|
|
||||||
|
|
||||||
# Do not pollute the initrd image with rootfs features
|
|
||||||
IMAGE_FEATURES = ""
|
|
||||||
|
|
||||||
IMAGE_NAME_SUFFIX ?= ""
|
|
||||||
IMAGE_LINGUAS = ""
|
|
||||||
|
|
||||||
LICENSE = "MIT"
|
|
||||||
|
|
||||||
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
|
|
||||||
inherit core-image
|
|
||||||
|
|
||||||
IMAGE_ROOTFS_SIZE = "8192"
|
|
||||||
IMAGE_ROOTFS_EXTRA_SPACE = "0"
|
|
||||||
|
|
||||||
# Use the same restriction as initramfs-module-install
|
|
||||||
COMPATIBLE_HOST = 'riscv64-pine64-linux'
|
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2023 Justin Hammond <justin@dynam.ac>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
DESCRIPTION = "Konqueror"
|
|
||||||
SUMMARY = "A Webbrowser for KDE"
|
|
||||||
HOMEPAGE = "https://invent.kde.org/network/konqueror"
|
|
||||||
LICENSE = "BSD-3-Clause & GPL-2.0-only & GPL-2.0-or-later & GPL-3.0-only & LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-or-later & LGPL-3.0-only"
|
|
||||||
LIC_FILES_CHKSUM = " \
|
|
||||||
file://LICENSES/BSD-3-Clause.txt;md5=f225922a2c12dfa5218fb70c49db3ea6 \
|
|
||||||
file://LICENSES/GPL-2.0-only.txt;md5=9e2385fe012386d34dcc5c9863070881 \
|
|
||||||
file://LICENSES/GPL-2.0-or-later.txt;md5=9e2385fe012386d34dcc5c9863070881 \
|
|
||||||
file://LICENSES/GPL-3.0-only.txt;md5=49fc03046e56a282c0c743b5d3a55b7c \
|
|
||||||
file://LICENSES/LGPL-2.0-only.txt;md5=da48810c4ddf8e49efa031294a26b98c \
|
|
||||||
file://LICENSES/LGPL-2.0-or-later.txt;md5=da48810c4ddf8e49efa031294a26b98c \
|
|
||||||
file://LICENSES/LGPL-2.1-or-later.txt;md5=147a320ed8b16b036829a0c71d424153 \
|
|
||||||
file://LICENSES/LGPL-3.0-only.txt;md5=8d51f5b5fd447f7a1040c3dc9f0a8de6 \
|
|
||||||
"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
|
||||||
|
|
||||||
DEPENDS = " \
|
|
||||||
qtwebengine \
|
|
||||||
kwindowsystem \
|
|
||||||
kparts \
|
|
||||||
kcrash \
|
|
||||||
kinit \
|
|
||||||
kiconthemes \
|
|
||||||
kdbusaddons \
|
|
||||||
kguiaddons \
|
|
||||||
kactivities \
|
|
||||||
kdesu \
|
|
||||||
qtbase \
|
|
||||||
"
|
|
||||||
|
|
||||||
inherit cmake_kdeapp
|
|
||||||
inherit kcoreaddons
|
|
||||||
inherit kconfig
|
|
||||||
inherit kauth
|
|
||||||
inherit mime-xdg
|
|
||||||
inherit kcmutils
|
|
||||||
|
|
||||||
EXTRA_OECMAKE:append = " \
|
|
||||||
-DBUILD_TESTING=OFF \
|
|
||||||
-DOE_KF5_PATH_HOST_ROOT=${STAGING_DIR_HOST} \
|
|
||||||
"
|
|
||||||
|
|
||||||
FILES:${PN} += " \
|
|
||||||
${datadir}/k* \
|
|
||||||
${datadir}/webenginepart \
|
|
||||||
${datadir}/akregator \
|
|
||||||
${libdir}/plugins/khtml \
|
|
||||||
${libdir}/plugins/kwebkitpart \
|
|
||||||
${libdir}/plugins/webenginepart \
|
|
||||||
${libdir}/libkdeinit5_konqueror.so \
|
|
||||||
${libdir}/libkdeinit5_kfmclient.so \
|
|
||||||
${libdir}/libkwebenginepart.so \
|
|
||||||
${libdir}/libKF5Konq.so \
|
|
||||||
${libdir}/libkonqsidebarplugin.so \
|
|
||||||
"
|
|
||||||
FILES:${PN}-dev = " \
|
|
||||||
${includedir}/konqsidebarplugin.h \
|
|
||||||
${includedir}/KF5/konq* \
|
|
||||||
${includedir}/KF5/libkonq* \
|
|
||||||
"
|
|
||||||
|
|
||||||
INSANE_SKIP:${PN} = "dev-so"
|
|
|
@ -1,21 +0,0 @@
|
||||||
From ce8c1d569f398a700419e92875ac681910e1a9e5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Justin Hammond <justin@dynam.ac>
|
|
||||||
Date: Fri, 28 Apr 2023 16:08:17 +0800
|
|
||||||
Subject: [PATCH] Fix linking with QtPrintSupport
|
|
||||||
|
|
||||||
---
|
|
||||||
webenginepart/src/CMakeLists.txt | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/webenginepart/src/CMakeLists.txt b/webenginepart/src/CMakeLists.txt
|
|
||||||
index a65a80fc6..e8bebb341 100644
|
|
||||||
--- a/webenginepart/src/CMakeLists.txt
|
|
||||||
+++ b/webenginepart/src/CMakeLists.txt
|
|
||||||
@@ -3,6 +3,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Notifications )
|
|
||||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Sonnet)
|
|
||||||
|
|
||||||
find_package(Hunspell)
|
|
||||||
+find_package(Qt5 REQUIRED COMPONENTS PrintSupport)
|
|
||||||
|
|
||||||
add_definitions(-DTRANSLATION_DOMAIN=\"webenginepart\")
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
require ${PN}.inc
|
|
||||||
SRC_URI += " \
|
|
||||||
git://invent.kde.org/network/konqueror.git;protocol=https;branch=release/23.04 \
|
|
||||||
file://0001-Fix-linking-with-QtPrintSupport.patch \
|
|
||||||
"
|
|
||||||
SRCREV = "fac551bcfbf8cc75c11f994b6f920f1273094461"
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
cd /boot/
|
|
||||||
CURVER=`dumpimage -l fitImage | grep "FIT description" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'`
|
|
||||||
LATEST=`ls fitImage-initramfs-* | awk -F"-" '{ print $3 }' | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -g | tail -n 1`
|
|
||||||
echo "Current Version is '$CURVER'"
|
|
||||||
echo "Latest Version is '$LATEST'"
|
|
||||||
cp fitImage-initramfs-$LATEST fitImage
|
|
|
@ -1,51 +0,0 @@
|
||||||
SUMMARY = "Install a InitRamFS enabled FitImage"
|
|
||||||
LICENSE = "MIT"
|
|
||||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
|
||||||
SRC_URI = " \
|
|
||||||
file://checkfitimage.sh \
|
|
||||||
"
|
|
||||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
|
||||||
|
|
||||||
inherit kernel-artifact-names module-base
|
|
||||||
|
|
||||||
pkg_preinst:${PN} () {
|
|
||||||
bootpart=`lsblk -o NAME,LABEL -r | grep "mmcblk[0-9]p[0-9] boot" | awk -F' ' '{print $1}'`
|
|
||||||
if [ ! -z "$bootpart" ];
|
|
||||||
then
|
|
||||||
mount /dev/$bootpart /boot || true
|
|
||||||
dpkg-divert --package ${PN} --divert /usr/share/kernel/${KERNEL_IMAGETYPE}-initramfs-${KERNEL_VERSION} /boot/${KERNEL_IMAGETYPE}-initramfs-${KERNEL_VERSION}
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst_ontarget:${PN} () {
|
|
||||||
${libexecdir}/checkfitimage.sh || true
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm:${PN} () {
|
|
||||||
dpkg-divert --remove /boot/${KERNEL_IMAGETYPE}-initramfs-${KERNEL_VERSION}
|
|
||||||
${libexecdir}/checkfitimage.sh || true
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install() {
|
|
||||||
install -d -m 0755 ${D}/boot/
|
|
||||||
ls ${DEPLOY_DIR_IMAGE}/fitImage-*${KERNEL_FIT_BIN_EXT}
|
|
||||||
install -m 0644 ${DEPLOY_DIR_IMAGE}/fitImage-${INITRAMFS_IMAGE}-${MACHINE}--${KERNEL_VERSION}*${KERNEL_FIT_BIN_EXT} ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${KERNEL_VERSION}
|
|
||||||
install -d -m 0755 ${D}/${libexecdir}
|
|
||||||
install -m 0755 ${WORKDIR}/checkfitimage.sh ${D}/${libexecdir}/
|
|
||||||
}
|
|
||||||
|
|
||||||
FILES:${PN} += " \
|
|
||||||
/boot/${KERNEL_IMAGETYPE}-initramfs-${KERNEL_VERSION} \
|
|
||||||
${libexecdir}/checkfitimage.sh \
|
|
||||||
"
|
|
||||||
|
|
||||||
do_install[depends] = "virtual/kernel:do_deploy"
|
|
||||||
|
|
||||||
RDEPENDS:${PN} += " \
|
|
||||||
u-boot-tools \
|
|
||||||
kernel-modules (>= ${PV}) \
|
|
||||||
"
|
|
||||||
|
|
||||||
RREPLACES:${PN} = " \
|
|
||||||
kernel-image-fitimage \
|
|
||||||
"
|
|
|
@ -0,0 +1,172 @@
|
||||||
|
From 2a24a3a4ceb05307b065d50cd019515b6d0e2490 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:14:39 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: omxdec: optimize with omx zero copy feature
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...-optimize-with-omx-zero-copy-feature.patch | 155 ++++++++++++++++++
|
||||||
|
1 file changed, 155 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0022-omxdec-optimize-with-omx-zero-copy-feature.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0022-omxdec-optimize-with-omx-zero-copy-feature.patch b/package/ffmpeg/0022-omxdec-optimize-with-omx-zero-copy-feature.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..76bb9a7
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0022-omxdec-optimize-with-omx-zero-copy-feature.patch
|
||||||
|
@@ -0,0 +1,155 @@
|
||||||
|
+From 640ea14c3ca4536dce22a24153ac37d752009412 Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 11:38:04 +0800
|
||||||
|
+Subject: [PATCH 1/8] omxdec optimize with omx zero copy feature
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 63 ++++++++++++++++++++++++++++++++++-----------
|
||||||
|
+ 1 file changed, 48 insertions(+), 15 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index 1bb08b1..c518542 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -342,6 +342,8 @@ typedef struct OMXCodecContext {
|
||||||
|
+ pthread_cond_t input_cond;
|
||||||
|
+ pthread_mutex_t output_mutex;
|
||||||
|
+ pthread_cond_t output_cond;
|
||||||
|
++ pthread_mutex_t disableEVnt_mutex;
|
||||||
|
++ pthread_cond_t disableEVnt_cond;
|
||||||
|
+
|
||||||
|
+ pthread_mutex_t state_mutex;
|
||||||
|
+ pthread_cond_t state_cond;
|
||||||
|
+@@ -419,7 +421,7 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ OMX_PARAM_PORTDEFINITIONTYPE out_port_params = { 0 };
|
||||||
|
+ OMX_PORT_PARAM_TYPE video_port_params = { 0 };
|
||||||
|
+ OMX_ERRORTYPE err;
|
||||||
|
+- int i;
|
||||||
|
++ int i, num;
|
||||||
|
+
|
||||||
|
+ switch (event) {
|
||||||
|
+ case OMX_EventError:
|
||||||
|
+@@ -438,6 +440,11 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ pthread_mutex_unlock(&s->state_mutex);
|
||||||
|
+ } else if (data1 == OMX_CommandPortDisable) {
|
||||||
|
+ av_log(s->avctx, AV_LOG_VERBOSE, "OMX port %"PRIu32" disabled\n", (uint32_t) data2);
|
||||||
|
++ if (data2 == 1) {
|
||||||
|
++ pthread_mutex_lock(&s->disableEVnt_mutex);
|
||||||
|
++ pthread_cond_broadcast(&s->disableEVnt_cond);
|
||||||
|
++ pthread_mutex_unlock(&s->disableEVnt_mutex);
|
||||||
|
++ }
|
||||||
|
+ } else if (data1 == OMX_CommandPortEnable) {
|
||||||
|
+ av_log(s->avctx, AV_LOG_VERBOSE, "OMX port %"PRIu32" enabled\n", (uint32_t) data2);
|
||||||
|
+ } else {
|
||||||
|
+@@ -470,6 +477,32 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ dec_pix_fmt = out_port_params.format.video.eColorFormat;
|
||||||
|
+
|
||||||
|
+ av_log(s->avctx, AV_LOG_VERBOSE, "w:%d, h:%d, fmt:%d\n", dec_out_width, dec_out_height, dec_pix_fmt);
|
||||||
|
++ if (!s->num_out_buffers) {
|
||||||
|
++ s->num_out_buffers = out_port_params.nBufferCountActual;
|
||||||
|
++ s->out_buffer_headers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_out_buffers);
|
||||||
|
++ s->done_out_buffers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_out_buffers);
|
||||||
|
++
|
||||||
|
++ if (!s->out_buffer_headers || !s->done_out_buffers)
|
||||||
|
++ return AVERROR(ENOMEM);
|
||||||
|
++
|
||||||
|
++ OMX_SendCommand(s->handle, OMX_CommandPortEnable, 1, NULL);
|
||||||
|
++
|
||||||
|
++ for (num = 0; num < s->num_out_buffers && err == OMX_ErrorNone; num++)
|
||||||
|
++ err = OMX_AllocateBuffer(s->handle, &s->out_buffer_headers[num], s->out_port, s, out_port_params.nBufferSize);
|
||||||
|
++
|
||||||
|
++ if (err != OMX_ErrorNone) {
|
||||||
|
++ av_log(s->avctx, AV_LOG_ERROR, "err %x (%d) on line %d\n", err, err, __LINE__);
|
||||||
|
++ return AVERROR_UNKNOWN;
|
||||||
|
++ }
|
||||||
|
++ s->num_out_buffers = num;
|
||||||
|
++
|
||||||
|
++ for (num = 0; num < s->num_out_buffers && err == OMX_ErrorNone; num++)
|
||||||
|
++ err = OMX_FillThisBuffer(s->handle, s->out_buffer_headers[num]);
|
||||||
|
++ if (err != OMX_ErrorNone) {
|
||||||
|
++ for (; num < s->num_out_buffers; num++)
|
||||||
|
++ s->done_out_buffers[s->num_done_out_buffers++] = s->out_buffer_headers[num];
|
||||||
|
++ }
|
||||||
|
++ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+@@ -866,15 +899,18 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
|
||||||
|
+ CHECK(err);
|
||||||
|
+ err = OMX_GetParameter(s->handle, OMX_IndexParamPortDefinition, &out_port_params);
|
||||||
|
+ CHECK(err);
|
||||||
|
+- s->num_out_buffers = out_port_params.nBufferCountActual;
|
||||||
|
++
|
||||||
|
++ OMX_SendCommand(s->handle, OMX_CommandPortDisable, 1, NULL);
|
||||||
|
++ pthread_mutex_lock(&s->disableEVnt_mutex);
|
||||||
|
++ pthread_cond_wait(&s->disableEVnt_cond, &s->disableEVnt_mutex);
|
||||||
|
++ pthread_mutex_unlock(&s->disableEVnt_mutex);
|
||||||
|
+
|
||||||
|
+ err = OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateIdle, NULL);
|
||||||
|
+ CHECK(err);
|
||||||
|
+ s->in_buffer_headers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_in_buffers);
|
||||||
|
+ s->free_in_buffers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_in_buffers);
|
||||||
|
+- s->out_buffer_headers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_out_buffers);
|
||||||
|
+- s->done_out_buffers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_out_buffers);
|
||||||
|
+- if (!s->in_buffer_headers || !s->free_in_buffers || !s->out_buffer_headers || !s->done_out_buffers)
|
||||||
|
++
|
||||||
|
++ if (!s->in_buffer_headers || !s->free_in_buffers)
|
||||||
|
+ return AVERROR(ENOMEM);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < s->num_in_buffers && err == OMX_ErrorNone; i++) {
|
||||||
|
+@@ -887,10 +923,7 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
|
||||||
|
+ }
|
||||||
|
+ CHECK(err);
|
||||||
|
+ s->num_in_buffers = i;
|
||||||
|
+- for (i = 0; i < s->num_out_buffers && err == OMX_ErrorNone; i++)
|
||||||
|
+- err = OMX_AllocateBuffer(s->handle, &s->out_buffer_headers[i], s->out_port, s, out_port_params.nBufferSize);
|
||||||
|
+- CHECK(err);
|
||||||
|
+- s->num_out_buffers = i;
|
||||||
|
++
|
||||||
|
+ if (wait_for_state(s, OMX_StateIdle) < 0) {
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "Didn't get OMX_StateIdle\n");
|
||||||
|
+ return AVERROR_UNKNOWN;
|
||||||
|
+@@ -901,12 +934,7 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "Didn't get OMX_StateExecuting\n");
|
||||||
|
+ return AVERROR_UNKNOWN;
|
||||||
|
+ }
|
||||||
|
+- for (i = 0; i < s->num_out_buffers && err == OMX_ErrorNone; i++)
|
||||||
|
+- err = OMX_FillThisBuffer(s->handle, s->out_buffer_headers[i]);
|
||||||
|
+- if (err != OMX_ErrorNone) {
|
||||||
|
+- for (; i < s->num_out_buffers; i++)
|
||||||
|
+- s->done_out_buffers[s->num_done_out_buffers++] = s->out_buffer_headers[i];
|
||||||
|
+- }
|
||||||
|
++
|
||||||
|
+ for (i = 0; i < s->num_in_buffers; i++)
|
||||||
|
+ s->free_in_buffers[s->num_free_in_buffers++] = s->in_buffer_headers[i];
|
||||||
|
+ return err != OMX_ErrorNone ? AVERROR_UNKNOWN : 0;
|
||||||
|
+@@ -952,6 +980,8 @@ static av_cold void cleanup(OMXCodecContext *s)
|
||||||
|
+ pthread_mutex_destroy(&s->input_mutex);
|
||||||
|
+ pthread_cond_destroy(&s->output_cond);
|
||||||
|
+ pthread_mutex_destroy(&s->output_mutex);
|
||||||
|
++ pthread_cond_destroy(&s->disableEVnt_cond);
|
||||||
|
++ pthread_mutex_destroy(&s->disableEVnt_mutex);
|
||||||
|
+ s->mutex_cond_inited = 0;
|
||||||
|
+ }
|
||||||
|
+ OMXDecodeQueueDestory(&s->decode_pts_queue);
|
||||||
|
+@@ -984,6 +1014,8 @@ static av_cold int omx_decode_init(AVCodecContext *avctx)
|
||||||
|
+ pthread_cond_init(&s->input_cond, NULL);
|
||||||
|
+ pthread_mutex_init(&s->output_mutex, NULL);
|
||||||
|
+ pthread_cond_init(&s->output_cond, NULL);
|
||||||
|
++ pthread_mutex_init(&s->disableEVnt_mutex, NULL);
|
||||||
|
++ pthread_cond_init(&s->disableEVnt_cond, NULL);
|
||||||
|
+ s->mutex_cond_inited = 1;
|
||||||
|
+ s->avctx = avctx;
|
||||||
|
+ s->state = OMX_StateLoaded;
|
||||||
|
+@@ -1009,6 +1041,7 @@ static av_cold int omx_decode_init(AVCodecContext *avctx)
|
||||||
|
+
|
||||||
|
+ if ((ret = find_component(s->omx_context, avctx, role, s->component_name, sizeof(s->component_name))) < 0)
|
||||||
|
+ goto fail;
|
||||||
|
++ strcat(s->component_name, ".internal");
|
||||||
|
+
|
||||||
|
+ av_log(avctx, AV_LOG_INFO, "Using %s\n", s->component_name);
|
||||||
|
+
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,270 @@
|
||||||
|
From 9b8f6e9e4c434fee6b36af655c022868a23c1edc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:15:38 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: omxdec : add output buffers release callback to
|
||||||
|
reduce memcpy
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...t-buffers-release-callback-to-reduce.patch | 252 ++++++++++++++++++
|
||||||
|
1 file changed, 252 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0023-omxdec-add-output-buffers-release-callback-to-reduce.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0023-omxdec-add-output-buffers-release-callback-to-reduce.patch b/package/ffmpeg/0023-omxdec-add-output-buffers-release-callback-to-reduce.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4828f86
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0023-omxdec-add-output-buffers-release-callback-to-reduce.patch
|
||||||
|
@@ -0,0 +1,252 @@
|
||||||
|
+From 0f054a4a66e82d8f644acb8bf2a0b637cfee9aa8 Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 11:52:49 +0800
|
||||||
|
+Subject: [PATCH 2/8] omxdec : add output buffers release callback to reduce
|
||||||
|
+ memcpy
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/allcodecs.c | 8 +--
|
||||||
|
+ libavcodec/omxdec.c | 131 +++++++++++++++++++++++++++++++++++------
|
||||||
|
+ 2 files changed, 116 insertions(+), 23 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
|
||||||
|
+index 69627df..cb5b3d7 100644
|
||||||
|
+--- a/libavcodec/allcodecs.c
|
||||||
|
++++ b/libavcodec/allcodecs.c
|
||||||
|
+@@ -29,6 +29,10 @@
|
||||||
|
+ #include "avcodec.h"
|
||||||
|
+ #include "version.h"
|
||||||
|
+
|
||||||
|
++extern AVCodec ff_h264_omx_decoder;
|
||||||
|
++extern AVCodec ff_hevc_omx_encoder;
|
||||||
|
++extern AVCodec ff_hevc_omx_decoder;
|
||||||
|
++extern AVCodec ff_mjpeg_omx_decoder;
|
||||||
|
+ extern AVCodec ff_a64multi_encoder;
|
||||||
|
+ extern AVCodec ff_a64multi5_encoder;
|
||||||
|
+ extern AVCodec ff_aasc_decoder;
|
||||||
|
+@@ -792,9 +796,6 @@ extern AVCodec ff_h264_cuvid_decoder;
|
||||||
|
+ extern AVCodec ff_h264_mf_encoder;
|
||||||
|
+ extern AVCodec ff_h264_nvenc_encoder;
|
||||||
|
+ extern AVCodec ff_h264_omx_encoder;
|
||||||
|
+-extern AVCodec ff_h264_omx_decoder;
|
||||||
|
+-extern AVCodec ff_hevc_omx_encoder;
|
||||||
|
+-extern AVCodec ff_hevc_omx_decoder;
|
||||||
|
+ extern AVCodec ff_h264_qsv_encoder;
|
||||||
|
+ extern AVCodec ff_h264_v4l2m2m_encoder;
|
||||||
|
+ extern AVCodec ff_h264_vaapi_encoder;
|
||||||
|
+@@ -817,7 +818,6 @@ extern AVCodec ff_libkvazaar_encoder;
|
||||||
|
+ extern AVCodec ff_mjpeg_cuvid_decoder;
|
||||||
|
+ extern AVCodec ff_mjpeg_qsv_encoder;
|
||||||
|
+ extern AVCodec ff_mjpeg_qsv_decoder;
|
||||||
|
+-extern AVCodec ff_mjpeg_omx_decoder;
|
||||||
|
+ extern AVCodec ff_mjpeg_vaapi_encoder;
|
||||||
|
+ extern AVCodec ff_mp3_mf_encoder;
|
||||||
|
+ extern AVCodec ff_mpeg1_cuvid_decoder;
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index c518542..afcba9b 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -34,6 +34,7 @@
|
||||||
|
+ #include <stdlib.h>
|
||||||
|
+ #include <sys/time.h>
|
||||||
|
+
|
||||||
|
++#include "libavcodec/decode.h"
|
||||||
|
+ #include "libavutil/avstring.h"
|
||||||
|
+ #include "libavutil/avutil.h"
|
||||||
|
+ #include "libavutil/common.h"
|
||||||
|
+@@ -355,6 +356,7 @@ typedef struct OMXCodecContext {
|
||||||
|
+ int eos_sent, got_eos, evnet_bufferflag, first_get_outbuffer;
|
||||||
|
+
|
||||||
|
+ int extradata_sent;
|
||||||
|
++ int has_cleanup;
|
||||||
|
+
|
||||||
|
+ uint8_t *output_buf;
|
||||||
|
+ int output_buf_size;
|
||||||
|
+@@ -943,6 +945,7 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
|
||||||
|
+ static av_cold void cleanup(OMXCodecContext *s)
|
||||||
|
+ {
|
||||||
|
+ int i, executing;
|
||||||
|
++ OMX_BUFFERHEADERTYPE *buffer;
|
||||||
|
+
|
||||||
|
+ pthread_mutex_lock(&s->state_mutex);
|
||||||
|
+ executing = s->state == OMX_StateExecuting;
|
||||||
|
+@@ -953,17 +956,24 @@ static av_cold void cleanup(OMXCodecContext *s)
|
||||||
|
+ wait_for_state(s, OMX_StateIdle);
|
||||||
|
+ OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL);
|
||||||
|
+ for (i = 0; i < s->num_in_buffers; i++) {
|
||||||
|
+- OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->input_mutex, &s->input_cond,
|
||||||
|
++ buffer = get_buffer(&s->input_mutex, &s->input_cond,
|
||||||
|
+ &s->num_free_in_buffers, s->free_in_buffers, 1);
|
||||||
|
+ if (s->input_zerocopy)
|
||||||
|
+ buffer->pBuffer = NULL;
|
||||||
|
+ OMX_FreeBuffer(s->handle, s->in_port, buffer);
|
||||||
|
+ }
|
||||||
|
+- for (i = 0; i < s->num_out_buffers; i++) {
|
||||||
|
+- OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->output_mutex, &s->output_cond,
|
||||||
|
+- &s->num_done_out_buffers, s->done_out_buffers, 1);
|
||||||
|
++
|
||||||
|
++ while (buffer = get_buffer(&s->output_mutex, &s->output_cond,
|
||||||
|
++ &s->num_done_out_buffers, s->done_out_buffers, 0)) {
|
||||||
|
+ OMX_FreeBuffer(s->handle, s->out_port, buffer);
|
||||||
|
++ s->num_out_buffers--;
|
||||||
|
++ }
|
||||||
|
++
|
||||||
|
++ if (s->num_out_buffers) {
|
||||||
|
++ s->has_cleanup = 1;
|
||||||
|
++ return;
|
||||||
|
+ }
|
||||||
|
++
|
||||||
|
+ wait_for_state(s, OMX_StateLoaded);
|
||||||
|
+ }
|
||||||
|
+ if (s->handle) {
|
||||||
|
+@@ -1099,6 +1109,94 @@ fail:
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
++static void omx_free_out_buffer(void *opaque, uint8_t *unused)
|
||||||
|
++{
|
||||||
|
++ OMX_ERRORTYPE err;
|
||||||
|
++ OMX_BUFFERHEADERTYPE *buffer = opaque;
|
||||||
|
++ OMXCodecContext *s = buffer->pAppPrivate;
|
||||||
|
++
|
||||||
|
++ if (!s->has_cleanup) {
|
||||||
|
++ err = OMX_FillThisBuffer(s->handle, buffer);
|
||||||
|
++ if (err != OMX_ErrorNone) {
|
||||||
|
++ append_buffer(&s->output_mutex, &s->output_cond, &s->num_done_out_buffers, s->done_out_buffers, buffer);
|
||||||
|
++ av_log(s->avctx, AV_LOG_ERROR, "OMX_FillThisBuffer failed, err: %x\n", err);
|
||||||
|
++ }
|
||||||
|
++ } else {
|
||||||
|
++ OMX_FreeBuffer(s->handle, s->out_port, buffer);
|
||||||
|
++ s->num_out_buffers--;
|
||||||
|
++ if (!s->num_out_buffers) {
|
||||||
|
++ wait_for_state(s, OMX_StateLoaded);
|
||||||
|
++ if (s->handle) {
|
||||||
|
++ s->omx_context->ptr_FreeHandle(s->handle);
|
||||||
|
++ s->handle = NULL;
|
||||||
|
++ }
|
||||||
|
++
|
||||||
|
++ omx_deinit(s->omx_context);
|
||||||
|
++ s->omx_context = NULL;
|
||||||
|
++ if (s->mutex_cond_inited) {
|
||||||
|
++ pthread_cond_destroy(&s->state_cond);
|
||||||
|
++ pthread_mutex_destroy(&s->state_mutex);
|
||||||
|
++ pthread_cond_destroy(&s->input_cond);
|
||||||
|
++ pthread_mutex_destroy(&s->input_mutex);
|
||||||
|
++ pthread_cond_destroy(&s->output_cond);
|
||||||
|
++ pthread_mutex_destroy(&s->output_mutex);
|
||||||
|
++ pthread_cond_destroy(&s->disableEVnt_cond);
|
||||||
|
++ pthread_mutex_destroy(&s->disableEVnt_mutex);
|
||||||
|
++ s->mutex_cond_inited = 0;
|
||||||
|
++ }
|
||||||
|
++ OMXDecodeQueueDestory(&s->decode_pts_queue);
|
||||||
|
++ av_freep(&s->decode_pts_queue);
|
||||||
|
++ av_freep(&s->in_buffer_headers);
|
||||||
|
++ av_freep(&s->out_buffer_headers);
|
||||||
|
++ av_freep(&s->free_in_buffers);
|
||||||
|
++ av_freep(&s->done_out_buffers);
|
||||||
|
++ av_freep(&s->output_buf);
|
||||||
|
++ }
|
||||||
|
++ }
|
||||||
|
++}
|
||||||
|
++
|
||||||
|
++static int omx_buf_to_swframe(OMXCodecContext *s, AVFrame *frame, OMX_BUFFERHEADERTYPE *buffer)
|
||||||
|
++{
|
||||||
|
++ int ret;
|
||||||
|
++ uint8_t *dst[4];
|
||||||
|
++ int linesize[4];
|
||||||
|
++
|
||||||
|
++ frame->buf[0] = av_buffer_create((char *)buffer->pBuffer, buffer->nFilledLen, omx_free_out_buffer, buffer, 0);
|
||||||
|
++
|
||||||
|
++ if (!frame->buf[0])
|
||||||
|
++ return AVERROR(ENOMEM);
|
||||||
|
++
|
||||||
|
++ ret = av_image_fill_arrays(dst, linesize, buffer->pBuffer,
|
||||||
|
++ s->avctx->pix_fmt, s->stride, s->plane_size, 1);
|
||||||
|
++ if (ret < 0){
|
||||||
|
++ av_log(s->avctx, AV_LOG_ERROR, "av_image_fill_arrays ret:%d\n", ret);
|
||||||
|
++ return AVERROR(EINVAL);
|
||||||
|
++ }
|
||||||
|
++
|
||||||
|
++ frame->linesize[0] = linesize[0];
|
||||||
|
++ frame->data[0] = frame->buf[0]->data;
|
||||||
|
++
|
||||||
|
++ /* fixup special cases */
|
||||||
|
++ switch (s->avctx->pix_fmt) {
|
||||||
|
++ case AV_PIX_FMT_NV12:
|
||||||
|
++ case AV_PIX_FMT_NV21:
|
||||||
|
++ frame->linesize[1] = linesize[1];
|
||||||
|
++ frame->data[1] = dst[1];
|
||||||
|
++ break;
|
||||||
|
++
|
||||||
|
++ case AV_PIX_FMT_YUV420P:
|
||||||
|
++ frame->linesize[1] = linesize[1];
|
||||||
|
++ frame->linesize[2] = linesize[2];
|
||||||
|
++ frame->data[1] = dst[1];
|
||||||
|
++ frame->data[2] = dst[2];
|
||||||
|
++ break;
|
||||||
|
++
|
||||||
|
++ default:
|
||||||
|
++ break;
|
||||||
|
++ }
|
||||||
|
++
|
||||||
|
++ return 0;
|
||||||
|
++}
|
||||||
|
+
|
||||||
|
+ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ int *got_packet, AVPacket *pkt)
|
||||||
|
+@@ -1111,9 +1209,6 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+
|
||||||
|
+ AVFrame *avframe = data;
|
||||||
|
+
|
||||||
|
+- uint8_t *dst[4];
|
||||||
|
+- int linesize[4];
|
||||||
|
+-
|
||||||
|
+ av_log(avctx, AV_LOG_VERBOSE, "s->decode_flag: %d\n", s->decode_flag);
|
||||||
|
+ av_log(avctx, AV_LOG_VERBOSE, "avctx->time_base: %d/%d \n", avctx->time_base.num, avctx->time_base.den);
|
||||||
|
+ av_log(avctx, AV_LOG_VERBOSE, "avctx->pkt_timebase: %d/%d \n", avctx->pkt_timebase.num, avctx->pkt_timebase.den);
|
||||||
|
+@@ -1226,20 +1321,21 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ if (buffer->nFlags & OMX_BUFFERFLAG_EOS)
|
||||||
|
+ s->got_eos = 1;
|
||||||
|
+
|
||||||
|
+- if ((ret = ff_get_buffer(avctx, avframe, 0)) < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
|
||||||
|
++ avframe->width = avctx->width;
|
||||||
|
++ avframe->height = avctx->height;
|
||||||
|
++
|
||||||
|
++ ret = ff_decode_frame_props(avctx, avframe);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to fill buffer props\n");
|
||||||
|
+ goto end;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+- ret = av_image_fill_arrays(dst, linesize, buffer->pBuffer,
|
||||||
|
+- avctx->pix_fmt, s->stride, s->plane_size, 1);
|
||||||
|
+- if (ret < 0){
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "av_image_fill_arrays ret:%d\n", ret);
|
||||||
|
++ ret = omx_buf_to_swframe(s, avframe, buffer);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to alloce frame\n");
|
||||||
|
+ goto end;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+- av_image_copy(avframe->data, avframe->linesize, (const uint8_t**)dst, linesize,
|
||||||
|
+- avctx->pix_fmt, avctx->width, avctx->height);
|
||||||
|
+ if (pkt->pts) {
|
||||||
|
+ if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
+@@ -1251,10 +1347,7 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ s->decode_flag += 1;
|
||||||
|
+ *got_packet = 1;
|
||||||
|
+
|
||||||
|
+- /*
|
||||||
|
+- if ((ret = av_frame_ref(data, avframe)) < 0)
|
||||||
|
+- goto end;
|
||||||
|
+- */
|
||||||
|
++ return ret;
|
||||||
|
+
|
||||||
|
+ end:
|
||||||
|
+ err = OMX_FillThisBuffer(s->handle, buffer);
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,51 @@
|
||||||
|
From 59eab933575e0deb0ab95b1f6885b9323d710564 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:16:39 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: Fix omx decoder fill frames pts incorrect
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...mx-decoder-fill-frames-pts-incorrect.patch | 34 +++++++++++++++++++
|
||||||
|
1 file changed, 34 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0024-Fix-omx-decoder-fill-frames-pts-incorrect.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0024-Fix-omx-decoder-fill-frames-pts-incorrect.patch b/package/ffmpeg/0024-Fix-omx-decoder-fill-frames-pts-incorrect.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4dbf13a
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0024-Fix-omx-decoder-fill-frames-pts-incorrect.patch
|
||||||
|
@@ -0,0 +1,34 @@
|
||||||
|
+From e0e6de3a210675444850c826bf5611b8d29228bf Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 13:47:48 +0800
|
||||||
|
+Subject: [PATCH 3/8] Fix omx decoder fill frames pts incorrect
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 10 +++++++++-
|
||||||
|
+ 1 file changed, 9 insertions(+), 1 deletion(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index afcba9b..f71e4bf 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -1217,7 +1217,15 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ pkt->size, pkt->pts, pkt->dts, pkt->duration);
|
||||||
|
+ av_log(avctx, AV_LOG_VERBOSE, "avctx->pts_correction_last_pts: %ld avctx->pts_correction_last_dts: %ld\n",
|
||||||
|
+ avctx->pts_correction_last_pts, avctx->pts_correction_last_dts);
|
||||||
|
+- OMXDecodeQueuePush(&s->decode_pts_queue, pkt->dts);
|
||||||
|
++ if (pkt->dts != AV_NOPTS_VALUE) {
|
||||||
|
++ OMXDecodeQueuePush(&s->decode_pts_queue, pkt->dts);
|
||||||
|
++ } else {
|
||||||
|
++ if (OMXDecodeQueueEmpty(&s->decode_pts_queue)) {
|
||||||
|
++ OMXDecodeQueuePush(&s->decode_pts_queue, 0);
|
||||||
|
++ } else {
|
||||||
|
++ OMXDecodeQueuePush(&s->decode_pts_queue, s->decode_pts_queue.tail->val + pkt->duration);
|
||||||
|
++ }
|
||||||
|
++ }
|
||||||
|
+ if (pkt->size) {
|
||||||
|
+
|
||||||
|
+ //VPU init and fill buffer slow, so empty buf sleep to send before get vpu fill buf.
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,123 @@
|
||||||
|
From b51388915b35d9bb4f9b75577d6ca05e76164900 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:17:35 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: Fix mjpg_omx buffer err
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
.../0025-Omxdec-Fix-mjpg_omx-buffer-err.patch | 106 ++++++++++++++++++
|
||||||
|
1 file changed, 106 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0025-Omxdec-Fix-mjpg_omx-buffer-err.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0025-Omxdec-Fix-mjpg_omx-buffer-err.patch b/package/ffmpeg/0025-Omxdec-Fix-mjpg_omx-buffer-err.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..b3a3ec9
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0025-Omxdec-Fix-mjpg_omx-buffer-err.patch
|
||||||
|
@@ -0,0 +1,106 @@
|
||||||
|
+From e3866de00ce3b6508c7636c9f96b1b1dfeab530a Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 13:50:10 +0800
|
||||||
|
+Subject: [PATCH 4/8] Omxdec: Fix mjpg_omx buffer err
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 77 ++++++++++++++++++++++++++++++++-------------
|
||||||
|
+ 1 file changed, 55 insertions(+), 22 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index f71e4bf..05e37d0 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -1329,33 +1329,66 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ if (buffer->nFlags & OMX_BUFFERFLAG_EOS)
|
||||||
|
+ s->got_eos = 1;
|
||||||
|
+
|
||||||
|
+- avframe->width = avctx->width;
|
||||||
|
+- avframe->height = avctx->height;
|
||||||
|
++ if (avctx->codec->id == AV_CODEC_ID_HEVC ||
|
||||||
|
++ avctx->codec->id == AV_CODEC_ID_H264) {
|
||||||
|
++ avframe->width = avctx->width;
|
||||||
|
++ avframe->height = avctx->height;
|
||||||
|
++
|
||||||
|
++ ret = ff_decode_frame_props(avctx, avframe);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to fill buffer props\n");
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
+
|
||||||
|
+- ret = ff_decode_frame_props(avctx, avframe);
|
||||||
|
+- if(ret < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to fill buffer props\n");
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
++ ret = omx_buf_to_swframe(s, avframe, buffer);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to alloce frame\n");
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
+
|
||||||
|
+- ret = omx_buf_to_swframe(s, avframe, buffer);
|
||||||
|
+- if(ret < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to alloce frame\n");
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
++ if (pkt->pts) {
|
||||||
|
++ if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
++ return AVERROR_INVALIDDATA;
|
||||||
|
++ }
|
||||||
|
++ avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
++ OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
++ }
|
||||||
|
++ s->decode_flag += 1;
|
||||||
|
++ *got_packet = 1;
|
||||||
|
+
|
||||||
|
+- if (pkt->pts) {
|
||||||
|
+- if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
+- return AVERROR_INVALIDDATA;
|
||||||
|
++ return ret;
|
||||||
|
++
|
||||||
|
++ } else if (avctx->codec->id == AV_CODEC_ID_MPEG4 ||
|
||||||
|
++ avctx->codec->id == AV_CODEC_ID_MJPEG) {
|
||||||
|
++
|
||||||
|
++ uint8_t *dst[4];
|
||||||
|
++ int linesize[4];
|
||||||
|
++ if ((ret = ff_get_buffer(avctx, avframe, 0)) < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
++
|
||||||
|
++ ret = av_image_fill_arrays(dst, linesize, buffer->pBuffer,
|
||||||
|
++ avctx->pix_fmt, s->stride, s->plane_size, 1);
|
||||||
|
++ if (ret < 0){
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "av_image_fill_arrays ret:%d\n", ret);
|
||||||
|
++ goto end;
|
||||||
|
+ }
|
||||||
|
+- avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
+- OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
+- }
|
||||||
|
+- s->decode_flag += 1;
|
||||||
|
+- *got_packet = 1;
|
||||||
|
+
|
||||||
|
+- return ret;
|
||||||
|
++ av_image_copy(avframe->data, avframe->linesize, (const uint8_t**)dst, linesize,
|
||||||
|
++ avctx->pix_fmt, avctx->width, avctx->height);
|
||||||
|
++ if (pkt->pts) {
|
||||||
|
++ if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
++ return AVERROR_INVALIDDATA;
|
||||||
|
++ }
|
||||||
|
++ avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
++ OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
++ }
|
||||||
|
++ s->decode_flag += 1;
|
||||||
|
++ *got_packet = 1;
|
||||||
|
++ }
|
||||||
|
+
|
||||||
|
+ end:
|
||||||
|
+ err = OMX_FillThisBuffer(s->handle, buffer);
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,105 @@
|
||||||
|
From 1a5884d35661faa535a438317bb5ca204245529e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:18:25 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: Add flush callback of sf omx decoder
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...Add-flush-callback-of-sf-omx-decoder.patch | 88 +++++++++++++++++++
|
||||||
|
1 file changed, 88 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0026-Omxdec-Add-flush-callback-of-sf-omx-decoder.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0026-Omxdec-Add-flush-callback-of-sf-omx-decoder.patch b/package/ffmpeg/0026-Omxdec-Add-flush-callback-of-sf-omx-decoder.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..ec4bafe
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0026-Omxdec-Add-flush-callback-of-sf-omx-decoder.patch
|
||||||
|
@@ -0,0 +1,88 @@
|
||||||
|
+From b8af55868ea8b2b68ef06fee2eb8a19b16fdb79d Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 13:53:57 +0800
|
||||||
|
+Subject: [PATCH 5/8] Omxdec: Add flush callback of sf omx decoder
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 22 ++++++++++++++++++++++
|
||||||
|
+ 1 file changed, 22 insertions(+)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index 05e37d0..d268454 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -365,6 +365,7 @@ typedef struct OMXCodecContext {
|
||||||
|
+ OMX_U32 scale_height;
|
||||||
|
+ OMX_U32 rotation;
|
||||||
|
+ OMX_U32 mirror;
|
||||||
|
++ OMX_U32 skip;
|
||||||
|
+ char *crop_expr;
|
||||||
|
+ struct {
|
||||||
|
+ int x;
|
||||||
|
+@@ -1310,6 +1311,11 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
++
|
||||||
|
++ if(s->skip) {
|
||||||
|
++ s->skip--;
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
+ //if (!buffer)
|
||||||
|
+ // break;
|
||||||
|
+ // if(!s->first_get_outbuffer)
|
||||||
|
+@@ -1401,6 +1407,18 @@ end:
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
++static void omx_decode_flush(AVCodecContext *avctx)
|
||||||
|
++{
|
||||||
|
++ OMXCodecContext *s = avctx->priv_data;
|
||||||
|
++
|
||||||
|
++ av_log(avctx, AV_LOG_VERBOSE, "Flushing buffer\n");
|
||||||
|
++
|
||||||
|
++ while(!OMXDecodeQueueEmpty(&s->decode_pts_queue)) {
|
||||||
|
++ OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
++ s->skip++;
|
||||||
|
++ }
|
||||||
|
++}
|
||||||
|
++
|
||||||
|
+ static av_cold int omx_decode_end(AVCodecContext *avctx)
|
||||||
|
+ {
|
||||||
|
+ OMXCodecContext *s = avctx->priv_data;
|
||||||
|
+@@ -1465,6 +1483,7 @@ AVCodec ff_mpeg4_omx_decoder = {
|
||||||
|
+ .init = omx_decode_init,
|
||||||
|
+ .decode = omx_decode_frame,
|
||||||
|
+ .close = omx_decode_end,
|
||||||
|
++ .flush = omx_decode_flush,
|
||||||
|
+ .capabilities = AV_CODEC_CAP_DELAY,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+ .priv_class = &omx_mpeg4dec_class,
|
||||||
|
+@@ -1485,6 +1504,7 @@ AVCodec ff_h264_omx_decoder = {
|
||||||
|
+ .init = omx_decode_init,
|
||||||
|
+ .decode = omx_decode_frame,
|
||||||
|
+ .close = omx_decode_end,
|
||||||
|
++ .flush = omx_decode_flush,
|
||||||
|
+ .capabilities = AV_CODEC_CAP_DELAY,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+ .priv_class = &omx_h264dec_class,
|
||||||
|
+@@ -1506,6 +1526,7 @@ AVCodec ff_hevc_omx_decoder = {
|
||||||
|
+ .init = omx_decode_init,
|
||||||
|
+ .decode = omx_decode_frame,
|
||||||
|
+ .close = omx_decode_end,
|
||||||
|
++ .flush = omx_decode_flush,
|
||||||
|
+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
|
||||||
|
+ .capabilities = AV_CODEC_CAP_DELAY,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+@@ -1528,6 +1549,7 @@ AVCodec ff_mjpeg_omx_decoder = {
|
||||||
|
+ .init = omx_decode_init,
|
||||||
|
+ .decode = omx_decode_frame,
|
||||||
|
+ .close = omx_decode_end,
|
||||||
|
++ .flush = omx_decode_flush,
|
||||||
|
+ .capabilities = AV_CODEC_CAP_DR1,
|
||||||
|
+ .max_lowres = 3,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,103 @@
|
||||||
|
From 53e3b80227f92f5611b88afdc4c7f1c086cdb1ae Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:20:24 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: Remove the global variables in omxdec
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...e-global-variables-in-omxdec-it-make.patch | 86 +++++++++++++++++++
|
||||||
|
1 file changed, 86 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0027-Omxdec-Remove-the-global-variables-in-omxdec-it-make.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0027-Omxdec-Remove-the-global-variables-in-omxdec-it-make.patch b/package/ffmpeg/0027-Omxdec-Remove-the-global-variables-in-omxdec-it-make.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..ed72fc1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0027-Omxdec-Remove-the-global-variables-in-omxdec-it-make.patch
|
||||||
|
@@ -0,0 +1,86 @@
|
||||||
|
+From d44bd33ca4fa0975f284279916f8709282bfe020 Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 13:57:24 +0800
|
||||||
|
+Subject: [PATCH 6/8] Omxdec: Remove the global variables in omxdec, it make
|
||||||
|
+ issue in mutithread.
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 25 ++++++++++++-------------
|
||||||
|
+ 1 file changed, 12 insertions(+), 13 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index d268454..aa3ddea 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -48,10 +48,6 @@
|
||||||
|
+ #include "internal.h"
|
||||||
|
+ #include "profiles.h"
|
||||||
|
+
|
||||||
|
+-int evnet_bufferflag;
|
||||||
|
+-int dec_out_height;
|
||||||
|
+-int dec_out_width;
|
||||||
|
+-int dec_pix_fmt;
|
||||||
|
+
|
||||||
|
+ #ifdef OMX_SKIP64BIT
|
||||||
|
+ static OMX_TICKS to_omx_ticks(int64_t value)
|
||||||
|
+@@ -354,6 +350,9 @@ typedef struct OMXCodecContext {
|
||||||
|
+ int mutex_cond_inited;
|
||||||
|
+
|
||||||
|
+ int eos_sent, got_eos, evnet_bufferflag, first_get_outbuffer;
|
||||||
|
++ int dec_out_height;
|
||||||
|
++ int dec_out_width;
|
||||||
|
++ int dec_pix_fmt;
|
||||||
|
+
|
||||||
|
+ int extradata_sent;
|
||||||
|
+ int has_cleanup;
|
||||||
|
+@@ -475,11 +474,11 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ }
|
||||||
|
+ if (port_params.eDir == OMX_DirOutput) {
|
||||||
|
+ out_port_params = port_params;
|
||||||
|
+- dec_out_width = out_port_params.format.video.nFrameWidth;
|
||||||
|
+- dec_out_height = out_port_params.format.video.nFrameHeight;
|
||||||
|
+- dec_pix_fmt = out_port_params.format.video.eColorFormat;
|
||||||
|
++ s->dec_out_width = out_port_params.format.video.nFrameWidth;
|
||||||
|
++ s->dec_out_height = out_port_params.format.video.nFrameHeight;
|
||||||
|
++ s->dec_pix_fmt = out_port_params.format.video.eColorFormat;
|
||||||
|
+
|
||||||
|
+- av_log(s->avctx, AV_LOG_VERBOSE, "w:%d, h:%d, fmt:%d\n", dec_out_width, dec_out_height, dec_pix_fmt);
|
||||||
|
++ av_log(s->avctx, AV_LOG_VERBOSE, "w:%d, h:%d, fmt:%d\n", s->dec_out_width, s->dec_out_height, s->dec_pix_fmt);
|
||||||
|
+ if (!s->num_out_buffers) {
|
||||||
|
+ s->num_out_buffers = out_port_params.nBufferCountActual;
|
||||||
|
+ s->out_buffer_headers = av_mallocz(sizeof(OMX_BUFFERHEADERTYPE*) * s->num_out_buffers);
|
||||||
|
+@@ -511,7 +510,7 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ break;
|
||||||
|
+ case OMX_EventBufferFlag:
|
||||||
|
+ av_log(s->avctx, AV_LOG_VERBOSE, "OMX decoder competd set event_bufferflag\n");
|
||||||
|
+- evnet_bufferflag = 1;
|
||||||
|
++ s->evnet_bufferflag = 1;
|
||||||
|
+ default:
|
||||||
|
+ av_log(s->avctx, AV_LOG_VERBOSE, "OMX event %d %"PRIx32" %"PRIx32"\n",
|
||||||
|
+ event, (uint32_t) data1, (uint32_t) data2);
|
||||||
|
+@@ -1306,7 +1305,7 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ /*eos is sent wait for vpu evnet_bufferflag to get all frames
|
||||||
|
+ mjpeg: sent a frame, then wait for a decoder frame
|
||||||
|
+ */
|
||||||
|
+- if((s->eos_sent && !evnet_bufferflag) || (avctx->codec_id == AV_CODEC_ID_MJPEG )) {
|
||||||
|
++ if((s->eos_sent && !s->evnet_bufferflag) || (avctx->codec_id == AV_CODEC_ID_MJPEG )) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+@@ -1326,9 +1325,9 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ goto end;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+- avctx->width = dec_out_width;
|
||||||
|
+- avctx->height = dec_out_height;
|
||||||
|
+- avctx->pix_fmt = omx_map_color_format(avctx, dec_pix_fmt);
|
||||||
|
++ avctx->width = s->dec_out_width;
|
||||||
|
++ avctx->height = s->dec_out_height;
|
||||||
|
++ avctx->pix_fmt = omx_map_color_format(avctx, s->dec_pix_fmt);
|
||||||
|
+ s->stride = avctx->width;
|
||||||
|
+ s->plane_size = avctx->height;
|
||||||
|
+
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,77 @@
|
||||||
|
From 35d7d79f30dc91e48d7e29e0c72ab4f8229c4475 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:21:58 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: no longer send eos when processing zero size
|
||||||
|
pkt
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...-send-eos-when-processing-zero-size-.patch | 59 +++++++++++++++++++
|
||||||
|
1 file changed, 59 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0028-Omxdec-no-longer-send-eos-when-processing-zero-size-.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0028-Omxdec-no-longer-send-eos-when-processing-zero-size-.patch b/package/ffmpeg/0028-Omxdec-no-longer-send-eos-when-processing-zero-size-.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..32b4643
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0028-Omxdec-no-longer-send-eos-when-processing-zero-size-.patch
|
||||||
|
@@ -0,0 +1,59 @@
|
||||||
|
+From d9ac2081cfb04a0d519e9bf57b6b68d12eefadb0 Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 13:59:25 +0800
|
||||||
|
+Subject: [PATCH 7/8] Omxdec: no longer send eos when processing zero size pkt
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 28 +---------------------------
|
||||||
|
+ 1 file changed, 1 insertion(+), 27 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index aa3ddea..47fb482 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -1268,29 +1268,6 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err);
|
||||||
|
+ return AVERROR_UNKNOWN;
|
||||||
|
+ }
|
||||||
|
+- } else if (!s->eos_sent) {
|
||||||
|
+-
|
||||||
|
+- // if(!s->first_get_outbuffer)
|
||||||
|
+- // av_usleep(1000000);
|
||||||
|
+- buffer = get_buffer(&s->input_mutex, &s->input_cond,
|
||||||
|
+- &s->num_free_in_buffers, s->free_in_buffers, 1);
|
||||||
|
+-
|
||||||
|
+- if(!buffer) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "get_buffer NULL\n");
|
||||||
|
+- return AVERROR(ENOMEM);
|
||||||
|
+- }
|
||||||
|
+-
|
||||||
|
+- buffer->nFilledLen = 0;
|
||||||
|
+- buffer->nFlags = OMX_BUFFERFLAG_EOS;
|
||||||
|
+- buffer->pAppPrivate = buffer->pOutputPortPrivate = NULL;
|
||||||
|
+-
|
||||||
|
+- err = OMX_EmptyThisBuffer(s->handle, buffer);
|
||||||
|
+- if (err != OMX_ErrorNone) {
|
||||||
|
+- append_buffer(&s->input_mutex, &s->input_cond, &s->num_free_in_buffers, s->free_in_buffers, buffer);
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err);
|
||||||
|
+- return AVERROR_UNKNOWN;
|
||||||
|
+- }
|
||||||
|
+- s->eos_sent = 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ while (!*got_packet && ret == 0 && !s->got_eos) {
|
||||||
|
+@@ -1302,10 +1279,7 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ !pkt || had_partial);
|
||||||
|
+
|
||||||
|
+ if (!buffer) {
|
||||||
|
+- /*eos is sent wait for vpu evnet_bufferflag to get all frames
|
||||||
|
+- mjpeg: sent a frame, then wait for a decoder frame
|
||||||
|
+- */
|
||||||
|
+- if((s->eos_sent && !s->evnet_bufferflag) || (avctx->codec_id == AV_CODEC_ID_MJPEG )) {
|
||||||
|
++ if( avctx->codec_id == AV_CODEC_ID_MJPEG ) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -0,0 +1,167 @@
|
||||||
|
From 8b780ddcc7a4ca122a5e1c2d8d749909162fb686 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
Date: Fri, 4 Aug 2023 14:22:40 +0800
|
||||||
|
Subject: [PATCH] FFmpeg: Omxdec: optimize buffer method for mjpg decoder
|
||||||
|
|
||||||
|
Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
---
|
||||||
|
...imize-buffer-method-for-mjpg-decoder.patch | 150 ++++++++++++++++++
|
||||||
|
1 file changed, 150 insertions(+)
|
||||||
|
create mode 100644 package/ffmpeg/0029-Omxdec-optimize-buffer-method-for-mjpg-decoder.patch
|
||||||
|
|
||||||
|
diff --git a/package/ffmpeg/0029-Omxdec-optimize-buffer-method-for-mjpg-decoder.patch b/package/ffmpeg/0029-Omxdec-optimize-buffer-method-for-mjpg-decoder.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..f922b69
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/ffmpeg/0029-Omxdec-optimize-buffer-method-for-mjpg-decoder.patch
|
||||||
|
@@ -0,0 +1,150 @@
|
||||||
|
+From cc356de583854b257b52b8bf79eb519b7da34c9d Mon Sep 17 00:00:00 2001
|
||||||
|
+From: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+Date: Fri, 4 Aug 2023 14:02:26 +0800
|
||||||
|
+Subject: [PATCH 8/8] Omxdec: optimize buffer method for mjpg decoder
|
||||||
|
+
|
||||||
|
+Signed-off-by: Som Qin <som.qin@starfivetech.com>
|
||||||
|
+---
|
||||||
|
+ libavcodec/omxdec.c | 88 +++++++++++++++------------------------------
|
||||||
|
+ 1 file changed, 28 insertions(+), 60 deletions(-)
|
||||||
|
+
|
||||||
|
+diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
|
||||||
|
+index 47fb482..b38e3b9 100755
|
||||||
|
+--- a/libavcodec/omxdec.c
|
||||||
|
++++ b/libavcodec/omxdec.c
|
||||||
|
+@@ -437,7 +437,8 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
|
||||||
|
+ if (data1 == OMX_CommandStateSet) {
|
||||||
|
+ pthread_mutex_lock(&s->state_mutex);
|
||||||
|
+ s->state = data2;
|
||||||
|
+- av_log(s->avctx, AV_LOG_VERBOSE, "OMX state changed to %"PRIu32"\n", (uint32_t) data2);
|
||||||
|
++ if (!s->has_cleanup)
|
||||||
|
++ av_log(s->avctx, AV_LOG_VERBOSE, "OMX state changed to %"PRIu32"\n", (uint32_t) data2);
|
||||||
|
+ pthread_cond_broadcast(&s->state_cond);
|
||||||
|
+ pthread_mutex_unlock(&s->state_mutex);
|
||||||
|
+ } else if (data1 == OMX_CommandPortDisable) {
|
||||||
|
+@@ -1180,11 +1181,14 @@ static int omx_buf_to_swframe(OMXCodecContext *s, AVFrame *frame, OMX_BUFFERHEAD
|
||||||
|
+ switch (s->avctx->pix_fmt) {
|
||||||
|
+ case AV_PIX_FMT_NV12:
|
||||||
|
+ case AV_PIX_FMT_NV21:
|
||||||
|
++ case AV_PIX_FMT_NV16:
|
||||||
|
+ frame->linesize[1] = linesize[1];
|
||||||
|
+ frame->data[1] = dst[1];
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case AV_PIX_FMT_YUV420P:
|
||||||
|
++ case AV_PIX_FMT_YUV422P:
|
||||||
|
++ case AV_PIX_FMT_YUV444P:
|
||||||
|
+ frame->linesize[1] = linesize[1];
|
||||||
|
+ frame->linesize[2] = linesize[2];
|
||||||
|
+ frame->data[1] = dst[1];
|
||||||
|
+@@ -1279,9 +1283,6 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ !pkt || had_partial);
|
||||||
|
+
|
||||||
|
+ if (!buffer) {
|
||||||
|
+- if( avctx->codec_id == AV_CODEC_ID_MJPEG ) {
|
||||||
|
+- continue;
|
||||||
|
+- }
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+@@ -1308,66 +1309,33 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
|
+ if (buffer->nFlags & OMX_BUFFERFLAG_EOS)
|
||||||
|
+ s->got_eos = 1;
|
||||||
|
+
|
||||||
|
+- if (avctx->codec->id == AV_CODEC_ID_HEVC ||
|
||||||
|
+- avctx->codec->id == AV_CODEC_ID_H264) {
|
||||||
|
+- avframe->width = avctx->width;
|
||||||
|
+- avframe->height = avctx->height;
|
||||||
|
+-
|
||||||
|
+- ret = ff_decode_frame_props(avctx, avframe);
|
||||||
|
+- if(ret < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to fill buffer props\n");
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
+-
|
||||||
|
+- ret = omx_buf_to_swframe(s, avframe, buffer);
|
||||||
|
+- if(ret < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to alloce frame\n");
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
+-
|
||||||
|
+- if (pkt->pts) {
|
||||||
|
+- if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
+- return AVERROR_INVALIDDATA;
|
||||||
|
+- }
|
||||||
|
+- avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
+- OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
+- }
|
||||||
|
+- s->decode_flag += 1;
|
||||||
|
+- *got_packet = 1;
|
||||||
|
+-
|
||||||
|
+- return ret;
|
||||||
|
+-
|
||||||
|
+- } else if (avctx->codec->id == AV_CODEC_ID_MPEG4 ||
|
||||||
|
+- avctx->codec->id == AV_CODEC_ID_MJPEG) {
|
||||||
|
++ avframe->width = avctx->width;
|
||||||
|
++ avframe->height = avctx->height;
|
||||||
|
+
|
||||||
|
+- uint8_t *dst[4];
|
||||||
|
+- int linesize[4];
|
||||||
|
+- if ((ret = ff_get_buffer(avctx, avframe, 0)) < 0) {
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
++ ret = ff_decode_frame_props(avctx, avframe);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to fill buffer props\n");
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
+
|
||||||
|
+- ret = av_image_fill_arrays(dst, linesize, buffer->pBuffer,
|
||||||
|
+- avctx->pix_fmt, s->stride, s->plane_size, 1);
|
||||||
|
+- if (ret < 0){
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "av_image_fill_arrays ret:%d\n", ret);
|
||||||
|
+- goto end;
|
||||||
|
+- }
|
||||||
|
++ ret = omx_buf_to_swframe(s, avframe, buffer);
|
||||||
|
++ if(ret < 0) {
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "Unable to alloce frame\n");
|
||||||
|
++ goto end;
|
||||||
|
++ }
|
||||||
|
+
|
||||||
|
+- av_image_copy(avframe->data, avframe->linesize, (const uint8_t**)dst, linesize,
|
||||||
|
+- avctx->pix_fmt, avctx->width, avctx->height);
|
||||||
|
+- if (pkt->pts) {
|
||||||
|
+- if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
+- av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
+- return AVERROR_INVALIDDATA;
|
||||||
|
+- }
|
||||||
|
+- avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
+- OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
++ if (pkt->pts) {
|
||||||
|
++ if (OMXDecodeQueueEmpty(&s->decode_pts_queue) != 0){
|
||||||
|
++ av_log(avctx, AV_LOG_ERROR, "The queue of decode pts is empty.\n");
|
||||||
|
++ return AVERROR_INVALIDDATA;
|
||||||
|
+ }
|
||||||
|
+- s->decode_flag += 1;
|
||||||
|
+- *got_packet = 1;
|
||||||
|
++ avframe->pts = OMXDecodeQueueFront(&s->decode_pts_queue);
|
||||||
|
++ OMXDecodeQueuePop(&s->decode_pts_queue);
|
||||||
|
+ }
|
||||||
|
++ s->decode_flag += 1;
|
||||||
|
++ *got_packet = 1;
|
||||||
|
++
|
||||||
|
++ return ret;
|
||||||
|
+
|
||||||
|
+ end:
|
||||||
|
+ err = OMX_FillThisBuffer(s->handle, buffer);
|
||||||
|
+@@ -1523,7 +1491,7 @@ AVCodec ff_mjpeg_omx_decoder = {
|
||||||
|
+ .decode = omx_decode_frame,
|
||||||
|
+ .close = omx_decode_end,
|
||||||
|
+ .flush = omx_decode_flush,
|
||||||
|
+- .capabilities = AV_CODEC_CAP_DR1,
|
||||||
|
++ .capabilities = AV_CODEC_CAP_DELAY,
|
||||||
|
+ .max_lowres = 3,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+ .priv_class = &omx_mjpegdec_class,
|
||||||
|
+--
|
||||||
|
+2.25.1
|
||||||
|
+
|
|
@ -2,9 +2,15 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
SRC_URI:append:jh7110 = "\
|
SRC_URI:append:jh7110 = "\
|
||||||
file://0002-add-Starfive-OMX-patches.patch \
|
file://0002-add-Starfive-OMX-patches.patch \
|
||||||
|
file://0001-FFmpeg-omxdec-optimize-with-omx-zero-copy-feature.patch \
|
||||||
|
file://0002-FFmpeg-omxdec-add-output-buffers-release-callback-to.patch \
|
||||||
|
file://0003-FFmpeg-Omxdec-Fix-omx-decoder-fill-frames-pts-incorr.patch \
|
||||||
|
file://0004-FFmpeg-Omxdec-Fix-mjpg_omx-buffer-err.patch \
|
||||||
|
file://0005-FFmpeg-Omxdec-Add-flush-callback-of-sf-omx-decoder.patch \
|
||||||
|
file://0006-FFmpeg-Omxdec-Remove-the-global-variables-in-omxdec.patch \
|
||||||
|
file://0007-FFmpeg-Omxdec-no-longer-send-eos-when-processing-zer.patch \
|
||||||
|
file://0008-FFmpeg-Omxdec-optimize-buffer-method-for-mjpg-decode.patch \
|
||||||
"
|
"
|
||||||
#file://0001-fix-chromium.patch
|
|
||||||
|
|
||||||
|
|
||||||
EXTRA_OECONF:append = " \
|
EXTRA_OECONF:append = " \
|
||||||
--enable-omx \
|
--enable-omx \
|
||||||
|
|
6
setup.sh
6
setup.sh
|
@ -25,12 +25,12 @@ echo "Setting up PinIx Yocto Build"
|
||||||
declare -A layers
|
declare -A layers
|
||||||
layers['poky']='git://git.yoctoproject.org/poky|kirkstone|fc697fe87412b9b179ae3a68d266ace85bb1fcc6'
|
layers['poky']='git://git.yoctoproject.org/poky|kirkstone|fc697fe87412b9b179ae3a68d266ace85bb1fcc6'
|
||||||
layers['meta-openembedded']='https://github.com/openembedded/meta-openembedded|kirkstone|529620141e773080a6a7be4615fb7993204af883'
|
layers['meta-openembedded']='https://github.com/openembedded/meta-openembedded|kirkstone|529620141e773080a6a7be4615fb7993204af883'
|
||||||
layers['meta-riscv']='https://github.com/Fishwaldo/meta-riscv.git|master|ea2bc5eb8f03e126ff4a132b7f160c57edde4adc'
|
layers['meta-riscv']='https://github.com/Fishwaldo/meta-riscv.git|master|7832236b10f9861307e2b47665df938d374b3d85'
|
||||||
layers['meta-qt5']='https://github.com/meta-qt5/meta-qt5.git|master|cf6ffcbad5275a3428f6046468a0c9d572e813d1'
|
layers['meta-qt5']='https://github.com/meta-qt5/meta-qt5.git|master|cf6ffcbad5275a3428f6046468a0c9d572e813d1'
|
||||||
layers['yocto-meta-kf5']='https://github.com/Fishwaldo/yocto-meta-kf5.git|master|2ade15ab47e3c9ec7ae2b42f519cedd546c699f6'
|
layers['yocto-meta-kf5']='https://github.com/Fishwaldo/yocto-meta-kf5.git|master|185899c499a8377aa0f304b3760238658438dd1d'
|
||||||
layers['yocto-meta-kde']='https://github.com/Fishwaldo/yocto-meta-kde.git|master|898ad0cd1139d5d0a7d923267357117d55baec72'
|
layers['yocto-meta-kde']='https://github.com/Fishwaldo/yocto-meta-kde.git|master|898ad0cd1139d5d0a7d923267357117d55baec72'
|
||||||
layers['meta-python2']='https://git.openembedded.org/meta-python2|kirkstone|f02882e2aa9279ca7becca8d0cedbffe88b5a253'
|
layers['meta-python2']='https://git.openembedded.org/meta-python2|kirkstone|f02882e2aa9279ca7becca8d0cedbffe88b5a253'
|
||||||
layers['meta-kde-gear']='https://github.com/Fishwaldo/meta-kde-gear.git|master|3a60d49cc73fdee35831155152b315a0e2b91045'
|
layers['meta-kde-gear']='https://github.com/Fishwaldo/meta-kde-gear.git|master|e660c69a255cf66bc9d4092e6e0c3a271d1e22ca'
|
||||||
layers['meta-clang']='https://github.com/kraj/meta-clang.git|kirkstone|71321ddf78ea522b87a6b4bffefb14c988a6d921'
|
layers['meta-clang']='https://github.com/kraj/meta-clang.git|kirkstone|71321ddf78ea522b87a6b4bffefb14c988a6d921'
|
||||||
layers['meta-lts-rust']='https://git.yoctoproject.org/git/meta-lts-mixins|kirkstone/rust-1.68|feed1bb0eb4aefb701d582156d7defb0c1fc0473'
|
layers['meta-lts-rust']='https://git.yoctoproject.org/git/meta-lts-mixins|kirkstone/rust-1.68|feed1bb0eb4aefb701d582156d7defb0c1fc0473'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue