mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Add HW video engine support (#179)
* Add Cedar HW video decoder support * Add sunxifbsink gstreamer plugin * sunxifbsink: remove warning log gst-omx: remove resolution check after crop * Add gstreamer scripts * review comments fixes * ffmpeg: enable h264_omx encoder * add missing hashes and use defined git commit for libcedar * mv miyoo specific patches to board * make `gst-omx.mk` less platform specfic * Add header python interpreter to gst-raw.py * Add videoscale with nearest-neighbour to play video with higher resolutions fluently * Use HW scaler * libcedarc: fix crash when playing 640x480 video * kernel: Add patch to increase VRAM * Add fast gstreamer player * fix gst-play hangs * Add matroska plugin * remove target --------- Co-authored-by: Apaczer <94932128+Apaczer@users.noreply.github.com>
This commit is contained in:
38
board/miyoo/kernel/patch/musl/0001-enable-cedar.patch
Normal file
38
board/miyoo/kernel/patch/musl/0001-enable-cedar.patch
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
diff --git a/arch/arm/configs/miyoo_defconfig b/arch/arm/configs/miyoo_defconfig
|
||||||
|
index f9cb0790f..625b5a30f 100644
|
||||||
|
--- a/arch/arm/configs/miyoo_defconfig
|
||||||
|
+++ b/arch/arm/configs/miyoo_defconfig
|
||||||
|
@@ -83,6 +83,12 @@ CONFIG_SUNXI_WATCHDOG=y
|
||||||
|
CONFIG_MFD_SYSCON=y
|
||||||
|
CONFIG_REGULATOR=y
|
||||||
|
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||||
|
+# CONFIG_MEDIA_CEC_SUPPORT is not set
|
||||||
|
+CONFIG_MEDIA_SUPPORT=y
|
||||||
|
+# CONFIG_VIDEO_DEV is not set
|
||||||
|
+# CONFIG_MEDIA_CONTROLLER is not set
|
||||||
|
+# CONFIG_DVB_NET is not set
|
||||||
|
+# CONFIG_DVB_DYNAMIC_MINORS is not set
|
||||||
|
CONFIG_FB=y
|
||||||
|
CONFIG_FB_MIYOO_VIDEO=y
|
||||||
|
CONFIG_FB_R61520=m
|
||||||
|
@@ -122,6 +128,10 @@ CONFIG_USB_CONFIGFS_F_HID=y
|
||||||
|
CONFIG_MMC=y
|
||||||
|
CONFIG_MMC_SUNXI=y
|
||||||
|
CONFIG_STAGING=y
|
||||||
|
+CONFIG_STAGING_MEDIA=y
|
||||||
|
+CONFIG_VIDEO_SUNXI=y
|
||||||
|
+CONFIG_VIDEO_SUNXI_CEDAR_VE=y
|
||||||
|
+CONFIG_VIDEO_SUNXI_CEDAR_ION=y
|
||||||
|
# CONFIG_IOMMU_SUPPORT is not set
|
||||||
|
CONFIG_PWM=y
|
||||||
|
CONFIG_PWM_SUNIV=y
|
||||||
|
@@ -144,6 +154,9 @@ CONFIG_CRYPTO_DRBG_MENU=y
|
||||||
|
# CONFIG_CRYPTO_HW is not set
|
||||||
|
CONFIG_LIBCRC32C=y
|
||||||
|
CONFIG_XZ_DEC=y
|
||||||
|
+CONFIG_DMA_PERNUMA_CMA=y
|
||||||
|
+CONFIG_CMA_SIZE_MBYTES=12
|
||||||
|
+CONFIG_CMA_ALIGNMENT=4
|
||||||
|
CONFIG_PRINTK_TIME=y
|
||||||
|
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=4
|
||||||
|
# CONFIG_FTRACE is not set
|
||||||
95
board/miyoo/kernel/patch/musl/0002-video-increase-VRAM.patch
Normal file
95
board/miyoo/kernel/patch/musl/0002-video-increase-VRAM.patch
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
From 16996fbd2c84692c6bc8c426524e870a6c826550 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopex <tiopxyz@gmail.com>
|
||||||
|
Date: Fri, 11 Jul 2025 23:57:28 +0200
|
||||||
|
Subject: [PATCH] video: increase VRAM
|
||||||
|
|
||||||
|
---
|
||||||
|
drivers/video/fbdev/gc9306fb.c | 2 +-
|
||||||
|
drivers/video/fbdev/hx8347dfb.c | 2 +-
|
||||||
|
drivers/video/fbdev/r61520fb.c | 2 +-
|
||||||
|
drivers/video/fbdev/rm68090fb.c | 2 +-
|
||||||
|
drivers/video/fbdev/st7789sTEfb.c | 2 +-
|
||||||
|
drivers/video/fbdev/st7789sfb.c | 2 +-
|
||||||
|
6 files changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/video/fbdev/gc9306fb.c b/drivers/video/fbdev/gc9306fb.c
|
||||||
|
index 4ecfbe9fb..f4cfef6a1 100644
|
||||||
|
--- a/drivers/video/fbdev/gc9306fb.c
|
||||||
|
+++ b/drivers/video/fbdev/gc9306fb.c
|
||||||
|
@@ -613,7 +613,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = 320 * 240 * 2 * 2;
|
||||||
|
+ par->vram_size = 640 * 480 * 2 * 2;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if(!par->vram_virt){
|
||||||
|
return -EINVAL;
|
||||||
|
diff --git a/drivers/video/fbdev/hx8347dfb.c b/drivers/video/fbdev/hx8347dfb.c
|
||||||
|
index c6b337999..80a0cc639 100644
|
||||||
|
--- a/drivers/video/fbdev/hx8347dfb.c
|
||||||
|
+++ b/drivers/video/fbdev/hx8347dfb.c
|
||||||
|
@@ -748,7 +748,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = 320*240*2*2;
|
||||||
|
+ par->vram_size = 640*480*2*2;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if(!par->vram_virt){
|
||||||
|
dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__);
|
||||||
|
diff --git a/drivers/video/fbdev/r61520fb.c b/drivers/video/fbdev/r61520fb.c
|
||||||
|
index ca1d8562f..c657efc70 100644
|
||||||
|
--- a/drivers/video/fbdev/r61520fb.c
|
||||||
|
+++ b/drivers/video/fbdev/r61520fb.c
|
||||||
|
@@ -1566,7 +1566,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = 320*240*2*2;
|
||||||
|
+ par->vram_size = 640*480*2*2;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if(!par->vram_virt){
|
||||||
|
dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__);
|
||||||
|
diff --git a/drivers/video/fbdev/rm68090fb.c b/drivers/video/fbdev/rm68090fb.c
|
||||||
|
index b3dcbe48b..1cf7268a7 100644
|
||||||
|
--- a/drivers/video/fbdev/rm68090fb.c
|
||||||
|
+++ b/drivers/video/fbdev/rm68090fb.c
|
||||||
|
@@ -684,7 +684,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = 320*240*2*2;
|
||||||
|
+ par->vram_size = 640*480*2*2;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if(!par->vram_virt){
|
||||||
|
dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__);
|
||||||
|
diff --git a/drivers/video/fbdev/st7789sTEfb.c b/drivers/video/fbdev/st7789sTEfb.c
|
||||||
|
index ee895b575..176f11416 100644
|
||||||
|
--- a/drivers/video/fbdev/st7789sTEfb.c
|
||||||
|
+++ b/drivers/video/fbdev/st7789sTEfb.c
|
||||||
|
@@ -687,7 +687,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = (320 * 240 * 2 * 4) + 4096;
|
||||||
|
+ par->vram_size = (640 * 480 * 2 * 4) + 4096;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t *)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if(!par->vram_virt) {
|
||||||
|
return -EINVAL;
|
||||||
|
diff --git a/drivers/video/fbdev/st7789sfb.c b/drivers/video/fbdev/st7789sfb.c
|
||||||
|
index 28ef0ce8c..8867701ad 100644
|
||||||
|
--- a/drivers/video/fbdev/st7789sfb.c
|
||||||
|
+++ b/drivers/video/fbdev/st7789sfb.c
|
||||||
|
@@ -806,7 +806,7 @@ static int myfb_probe(struct platform_device *device)
|
||||||
|
par->bpp = 16;
|
||||||
|
fb_videomode_to_var(&myfb_var, mode);
|
||||||
|
|
||||||
|
- par->vram_size = (320 * 240 * 2 * 4) + 4096;
|
||||||
|
+ par->vram_size = (640 * 480 * 2 * 4) + 4096;
|
||||||
|
par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA);
|
||||||
|
if (!par->vram_virt) {
|
||||||
|
return -EINVAL;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
title=Gstreamer HW player
|
||||||
|
description=Play a movie/audio file using HW decoder cedar
|
||||||
|
exec=/usr/bin/gst-play
|
||||||
|
selectordir=/mnt/output
|
||||||
3259
board/miyoo/patches/gst-omx/0001-gst-omx-adapter-omx-to-Cedarc.patch
Executable file
3259
board/miyoo/patches/gst-omx/0001-gst-omx-adapter-omx-to-Cedarc.patch
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,340 @@
|
|||||||
|
From 863e52e8f34c2c23c3411272734c7bed28c2d5fc Mon Sep 17 00:00:00 2001
|
||||||
|
From: xiebin <xiebin@allwinnertech.com>
|
||||||
|
Date: Thu, 1 Jun 2017 17:04:53 +0800
|
||||||
|
Subject: [PATCH 2/2] add mjpeg and remove h263 and mpeg4 encoder
|
||||||
|
|
||||||
|
---
|
||||||
|
config/bellagio/gstomx.conf | 20 +----
|
||||||
|
omx/Makefile.am | 6 +-
|
||||||
|
omx/gstomx.c | 3 +-
|
||||||
|
omx/gstomxmjpegenc.c | 174 ++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
omx/gstomxmjpegenc.h | 59 +++++++++++++++
|
||||||
|
5 files changed, 240 insertions(+), 22 deletions(-)
|
||||||
|
create mode 100644 omx/gstomxmjpegenc.c
|
||||||
|
create mode 100644 omx/gstomxmjpegenc.h
|
||||||
|
|
||||||
|
diff --git a/config/bellagio/gstomx.conf b/config/bellagio/gstomx.conf
|
||||||
|
index cf27588..8aaa01a 100644
|
||||||
|
--- a/config/bellagio/gstomx.conf
|
||||||
|
+++ b/config/bellagio/gstomx.conf
|
||||||
|
@@ -187,26 +187,8 @@ in-port-index=0
|
||||||
|
out-port-index=1
|
||||||
|
hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport
|
||||||
|
|
||||||
|
-[omxh263videoenc]
|
||||||
|
-type-name=GstOMXH263Enc
|
||||||
|
-core-name=/usr/lib/libcdc_omxil_core.so
|
||||||
|
-component-name=OMX.allwinner.video.encoder.h263
|
||||||
|
-rank=257
|
||||||
|
-in-port-index=0
|
||||||
|
-out-port-index=1
|
||||||
|
-hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport
|
||||||
|
-
|
||||||
|
-[omxmpeg4videoenc]
|
||||||
|
-type-name=GstOMXMPEG4VideoEnc
|
||||||
|
-core-name=/usr/lib/libcdc_omxil_core.so
|
||||||
|
-component-name=OMX.allwinner.video.encoder.mpeg4
|
||||||
|
-rank=257
|
||||||
|
-in-port-index=0
|
||||||
|
-out-port-index=1
|
||||||
|
-hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport
|
||||||
|
-
|
||||||
|
[omxmjpegvideoenc]
|
||||||
|
-type-name=GstOMXMJPEGVideoEnc
|
||||||
|
+type-name=GstOMXMJPEGEnc
|
||||||
|
core-name=/usr/lib/libOmxCore.so
|
||||||
|
component-name=OMX.allwinner.video.encoder.mjpeg
|
||||||
|
rank=257
|
||||||
|
diff --git a/omx/Makefile.am b/omx/Makefile.am
|
||||||
|
index b3627f7..f7596dd 100644
|
||||||
|
--- a/omx/Makefile.am
|
||||||
|
+++ b/omx/Makefile.am
|
||||||
|
@@ -51,7 +51,8 @@ libgstomx_la_SOURCES = \
|
||||||
|
gstomxrv20dec.c \
|
||||||
|
gstomxdivx4dec.c \
|
||||||
|
gstomxrxdec.c \
|
||||||
|
- gstomxavsdec.c
|
||||||
|
+ gstomxavsdec.c \
|
||||||
|
+ gstomxmjpegenc.c
|
||||||
|
|
||||||
|
noinst_HEADERS = \
|
||||||
|
gstomx.h \
|
||||||
|
@@ -94,7 +95,8 @@ noinst_HEADERS = \
|
||||||
|
gstomxrv20dec.h \
|
||||||
|
gstomxdivx4dec.h \
|
||||||
|
gstomxrxdec.h \
|
||||||
|
- gstomxavsdec.h
|
||||||
|
+ gstomxavsdec.h \
|
||||||
|
+ gstomxmjpegenc.h
|
||||||
|
|
||||||
|
if !HAVE_EXTERNAL_OMX
|
||||||
|
OMX_INCLUDEPATH = -I$(abs_srcdir)/openmax
|
||||||
|
diff --git a/omx/gstomx.c b/omx/gstomx.c
|
||||||
|
index 31c43e3..175b350 100644
|
||||||
|
--- a/omx/gstomx.c
|
||||||
|
+++ b/omx/gstomx.c
|
||||||
|
@@ -61,6 +61,7 @@
|
||||||
|
#include "gstomxdivx4dec.h"
|
||||||
|
#include "gstomxrxdec.h"
|
||||||
|
#include "gstomxavsdec.h"
|
||||||
|
+#include "gstomxmjpegenc.h"
|
||||||
|
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY (gstomx_debug);
|
||||||
|
@@ -2301,7 +2302,7 @@ static const GGetTypeFunction types[] = {
|
||||||
|
gst_omx_vp9_dec_get_type, gst_omx_h265_dec_get_type,
|
||||||
|
gst_omx_flv1_dec_get_type, gst_omx_rv20_dec_get_type,
|
||||||
|
gst_omx_rx_dec_get_type, gst_omx_divx4_dec_get_type,
|
||||||
|
- gst_omx_avs_dec_get_type
|
||||||
|
+ gst_omx_avs_dec_get_type, gst_omx_mjpeg_enc_get_type
|
||||||
|
#ifdef HAVE_VP8
|
||||||
|
, gst_omx_vp8_dec_get_type
|
||||||
|
#endif
|
||||||
|
diff --git a/omx/gstomxmjpegenc.c b/omx/gstomxmjpegenc.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..ed2234e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/omx/gstomxmjpegenc.c
|
||||||
|
@@ -0,0 +1,174 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P.
|
||||||
|
+ * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>, Collabora Ltd.
|
||||||
|
+ *
|
||||||
|
+ * This library is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation
|
||||||
|
+ * version 2.1 of the License.
|
||||||
|
+ *
|
||||||
|
+ * This library is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public
|
||||||
|
+ * License along with this library; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifdef HAVE_CONFIG_H
|
||||||
|
+#include "config.h"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#include <gst/gst.h>
|
||||||
|
+
|
||||||
|
+#include "gstomxmjpegenc.h"
|
||||||
|
+
|
||||||
|
+GST_DEBUG_CATEGORY_STATIC (gst_omx_mjpeg_enc_debug_category);
|
||||||
|
+#define GST_CAT_DEFAULT gst_omx_mjpeg_enc_debug_category
|
||||||
|
+
|
||||||
|
+/* prototypes */
|
||||||
|
+static gboolean gst_omx_mjpeg_enc_set_format (GstOMXVideoEnc * enc,
|
||||||
|
+ GstOMXPort * port, GstVideoCodecState * state);
|
||||||
|
+static GstCaps *gst_omx_mjpeg_enc_get_caps (GstOMXVideoEnc * enc,
|
||||||
|
+ GstOMXPort * port, GstVideoCodecState * state);
|
||||||
|
+
|
||||||
|
+enum
|
||||||
|
+{
|
||||||
|
+ PROP_0
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* class initialization */
|
||||||
|
+
|
||||||
|
+#define DEBUG_INIT \
|
||||||
|
+ GST_DEBUG_CATEGORY_INIT (gst_omx_mjpeg_enc_debug_category, "omxmjpegenc", 0, \
|
||||||
|
+ "debug category for gst-omx video encoder base class");
|
||||||
|
+
|
||||||
|
+G_DEFINE_TYPE_WITH_CODE (GstOMXMJPEGEnc, gst_omx_mjpeg_enc,
|
||||||
|
+ GST_TYPE_OMX_VIDEO_ENC, DEBUG_INIT);
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+gst_omx_mjpeg_enc_class_init (GstOMXMJPEGEncClass * klass)
|
||||||
|
+{
|
||||||
|
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
+ GstOMXVideoEncClass *videoenc_class = GST_OMX_VIDEO_ENC_CLASS (klass);
|
||||||
|
+ printf("mjpeg class init!\n");
|
||||||
|
+ videoenc_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_mjpeg_enc_set_format);
|
||||||
|
+ videoenc_class->get_caps = GST_DEBUG_FUNCPTR (gst_omx_mjpeg_enc_get_caps);
|
||||||
|
+
|
||||||
|
+ videoenc_class->cdata.default_src_template_caps = "image/jpeg";
|
||||||
|
+
|
||||||
|
+ gst_element_class_set_static_metadata (element_class,
|
||||||
|
+ "OpenMAX Mjpeg Video Encoder",
|
||||||
|
+ "Codec/Encoder/Video",
|
||||||
|
+ "Encode Mjpeg video streams",
|
||||||
|
+ "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
|
||||||
|
+
|
||||||
|
+ gst_omx_set_default_role (&videoenc_class->cdata, "video_encoder.mjpeg");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+gst_omx_mjpeg_enc_init (GstOMXMJPEGEnc * self)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static gboolean
|
||||||
|
+gst_omx_mjpeg_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
|
||||||
|
+ GstVideoCodecState * state)
|
||||||
|
+{
|
||||||
|
+ GstOMXMJPEGEnc *self = GST_OMX_MJPEG_ENC (enc);
|
||||||
|
+ GstCaps *peercaps;
|
||||||
|
+ OMX_PARAM_PORTDEFINITIONTYPE port_def;
|
||||||
|
+ OMX_VIDEO_PARAM_PROFILELEVELTYPE param;
|
||||||
|
+ OMX_ERRORTYPE err;
|
||||||
|
+ guint profile_id, level_id;
|
||||||
|
+
|
||||||
|
+ gst_omx_port_get_port_definition (GST_OMX_VIDEO_ENC (self)->enc_out_port,
|
||||||
|
+ &port_def);
|
||||||
|
+ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMJPEG;
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_port_update_port_definition (GST_OMX_VIDEO_ENC
|
||||||
|
+ (self)->enc_out_port, &port_def);
|
||||||
|
+ if (err != OMX_ErrorNone)
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
+ GST_OMX_INIT_STRUCT (¶m);
|
||||||
|
+ param.nPortIndex = GST_OMX_VIDEO_ENC (self)->enc_out_port->index;
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
|
||||||
|
+ OMX_IndexParamVideoProfileLevelCurrent, ¶m);
|
||||||
|
+ if (err != OMX_ErrorNone) {
|
||||||
|
+ GST_WARNING_OBJECT (self,
|
||||||
|
+ "Getting profile/level not supported by component");
|
||||||
|
+ return TRUE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ peercaps = gst_pad_peer_query_caps (GST_VIDEO_ENCODER_SRC_PAD (enc),
|
||||||
|
+ gst_pad_get_pad_template_caps (GST_VIDEO_ENCODER_SRC_PAD (enc)));
|
||||||
|
+ if (peercaps) {
|
||||||
|
+ GstStructure *s;
|
||||||
|
+
|
||||||
|
+ if (gst_caps_is_empty (peercaps)) {
|
||||||
|
+ gst_caps_unref (peercaps);
|
||||||
|
+ GST_ERROR_OBJECT (self, "Empty caps");
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ s = gst_caps_get_structure (peercaps, 0);
|
||||||
|
+ gst_caps_unref (peercaps);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc,
|
||||||
|
+ OMX_IndexParamVideoProfileLevelCurrent, ¶m);
|
||||||
|
+ if (err == OMX_ErrorUnsupportedIndex) {
|
||||||
|
+ GST_WARNING_OBJECT (self,
|
||||||
|
+ "Setting profile/level not supported by component");
|
||||||
|
+ } else if (err != OMX_ErrorNone) {
|
||||||
|
+ GST_ERROR_OBJECT (self,
|
||||||
|
+ "Error setting profile %u and level %u: %s (0x%08x)",
|
||||||
|
+ (guint) param.eProfile, (guint) param.eLevel,
|
||||||
|
+ gst_omx_error_to_string (err), err);
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return TRUE;
|
||||||
|
+
|
||||||
|
+unsupported_profile:
|
||||||
|
+ GST_ERROR_OBJECT (self, "Unsupported profile %u", profile_id);
|
||||||
|
+ gst_caps_unref (peercaps);
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
+unsupported_level:
|
||||||
|
+ GST_ERROR_OBJECT (self, "Unsupported level %u", level_id);
|
||||||
|
+ gst_caps_unref (peercaps);
|
||||||
|
+ return FALSE;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static GstCaps *
|
||||||
|
+gst_omx_mjpeg_enc_get_caps (GstOMXVideoEnc * enc, GstOMXPort * port,
|
||||||
|
+ GstVideoCodecState * state)
|
||||||
|
+{
|
||||||
|
+ GstOMXMJPEGEnc *self = GST_OMX_MJPEG_ENC (enc);
|
||||||
|
+ GstCaps *caps;
|
||||||
|
+ OMX_ERRORTYPE err;
|
||||||
|
+ OMX_VIDEO_PARAM_PROFILELEVELTYPE param;
|
||||||
|
+ guint profile, level;
|
||||||
|
+
|
||||||
|
+ caps = gst_caps_new_empty_simple ("image/jpeg");
|
||||||
|
+
|
||||||
|
+ GST_OMX_INIT_STRUCT (¶m);
|
||||||
|
+ param.nPortIndex = GST_OMX_VIDEO_ENC (self)->enc_out_port->index;
|
||||||
|
+
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
|
||||||
|
+ OMX_IndexParamVideoProfileLevelCurrent, ¶m);
|
||||||
|
+ if (err != OMX_ErrorNone && err != OMX_ErrorUnsupportedIndex) {
|
||||||
|
+ gst_caps_unref (caps);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return caps;
|
||||||
|
+}
|
||||||
|
diff --git a/omx/gstomxmjpegenc.h b/omx/gstomxmjpegenc.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..e053d04
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/omx/gstomxmjpegenc.h
|
||||||
|
@@ -0,0 +1,59 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P.
|
||||||
|
+ * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>, Collabora Ltd.
|
||||||
|
+ *
|
||||||
|
+ * This library is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation
|
||||||
|
+ * version 2.1 of the License.
|
||||||
|
+ *
|
||||||
|
+ * This library is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public
|
||||||
|
+ * License along with this library; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifndef __GST_OMX_MJPEG_ENC_H__
|
||||||
|
+#define __GST_OMX_MJPEG_ENC_H__
|
||||||
|
+
|
||||||
|
+#include <gst/gst.h>
|
||||||
|
+#include "gstomxvideoenc.h"
|
||||||
|
+
|
||||||
|
+G_BEGIN_DECLS
|
||||||
|
+
|
||||||
|
+#define GST_TYPE_OMX_MJPEG_ENC \
|
||||||
|
+ (gst_omx_mjpeg_enc_get_type())
|
||||||
|
+#define GST_OMX_MJPEG_ENC(obj) \
|
||||||
|
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEnc))
|
||||||
|
+#define GST_OMX_MJPEG_ENC_CLASS(klass) \
|
||||||
|
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEncClass))
|
||||||
|
+#define GST_OMX_MJPEG_ENC_GET_CLASS(obj) \
|
||||||
|
+ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEncClass))
|
||||||
|
+#define GST_IS_OMX_MJPEG_ENC(obj) \
|
||||||
|
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MJPEG_ENC))
|
||||||
|
+#define GST_IS_OMX_MJPEG_ENC_CLASS(obj) \
|
||||||
|
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MJPEG_ENC))
|
||||||
|
+
|
||||||
|
+typedef struct _GstOMXMJPEGEnc GstOMXMJPEGEnc;
|
||||||
|
+typedef struct _GstOMXMJPEGEncClass GstOMXMJPEGEncClass;
|
||||||
|
+
|
||||||
|
+struct _GstOMXMJPEGEnc
|
||||||
|
+{
|
||||||
|
+ GstOMXVideoEnc parent;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+struct _GstOMXMJPEGEncClass
|
||||||
|
+{
|
||||||
|
+ GstOMXVideoEncClass parent_class;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+GType gst_omx_mjpeg_enc_get_type (void);
|
||||||
|
+
|
||||||
|
+G_END_DECLS
|
||||||
|
+
|
||||||
|
+#endif /* __GST_OMX_MJPEG_ENC_H__ */
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
83
board/miyoo/patches/gst-omx/0003-add-for-zero-copy.patch
Normal file
83
board/miyoo/patches/gst-omx/0003-add-for-zero-copy.patch
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
From d3096c4fc4e7d13647df55a7c74dc5ba1e143bc7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: xiebin <xiebin@allwinnertech.com>
|
||||||
|
Date: Tue, 2 Jan 2018 17:20:30 +0800
|
||||||
|
Subject: [PATCH 4/4] add for zero copy
|
||||||
|
|
||||||
|
---
|
||||||
|
omx/gstomxbufferpool.c | 7 ++++++-
|
||||||
|
omx/gstomxvideo.c | 3 +++
|
||||||
|
omx/openmax/OMX_IVCommon.h | 12 ++++++++++++
|
||||||
|
3 files changed, 21 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c
|
||||||
|
index b57612d..607bee8 100644
|
||||||
|
--- a/omx/gstomxbufferpool.c
|
||||||
|
+++ b/omx/gstomxbufferpool.c
|
||||||
|
@@ -344,6 +344,7 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
|
||||||
|
GstOMXBufferPool *pool = GST_OMX_BUFFER_POOL (bpool);
|
||||||
|
GstBuffer *buf;
|
||||||
|
GstOMXBuffer *omx_buf;
|
||||||
|
+ GstMemoryFlags flags = 0;
|
||||||
|
|
||||||
|
g_return_val_if_fail (pool->allocating, GST_FLOW_ERROR);
|
||||||
|
|
||||||
|
@@ -389,7 +390,10 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
|
||||||
|
gsize offset[GST_VIDEO_MAX_PLANES] = { 0, };
|
||||||
|
gint stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, };
|
||||||
|
|
||||||
|
- mem = gst_omx_memory_allocator_alloc (pool->allocator, 0, omx_buf);
|
||||||
|
+ if(pool->port->port_def.bBuffersContiguous)
|
||||||
|
+ flags|= GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS;
|
||||||
|
+
|
||||||
|
+ mem = gst_omx_memory_allocator_alloc (pool->allocator, flags, omx_buf);
|
||||||
|
buf = gst_buffer_new ();
|
||||||
|
gst_buffer_append_memory (buf, mem);
|
||||||
|
g_ptr_array_add (pool->buffers, buf);
|
||||||
|
@@ -405,6 +409,7 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
|
||||||
|
case GST_VIDEO_FORMAT_GRAY8:
|
||||||
|
break;
|
||||||
|
case GST_VIDEO_FORMAT_I420:
|
||||||
|
+ case GST_VIDEO_FORMAT_YV12:
|
||||||
|
stride[1] = nstride / 2;
|
||||||
|
offset[1] = offset[0] + stride[0] * nslice;
|
||||||
|
stride[2] = nstride / 2;
|
||||||
|
diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c
|
||||||
|
index 8a42c71..fd4cad4 100644
|
||||||
|
--- a/omx/gstomxvideo.c
|
||||||
|
+++ b/omx/gstomxvideo.c
|
||||||
|
@@ -44,6 +44,9 @@ gst_omx_video_get_format_from_omx (OMX_COLOR_FORMATTYPE omx_colorformat)
|
||||||
|
case OMX_COLOR_FormatYUV420PackedPlanar:
|
||||||
|
format = GST_VIDEO_FORMAT_I420;
|
||||||
|
break;
|
||||||
|
+ case OMX_COLOR_FormatYVU420Planar:
|
||||||
|
+ format = GST_VIDEO_FORMAT_YV12;
|
||||||
|
+ break;
|
||||||
|
case OMX_COLOR_FormatYUV420SemiPlanar:
|
||||||
|
case OMX_COLOR_FormatYUV420PackedSemiPlanar:
|
||||||
|
format = GST_VIDEO_FORMAT_NV12;
|
||||||
|
diff --git a/omx/openmax/OMX_IVCommon.h b/omx/openmax/OMX_IVCommon.h
|
||||||
|
index 4c4995c..367670b 100644
|
||||||
|
--- a/omx/openmax/OMX_IVCommon.h
|
||||||
|
+++ b/omx/openmax/OMX_IVCommon.h
|
||||||
|
@@ -132,6 +132,18 @@ typedef enum OMX_COLOR_FORMATTYPE {
|
||||||
|
OMX_COLOR_Format24BitABGR6666,
|
||||||
|
OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||||
|
OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||||
|
+ //* extended by aw;
|
||||||
|
+ OMX_COLOR_FormatYVU420SemiPlanar,
|
||||||
|
+ OMX_COLOR_FormatYVU420Planar,
|
||||||
|
+ //* end;
|
||||||
|
+
|
||||||
|
+ OMX_COLOR_FormatAndroidOpaque = 0x7F000789,
|
||||||
|
+ OMX_COLOR_FormatYUV420Flexible = 0x7F420888,
|
||||||
|
+ OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100,
|
||||||
|
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
|
||||||
|
+ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
|
||||||
|
+ OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002,
|
||||||
|
+ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m = 0x7FA30C04,
|
||||||
|
OMX_COLOR_FormatMax = 0x7FFFFFFF
|
||||||
|
} OMX_COLOR_FORMATTYPE;
|
||||||
|
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
33
board/miyoo/patches/gst-omx/0004-patch-for-omx-drop-frames.patch
Executable file
33
board/miyoo/patches/gst-omx/0004-patch-for-omx-drop-frames.patch
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
>From 6b2c45cc5c93bd3d19467ffc22195d8dad32545f Mon Sep 17 00:00:00 2001
|
||||||
|
From: xiebin <xiebin@allwinnertech.com>
|
||||||
|
Date: Wed, 31 Jan 2018 13:38:08 +0800
|
||||||
|
Subject: [PATCH 5/5] patch for omx drop frames
|
||||||
|
|
||||||
|
---
|
||||||
|
omx/gstomxvideodec.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
|
||||||
|
index 79b4daa..a88bdba 100644
|
||||||
|
--- a/omx/gstomxvideodec.c
|
||||||
|
+++ b/omx/gstomxvideodec.c
|
||||||
|
@@ -2171,6 +2171,7 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
|
guint offset = 0, size;
|
||||||
|
GstClockTime timestamp, duration;
|
||||||
|
OMX_ERRORTYPE err;
|
||||||
|
+ static int drop_num = 0;
|
||||||
|
|
||||||
|
self = GST_OMX_VIDEO_DEC (decoder);
|
||||||
|
klass = GST_OMX_VIDEO_DEC_GET_CLASS (self);
|
||||||
|
@@ -2178,7 +2179,7 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
|
GST_DEBUG_OBJECT (self, "Handling frame");
|
||||||
|
|
||||||
|
if (!self->started) {
|
||||||
|
- if (!GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame)) {
|
||||||
|
+ if (!GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame) && drop_num++ < 20) {
|
||||||
|
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
56
board/miyoo/patches/gst-omx/0005-add-YV12-and-set-outport-for-enc.patch
Executable file
56
board/miyoo/patches/gst-omx/0005-add-YV12-and-set-outport-for-enc.patch
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
|
||||||
|
index bfad2f3..36b6927 100644
|
||||||
|
--- a/omx/gstomxvideoenc.c
|
||||||
|
+++ b/omx/gstomxvideoenc.c
|
||||||
|
@@ -1022,6 +1022,9 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
|
case GST_VIDEO_FORMAT_I420:
|
||||||
|
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar;
|
||||||
|
break;
|
||||||
|
+ case GST_VIDEO_FORMAT_YV12:
|
||||||
|
+ port_def.format.video.eColorFormat = OMX_COLOR_FormatYVU420Planar;
|
||||||
|
+ break;
|
||||||
|
case GST_VIDEO_FORMAT_NV12:
|
||||||
|
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
|
||||||
|
break;
|
||||||
|
@@ -1057,6 +1060,7 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
|
|
||||||
|
switch (port_def.format.video.eColorFormat) {
|
||||||
|
case OMX_COLOR_FormatYUV420Planar:
|
||||||
|
+ case OMX_COLOR_FormatYVU420Planar:
|
||||||
|
case OMX_COLOR_FormatYUV420PackedPlanar:
|
||||||
|
port_def.nBufferSize =
|
||||||
|
(port_def.format.video.nStride * port_def.format.video.nFrameHeight) +
|
||||||
|
@@ -1135,8 +1139,13 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "Updating outport port definition");
|
||||||
|
+
|
||||||
|
+ gst_omx_port_get_port_definition (self->enc_out_port, &port_def);
|
||||||
|
+ port_def.format.video.nFrameWidth = info->width;
|
||||||
|
+ port_def.format.video.nFrameHeight = info->height;
|
||||||
|
+
|
||||||
|
if (gst_omx_port_update_port_definition (self->enc_out_port,
|
||||||
|
- NULL) != OMX_ErrorNone)
|
||||||
|
+ &port_def) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (self->target_bitrate != 0xffffffff) {
|
||||||
|
@@ -1285,7 +1294,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
|
{
|
||||||
|
GstVideoCodecState *state = gst_video_codec_state_ref (self->input_state);
|
||||||
|
GstVideoInfo *info = &state->info;
|
||||||
|
- OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def;
|
||||||
|
+ OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_out_port->port_def;
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
GstVideoFrame frame;
|
||||||
|
|
||||||
|
@@ -1310,7 +1319,8 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
|
/* Different strides */
|
||||||
|
|
||||||
|
switch (info->finfo->format) {
|
||||||
|
- case GST_VIDEO_FORMAT_I420:{
|
||||||
|
+ case GST_VIDEO_FORMAT_I420:
|
||||||
|
+ case GST_VIDEO_FORMAT_YV12:{
|
||||||
|
gint i, j, height, width;
|
||||||
|
guint8 *src, *dest;
|
||||||
|
gint src_stride, dest_stride;
|
||||||
12
board/miyoo/patches/gst-omx/0006-add-YV12-format-output-for-dec.patch
Executable file
12
board/miyoo/patches/gst-omx/0006-add-YV12-format-output-for-dec.patch
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
|
||||||
|
index 79b4daa..bbd123c 100644
|
||||||
|
--- a/omx/gstomxvideodec.c
|
||||||
|
+++ b/omx/gstomxvideodec.c
|
||||||
|
@@ -476,6 +476,7 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self,
|
||||||
|
dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
|
||||||
|
break;
|
||||||
|
case GST_VIDEO_FORMAT_I420:
|
||||||
|
+ case GST_VIDEO_FORMAT_YV12:
|
||||||
|
dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
|
||||||
|
src_stride[1] = nstride / 2;
|
||||||
|
src_size[1] = (src_stride[1] * nslice) / 2;
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
diff --git a/omx/gstomxh264enc.c b/omx/gstomxh264enc.c
|
||||||
|
index aa33ae5..48ef3d7 100644
|
||||||
|
--- a/omx/gstomxh264enc.c
|
||||||
|
+++ b/omx/gstomxh264enc.c
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
#include <OMX_Broadcom.h>
|
||||||
|
#include <OMX_Index.h>
|
||||||
|
#endif
|
||||||
|
+#include "OMX_IndexExt.h"
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_STATIC (gst_omx_h264_enc_debug_category);
|
||||||
|
#define GST_CAT_DEFAULT gst_omx_h264_enc_debug_category
|
||||||
|
@@ -54,6 +55,7 @@ enum
|
||||||
|
#ifdef USE_OMX_TARGET_RPI
|
||||||
|
PROP_INLINESPSPPSHEADERS,
|
||||||
|
#endif
|
||||||
|
+ PROP_BYTE_STREAM,
|
||||||
|
PROP_PERIODICITYOFIDRFRAMES,
|
||||||
|
PROP_INTERVALOFCODINGINTRAFRAMES
|
||||||
|
};
|
||||||
|
@@ -61,6 +63,7 @@ enum
|
||||||
|
#ifdef USE_OMX_TARGET_RPI
|
||||||
|
#define GST_OMX_H264_VIDEO_ENC_INLINE_SPS_PPS_HEADERS_DEFAULT TRUE
|
||||||
|
#endif
|
||||||
|
+#define GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT FALSE
|
||||||
|
#define GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT (0xffffffff)
|
||||||
|
#define GST_OMX_H264_VIDEO_ENC_INTERVAL_OF_CODING_INTRA_FRAMES_DEFAULT (0xffffffff)
|
||||||
|
|
||||||
|
@@ -98,6 +101,11 @@ gst_omx_h264_enc_class_init (GstOMXH264EncClass * klass)
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
|
GST_PARAM_MUTABLE_READY));
|
||||||
|
#endif
|
||||||
|
+ g_object_class_install_property (gobject_class, PROP_BYTE_STREAM,
|
||||||
|
+ g_param_spec_boolean ("byte-stream", "Byte Stream",
|
||||||
|
+ "Generate byte stream format of NALU",
|
||||||
|
+ GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT,
|
||||||
|
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_PERIODICITYOFIDRFRAMES,
|
||||||
|
g_param_spec_uint ("periodicty-idr", "Target Bitrate",
|
||||||
|
@@ -146,6 +154,8 @@ gst_omx_h264_enc_set_property (GObject * object, guint prop_id,
|
||||||
|
self->inline_sps_pps_headers = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
+ case PROP_BYTE_STREAM:
|
||||||
|
+ self->byte_stream = g_value_get_boolean (value);
|
||||||
|
case PROP_PERIODICITYOFIDRFRAMES:
|
||||||
|
self->periodicty_idr = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
@@ -170,6 +180,9 @@ gst_omx_h264_enc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
|
g_value_set_boolean (value, self->inline_sps_pps_headers);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
+ case PROP_BYTE_STREAM:
|
||||||
|
+ g_value_set_boolean (value, self->byte_stream);
|
||||||
|
+ break;
|
||||||
|
case PROP_PERIODICITYOFIDRFRAMES:
|
||||||
|
g_value_set_uint (value, self->periodicty_idr);
|
||||||
|
break;
|
||||||
|
@@ -189,6 +202,7 @@ gst_omx_h264_enc_init (GstOMXH264Enc * self)
|
||||||
|
self->inline_sps_pps_headers =
|
||||||
|
GST_OMX_H264_VIDEO_ENC_INLINE_SPS_PPS_HEADERS_DEFAULT;
|
||||||
|
#endif
|
||||||
|
+ self->byte_stream = GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT;
|
||||||
|
self->periodicty_idr =
|
||||||
|
GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT;
|
||||||
|
self->interval_intraframes =
|
||||||
|
@@ -226,6 +240,7 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
|
||||||
|
OMX_PARAM_PORTDEFINITIONTYPE port_def;
|
||||||
|
OMX_VIDEO_PARAM_PROFILELEVELTYPE param;
|
||||||
|
OMX_VIDEO_CONFIG_AVCINTRAPERIOD config_avcintraperiod;
|
||||||
|
+ OMX_NALSTREAMFORMATTYPE config_nalstreamformattype;
|
||||||
|
#ifdef USE_OMX_TARGET_RPI
|
||||||
|
OMX_CONFIG_PORTBOOLEANTYPE config_inline_header;
|
||||||
|
#endif
|
||||||
|
@@ -263,6 +278,35 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port,
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+ if (self->byte_stream != GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT) {
|
||||||
|
+ GST_OMX_INIT_STRUCT (&config_nalstreamformattype);
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
|
||||||
|
+ OMX_IndexParamNalStreamFormat, &config_nalstreamformattype);
|
||||||
|
+ if (err != OMX_ErrorNone) {
|
||||||
|
+ GST_ERROR_OBJECT (self,
|
||||||
|
+ "can't get OMX_IndexParamNalStreamFormat %s (0x%08x)",
|
||||||
|
+ gst_omx_error_to_string (err), err);
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ GST_DEBUG_OBJECT (self, "default Nal Stream Format:%u",
|
||||||
|
+ (guint) config_nalstreamformattype.eNaluFormat);
|
||||||
|
+
|
||||||
|
+ if (self->byte_stream != GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT)
|
||||||
|
+ config_nalstreamformattype.eNaluFormat = OMX_NaluFormatFourByteInterleaveLength;
|
||||||
|
+
|
||||||
|
+ err =
|
||||||
|
+ gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc,
|
||||||
|
+ OMX_IndexParamNalStreamFormat, &config_nalstreamformattype);
|
||||||
|
+ if (err != OMX_ErrorNone) {
|
||||||
|
+ GST_ERROR_OBJECT (self,
|
||||||
|
+ "can't set OMX_IndexParamNalStreamFormat %s (0x%08x)",
|
||||||
|
+ gst_omx_error_to_string (err), err);
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (self->periodicty_idr !=
|
||||||
|
GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT
|
||||||
|
|| self->interval_intraframes !=
|
||||||
|
diff --git a/omx/gstomxh264enc.h b/omx/gstomxh264enc.h
|
||||||
|
index 03326e1..d962d7b 100644
|
||||||
|
--- a/omx/gstomxh264enc.h
|
||||||
|
+++ b/omx/gstomxh264enc.h
|
||||||
|
@@ -46,6 +46,7 @@ struct _GstOMXH264Enc
|
||||||
|
{
|
||||||
|
GstOMXVideoEnc parent;
|
||||||
|
|
||||||
|
+ gboolean byte_stream;
|
||||||
|
#ifdef USE_OMX_TARGET_RPI
|
||||||
|
gboolean inline_sps_pps_headers;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
|
||||||
|
index 38de95b..894f813 100644
|
||||||
|
--- a/omx/gstomxvideodec.c
|
||||||
|
+++ b/omx/gstomxvideodec.c
|
||||||
|
@@ -1879,9 +1879,12 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "Need to disable and drain decoder");
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
gst_omx_video_dec_drain (decoder);
|
||||||
|
gst_omx_video_dec_flush (decoder);
|
||||||
|
gst_omx_port_set_flushing (out_port, 5 * GST_SECOND, TRUE);
|
||||||
|
+ */
|
||||||
|
+ gst_omx_video_dec_flush (decoder);
|
||||||
|
|
||||||
|
if (klass->cdata.hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) {
|
||||||
|
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
|
||||||
|
@@ -1901,7 +1904,7 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
|
||||||
|
gst_omx_port_set_flushing (self->egl_out_port, 5 * GST_SECOND, TRUE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
-
|
||||||
|
+ /*
|
||||||
|
if (gst_omx_port_set_enabled (self->dec_in_port, FALSE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
if (gst_omx_port_set_enabled (out_port, FALSE) != OMX_ErrorNone)
|
||||||
|
@@ -1921,7 +1924,7 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
|
||||||
|
return FALSE;
|
||||||
|
if (gst_omx_port_wait_enabled (out_port, 1 * GST_SECOND) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
-
|
||||||
|
+ */
|
||||||
|
#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
|
||||||
|
if (self->eglimage) {
|
||||||
|
OMX_STATETYPE egl_state;
|
||||||
|
@@ -1959,6 +1962,9 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
|
||||||
|
self->input_state = NULL;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "Decoder drained and disabled");
|
||||||
|
+ /* The local port_def is now obsolete so get it again. */
|
||||||
|
+ if (!needs_disable)
|
||||||
|
+ gst_omx_port_get_port_definition (self->dec_in_port, &port_def);
|
||||||
|
}
|
||||||
|
|
||||||
|
port_def.format.video.nFrameWidth = info->width;
|
||||||
|
@@ -1994,15 +2000,17 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
|
||||||
|
if (needs_disable) {
|
||||||
|
if (gst_omx_port_set_enabled (self->dec_in_port, TRUE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
+ /*
|
||||||
|
if (gst_omx_port_allocate_buffers (self->dec_in_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
-
|
||||||
|
+ */
|
||||||
|
if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
|
||||||
|
if (gst_omx_port_set_enabled (self->dec_out_port, TRUE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
+ /*
|
||||||
|
if (gst_omx_port_allocate_buffers (self->dec_out_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
-
|
||||||
|
+ */
|
||||||
|
if (gst_omx_port_wait_enabled (self->dec_out_port,
|
||||||
|
5 * GST_SECOND) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
@@ -2100,7 +2108,9 @@ gst_omx_video_dec_flush (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
|
/* 1) Flush the ports */
|
||||||
|
GST_DEBUG_OBJECT (self, "flushing ports");
|
||||||
|
+ /*
|
||||||
|
gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, TRUE);
|
||||||
|
+ */
|
||||||
|
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE);
|
||||||
|
|
||||||
|
#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
|
||||||
|
@@ -2129,7 +2139,9 @@ gst_omx_video_dec_flush (GstVideoDecoder * decoder)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 4) Unset flushing to allow ports to accept data again */
|
||||||
|
+ /*
|
||||||
|
gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, FALSE);
|
||||||
|
+ */
|
||||||
|
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, FALSE);
|
||||||
|
|
||||||
|
#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
From 68550592fadb8aae28f3c84813e76d2c07ba4059 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopex <tiopxyz@gmail.com>
|
||||||
|
Date: Wed, 11 Jun 2025 13:14:33 +0200
|
||||||
|
Subject: [PATCH] Remove check error on port disabling
|
||||||
|
|
||||||
|
---
|
||||||
|
omx/gstomx.c | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/omx/gstomx.c b/omx/gstomx.c
|
||||||
|
index 038ce32..d9f8af0 100644
|
||||||
|
--- a/omx/gstomx.c
|
||||||
|
+++ b/omx/gstomx.c
|
||||||
|
@@ -3185,8 +3185,8 @@ gst_omx_port_wait_enabled_unlocked (GstOMXPort * port, GstClockTime timeout)
|
||||||
|
|
||||||
|
if (timeout == 0) {
|
||||||
|
if (port->enabled_pending || port->disabled_pending)
|
||||||
|
- err = OMX_ErrorTimeout;
|
||||||
|
- goto done;
|
||||||
|
+ err = OMX_ErrorNone;
|
||||||
|
+ //goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* And now wait until the enable/disable command is finished */
|
||||||
|
@@ -3210,8 +3210,8 @@ gst_omx_port_wait_enabled_unlocked (GstOMXPort * port, GstClockTime timeout)
|
||||||
|
GST_ERROR_OBJECT (comp->parent,
|
||||||
|
"Timeout waiting for %s port %u to be %s", comp->name, port->index,
|
||||||
|
(enabled ? "enabled" : "disabled"));
|
||||||
|
- err = OMX_ErrorTimeout;
|
||||||
|
- goto done;
|
||||||
|
+ err = OMX_ErrorNone;
|
||||||
|
+ //goto done;
|
||||||
|
} else if (last_error != OMX_ErrorNone) {
|
||||||
|
GST_ERROR_OBJECT (comp->parent,
|
||||||
|
"Got error while waiting for %s port %u to be %s: %s (0x%08x)",
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
60
board/miyoo/patches/gst-omx/0010-Add-gst-raw.py-script.patch
Normal file
60
board/miyoo/patches/gst-omx/0010-Add-gst-raw.py-script.patch
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
From 50913a1d0fe6f3b074f1dd3847ed5ffb401284a9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopxyz <tiopxyz@gmail.com>
|
||||||
|
Date: Mon, 7 Jul 2025 13:45:56 +0200
|
||||||
|
Subject: [PATCH] Add gst-raw.py script
|
||||||
|
|
||||||
|
---
|
||||||
|
config/miyoo/gst-raw.py | 41 +++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 41 insertions(+)
|
||||||
|
create mode 100644 config/miyoo/gst-raw.py
|
||||||
|
|
||||||
|
diff --git a/config/miyoo/gst-raw.py b/config/miyoo/gst-raw.py
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4ccfb0f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/config/miyoo/gst-raw.py
|
||||||
|
@@ -0,0 +1,41 @@
|
||||||
|
+#!/usr/bin/env python3
|
||||||
|
+import subprocess
|
||||||
|
+import sys
|
||||||
|
+import termios
|
||||||
|
+import tty
|
||||||
|
+import signal
|
||||||
|
+
|
||||||
|
+if len(sys.argv) < 2:
|
||||||
|
+ print("Usage: python3 p.py <filename>")
|
||||||
|
+ sys.exit(1)
|
||||||
|
+
|
||||||
|
+filename = sys.argv[1]
|
||||||
|
+
|
||||||
|
+cmd = [
|
||||||
|
+ 'gst-launch-1.0',
|
||||||
|
+ 'filesrc', 'location=' + filename,
|
||||||
|
+ '!', 'qtdemux', 'name=demux',
|
||||||
|
+ 'demux.audio_0', '!', 'queue', '!', 'decodebin', '!', 'audioconvert', '!', 'alsasink',
|
||||||
|
+ 'demux.video_0', '!', 'queue', '!', 'decodebin', '!',
|
||||||
|
+ 'sunxifbsink', 'hardware-overlay=true', 'video-memory=2', 'buffer-pool=true', 'full-screen=true', '-e', '-q', '-f'
|
||||||
|
+]
|
||||||
|
+
|
||||||
|
+proc = subprocess.Popen(cmd)
|
||||||
|
+
|
||||||
|
+def get_key():
|
||||||
|
+ fd = sys.stdin.fileno()
|
||||||
|
+ old = termios.tcgetattr(fd)
|
||||||
|
+ try:
|
||||||
|
+ tty.setraw(fd)
|
||||||
|
+ ch = sys.stdin.read(1)
|
||||||
|
+ finally:
|
||||||
|
+ termios.tcsetattr(fd, termios.TCSADRAIN, old)
|
||||||
|
+ return ch
|
||||||
|
+
|
||||||
|
+_ = get_key()
|
||||||
|
+print("Key pressed, terminating gst-launch...")
|
||||||
|
+proc.send_signal(signal.SIGINT)
|
||||||
|
+
|
||||||
|
+proc.wait()
|
||||||
|
+print("gst-launch stopped.")
|
||||||
|
+
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
From 625e183efb5a59434c14b008696e54224014adda Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopex <tiopxyz@gmail.com>
|
||||||
|
Date: Fri, 20 Jun 2025 23:41:18 +0200
|
||||||
|
Subject: [PATCH] omxvideodec: remove resolution check with goto in fill_buffer
|
||||||
|
|
||||||
|
---
|
||||||
|
omx/gstomxvideodec.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
|
||||||
|
index e044c78..e441cd4 100755
|
||||||
|
--- a/omx/gstomxvideodec.c
|
||||||
|
+++ b/omx/gstomxvideodec.c
|
||||||
|
@@ -544,7 +544,7 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self,
|
||||||
|
(guint) port_def->format.video.nFrameWidth,
|
||||||
|
(guint) port_def->format.video.nFrameHeight,
|
||||||
|
vinfo->width, vinfo->height);
|
||||||
|
- goto done;
|
||||||
|
+ //goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Same strides and everything */
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
313
board/miyoo/patches/gst-omx/0012-Add-player.patch
Normal file
313
board/miyoo/patches/gst-omx/0012-Add-player.patch
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
From 4422f386b9dd03980f93563d57b1eaf9e72e1f0a Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopex <tiopxyz@gmail.com>
|
||||||
|
Date: Tue, 15 Jul 2025 11:24:51 +0200
|
||||||
|
Subject: [PATCH] gst-play
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 2 +-
|
||||||
|
configure.ac | 1 +
|
||||||
|
player/Makefile.am | 5 +
|
||||||
|
player/gst-play.c | 257 +++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
4 files changed, 264 insertions(+), 1 deletion(-)
|
||||||
|
create mode 100644 player/Makefile.am
|
||||||
|
create mode 100644 player/gst-play.c
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index 82affc6..e8c9581 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-SUBDIRS = common omx tools config m4
|
||||||
|
+SUBDIRS = common omx tools config m4 player
|
||||||
|
|
||||||
|
if BUILD_EXAMPLES
|
||||||
|
SUBDIRS += examples
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index b1ef5fa..f2a98ce 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -388,6 +388,7 @@ config/rpi/Makefile
|
||||||
|
examples/Makefile
|
||||||
|
examples/egl/Makefile
|
||||||
|
m4/Makefile
|
||||||
|
+player/Makefile
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_OUTPUT
|
||||||
|
diff --git a/player/Makefile.am b/player/Makefile.am
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..a8f7c4c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/player/Makefile.am
|
||||||
|
@@ -0,0 +1,5 @@
|
||||||
|
+bin_PROGRAMS = gst-play
|
||||||
|
+
|
||||||
|
+gst_play_SOURCES = gst-play.c
|
||||||
|
+gst_play_CFLAGS = $(GST_CFLAGS)
|
||||||
|
+gst_play_LDADD = $(GST_LIBS)
|
||||||
|
diff --git a/player/gst-play.c b/player/gst-play.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..c1a5fa7
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/player/gst-play.c
|
||||||
|
@@ -0,0 +1,257 @@
|
||||||
|
+#include <gst/gst.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <signal.h>
|
||||||
|
+#include <termios.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+void reset_terminal_mode(void);
|
||||||
|
+void set_conio_terminal_mode(void);
|
||||||
|
+int kbhit(void);
|
||||||
|
+void int_handler(int dummy);
|
||||||
|
+static void on_pad_added(GstElement *src, GstPad *pad, gpointer user_data);
|
||||||
|
+
|
||||||
|
+static gboolean running = TRUE;
|
||||||
|
+static GstElement *pipeline;
|
||||||
|
+static GstElement *video_sink;
|
||||||
|
+static gboolean paused = FALSE;
|
||||||
|
+
|
||||||
|
+static struct termios orig_termios;
|
||||||
|
+
|
||||||
|
+void reset_terminal_mode(void) {
|
||||||
|
+ tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void set_conio_terminal_mode(void) {
|
||||||
|
+ struct termios new_termios;
|
||||||
|
+
|
||||||
|
+ tcgetattr(STDIN_FILENO, &orig_termios);
|
||||||
|
+ memcpy(&new_termios, &orig_termios, sizeof(new_termios));
|
||||||
|
+
|
||||||
|
+ new_termios.c_lflag &= ~(ICANON | ECHO);
|
||||||
|
+ new_termios.c_cc[VMIN] = 0;
|
||||||
|
+ new_termios.c_cc[VTIME] = 0;
|
||||||
|
+
|
||||||
|
+ tcsetattr(STDIN_FILENO, TCSANOW, &new_termios);
|
||||||
|
+
|
||||||
|
+ atexit(reset_terminal_mode);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int kbhit(void) {
|
||||||
|
+ unsigned char ch;
|
||||||
|
+ int nread;
|
||||||
|
+
|
||||||
|
+ nread = read(STDIN_FILENO, &ch, 1);
|
||||||
|
+ if (nread == 1) {
|
||||||
|
+ if (ch == 0x1B) { // ESC
|
||||||
|
+ unsigned char seq[2];
|
||||||
|
+ if (read(STDIN_FILENO, &seq[0], 1) == 0) return 27;
|
||||||
|
+ if (read(STDIN_FILENO, &seq[1], 1) == 0) return 27;
|
||||||
|
+
|
||||||
|
+ if (seq[0] == '[') {
|
||||||
|
+ switch (seq[1]) {
|
||||||
|
+ case 'D':
|
||||||
|
+ return 1000; // Left arrow
|
||||||
|
+ case 'C':
|
||||||
|
+ return 1001; // Right arrow
|
||||||
|
+ default:
|
||||||
|
+ return 27; // ESC
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return 27;
|
||||||
|
+ }
|
||||||
|
+ return ch;
|
||||||
|
+ }
|
||||||
|
+ return -1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void int_handler(int dummy) {
|
||||||
|
+ running = FALSE;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void on_pad_added(GstElement *src, GstPad *pad, gpointer user_data) {
|
||||||
|
+ GstCaps *caps;
|
||||||
|
+ const gchar *name;
|
||||||
|
+
|
||||||
|
+ caps = gst_pad_get_current_caps(pad);
|
||||||
|
+ name = gst_structure_get_name(gst_caps_get_structure(caps, 0));
|
||||||
|
+
|
||||||
|
+ if (g_str_has_prefix(name, "audio/")) {
|
||||||
|
+ GstElement *queue = gst_element_factory_make("queue", NULL);
|
||||||
|
+ GstElement *convert = gst_element_factory_make("audioconvert", NULL);
|
||||||
|
+ GstElement *sink = gst_element_factory_make("autoaudiosink", NULL);
|
||||||
|
+ GstPad *sinkpad;
|
||||||
|
+
|
||||||
|
+ gst_bin_add_many(GST_BIN(pipeline), queue, convert, sink, NULL);
|
||||||
|
+ gst_element_sync_state_with_parent(queue);
|
||||||
|
+ gst_element_sync_state_with_parent(convert);
|
||||||
|
+ gst_element_sync_state_with_parent(sink);
|
||||||
|
+
|
||||||
|
+ gst_element_link_many(queue, convert, sink, NULL);
|
||||||
|
+
|
||||||
|
+ sinkpad = gst_element_get_static_pad(queue, "sink");
|
||||||
|
+ if (gst_pad_link(pad, sinkpad) != GST_PAD_LINK_OK)
|
||||||
|
+ g_printerr("Failed to link audio pad\n");
|
||||||
|
+ gst_object_unref(sinkpad);
|
||||||
|
+ } else if (g_str_has_prefix(name, "video/")) {
|
||||||
|
+ GstElement *queue = gst_element_factory_make("queue", NULL);
|
||||||
|
+ GstElement *sink = video_sink;
|
||||||
|
+ GstPad *sinkpad;
|
||||||
|
+
|
||||||
|
+ gst_bin_add_many(GST_BIN(pipeline), queue, NULL);
|
||||||
|
+ gst_element_sync_state_with_parent(queue);
|
||||||
|
+
|
||||||
|
+ gst_element_link(queue, sink);
|
||||||
|
+
|
||||||
|
+ sinkpad = gst_element_get_static_pad(queue, "sink");
|
||||||
|
+ if (gst_pad_link(pad, sinkpad) != GST_PAD_LINK_OK)
|
||||||
|
+ g_printerr("Failed to link video pad\n");
|
||||||
|
+ gst_object_unref(sinkpad);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gst_caps_unref(caps);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main(int argc, char *argv[]) {
|
||||||
|
+ GstElement *src;
|
||||||
|
+ GstElement *demuxer;
|
||||||
|
+ GstBus *bus;
|
||||||
|
+ GstMessage *msg;
|
||||||
|
+
|
||||||
|
+ if (argc < 2) {
|
||||||
|
+ g_printerr("Usage: %s <file-path>\n", argv[0]);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gst_init(&argc, &argv);
|
||||||
|
+
|
||||||
|
+ src = gst_element_factory_make("filesrc", "src");
|
||||||
|
+ demuxer = gst_element_factory_make("decodebin", "decoder");
|
||||||
|
+ video_sink = gst_element_factory_make("sunxifbsink", "sink");
|
||||||
|
+
|
||||||
|
+ if (!src || !demuxer || !video_sink) {
|
||||||
|
+ g_printerr("Failed to create elements\n");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ g_object_set(src, "location", argv[1], NULL);
|
||||||
|
+ g_object_set(video_sink, "hardware-overlay", TRUE,
|
||||||
|
+ "video-memory", 2,
|
||||||
|
+ "buffer-pool", TRUE,
|
||||||
|
+ "full-screen", TRUE, NULL);
|
||||||
|
+
|
||||||
|
+ pipeline = gst_pipeline_new("player");
|
||||||
|
+
|
||||||
|
+ gst_bin_add_many(GST_BIN(pipeline), src, demuxer, video_sink, NULL);
|
||||||
|
+
|
||||||
|
+ if (!gst_element_link(src, demuxer)) {
|
||||||
|
+ g_printerr("Could not link src -> decoder\n");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ g_signal_connect(demuxer, "pad-added", G_CALLBACK(on_pad_added), NULL);
|
||||||
|
+
|
||||||
|
+ gst_element_set_state(pipeline, GST_STATE_PLAYING);
|
||||||
|
+ paused = FALSE;
|
||||||
|
+ g_print("Playing '%s'\n", argv[1]);
|
||||||
|
+ g_print("Controls: SPACE=play/pause, ESC=quit, LEFT/RIGHT=seek -/+5s\n");
|
||||||
|
+
|
||||||
|
+ signal(SIGINT, int_handler);
|
||||||
|
+ set_conio_terminal_mode();
|
||||||
|
+
|
||||||
|
+ while (running) {
|
||||||
|
+ int c = kbhit();
|
||||||
|
+
|
||||||
|
+ if (c != -1) {
|
||||||
|
+ if (c == ' ') {
|
||||||
|
+ if (paused) {
|
||||||
|
+ gst_element_set_state(pipeline, GST_STATE_PLAYING);
|
||||||
|
+ paused = FALSE;
|
||||||
|
+ g_print("Resumed\n");
|
||||||
|
+ } else {
|
||||||
|
+ gst_element_set_state(pipeline, GST_STATE_PAUSED);
|
||||||
|
+ paused = TRUE;
|
||||||
|
+ g_print("Paused\n");
|
||||||
|
+ }
|
||||||
|
+ } else if (c == 27) {
|
||||||
|
+ g_print("Exiting...\n");
|
||||||
|
+ running = FALSE;
|
||||||
|
+ } else if (c == 1000 || c == 1001) {
|
||||||
|
+ gint64 current_pos;
|
||||||
|
+ gint64 duration;
|
||||||
|
+ gint64 seek_offset;
|
||||||
|
+ gint64 new_pos;
|
||||||
|
+ gboolean res;
|
||||||
|
+
|
||||||
|
+ current_pos = GST_CLOCK_TIME_NONE;
|
||||||
|
+ duration = GST_CLOCK_TIME_NONE;
|
||||||
|
+
|
||||||
|
+ if (!gst_element_query_position(pipeline, GST_FORMAT_TIME, ¤t_pos)) {
|
||||||
|
+ g_print("Cannot query position\n");
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!gst_element_query_duration(pipeline, GST_FORMAT_TIME, &duration)) {
|
||||||
|
+ g_print("Cannot query duration\n");
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ seek_offset = 5 * GST_SECOND;
|
||||||
|
+ if (c == 1000)
|
||||||
|
+ seek_offset = -seek_offset;
|
||||||
|
+
|
||||||
|
+ new_pos = current_pos + seek_offset;
|
||||||
|
+
|
||||||
|
+ if (new_pos < 0)
|
||||||
|
+ new_pos = 0;
|
||||||
|
+ if (new_pos > duration)
|
||||||
|
+ new_pos = duration;
|
||||||
|
+
|
||||||
|
+ res = gst_element_seek_simple(
|
||||||
|
+ pipeline,
|
||||||
|
+ GST_FORMAT_TIME,
|
||||||
|
+ GST_SEEK_FLAG_FLUSH,
|
||||||
|
+ new_pos);
|
||||||
|
+
|
||||||
|
+ if (res) {
|
||||||
|
+ g_print("Seeked to %" GST_TIME_FORMAT "\n", GST_TIME_ARGS(new_pos));
|
||||||
|
+ } else {
|
||||||
|
+ g_print("Seek failed\n");
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ bus = gst_element_get_bus(pipeline);
|
||||||
|
+ while ((msg = gst_bus_pop(bus)) != NULL) {
|
||||||
|
+ switch (GST_MESSAGE_TYPE(msg)) {
|
||||||
|
+ case GST_MESSAGE_EOS:
|
||||||
|
+ g_print("End of stream\n");
|
||||||
|
+ running = FALSE;
|
||||||
|
+ break;
|
||||||
|
+ case GST_MESSAGE_ERROR: {
|
||||||
|
+ GError *err;
|
||||||
|
+ gchar *dbg;
|
||||||
|
+ gst_message_parse_error(msg, &err, &dbg);
|
||||||
|
+ g_printerr("Error: %s\n", err->message);
|
||||||
|
+ g_error_free(err);
|
||||||
|
+ g_free(dbg);
|
||||||
|
+ running = FALSE;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ default:
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ gst_message_unref(msg);
|
||||||
|
+ }
|
||||||
|
+ gst_object_unref(bus);
|
||||||
|
+
|
||||||
|
+ usleep(100 * 1000); // 100ms
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gst_element_set_state(pipeline, GST_STATE_NULL);
|
||||||
|
+ gst_object_unref(pipeline);
|
||||||
|
+ g_print("Pipeline stopped\n");
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ BR2_LINUX_KERNEL=y
|
|||||||
BR2_LINUX_KERNEL_CUSTOM_GIT=y
|
BR2_LINUX_KERNEL_CUSTOM_GIT=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MiyooCFW/kernel.git"
|
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MiyooCFW/kernel.git"
|
||||||
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="origin/master"
|
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="origin/master"
|
||||||
BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel"
|
BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel/patch/musl"
|
||||||
BR2_LINUX_KERNEL_DEFCONFIG="miyoo"
|
BR2_LINUX_KERNEL_DEFCONFIG="miyoo"
|
||||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="suniv-f1c100s-miyoo suniv-f1c100s-miyoo-4bit"
|
BR2_LINUX_KERNEL_INTREE_DTS_NAME="suniv-f1c100s-miyoo suniv-f1c100s-miyoo-4bit"
|
||||||
@@ -47,14 +47,32 @@ BR2_PACKAGE_FFMPEG_FFPLAY=y
|
|||||||
BR2_PACKAGE_FFMPEG_FFPROBE=y
|
BR2_PACKAGE_FFMPEG_FFPROBE=y
|
||||||
BR2_PACKAGE_FFMPEG_AVRESAMPLE=y
|
BR2_PACKAGE_FFMPEG_AVRESAMPLE=y
|
||||||
BR2_PACKAGE_FFMPEG_POSTPROC=y
|
BR2_PACKAGE_FFMPEG_POSTPROC=y
|
||||||
BR2_PACKAGE_FFMPEG_ENCODERS="aac ac3 flac jpegls libx264 libx264rgb libopus mpeg1video mpeg2video mpeg4 pcm_s16be pcm_s16le pcm_s16le_planar png rawvideo vorbis wavpack zlib"
|
BR2_PACKAGE_FFMPEG_ENCODERS="aac ac3 flac jpegls libx264 libx264rgb libopus mpeg1video mpeg2video mpeg4 pcm_s16be pcm_s16le pcm_s16le_planar png rawvideo vorbis wavpack zlib h264_omx"
|
||||||
BR2_PACKAGE_FFMPEG_DECODERS="aac ac3 flac jpegls libopus mp2 mp3 mpeg1video mpeg2video mpeg4 mpegvideo png h264 hevc vc1 opus pcm_s16be pcm_s16le pcm_s16le_planar rawvideo vorbis wavpack yuv4 zlib"
|
BR2_PACKAGE_FFMPEG_DECODERS="aac ac3 flac jpegls libopus mp2 mp3 mpeg1video mpeg2video mpeg4 mpegvideo png h264 hevc vc1 opus pcm_s16be pcm_s16le pcm_s16le_planar rawvideo vorbis wavpack yuv4 zlib"
|
||||||
BR2_PACKAGE_FFMPEG_MUXERS="ac3 avi flac ffm h264 hevc matroska ogg opus mov mp3 mp4 mpeg1video mpeg2video mpegts m4v pcm_s16be pcm_s16le rawvideo rtp wav yuv4mpegpipe"
|
BR2_PACKAGE_FFMPEG_MUXERS="ac3 avi flac ffm h264 hevc matroska ogg opus mov mp3 mp4 mpeg1video mpeg2video mpegts m4v pcm_s16be pcm_s16le rawvideo rtp wav yuv4mpegpipe"
|
||||||
BR2_PACKAGE_FFMPEG_DEMUXERS="aac avi h264 flac matroska mov mp3 mpegps mpegts mpegvideo ogg pcm_s16be pcm_s16le rawvideo wav yuv4mpegpipe"
|
BR2_PACKAGE_FFMPEG_DEMUXERS="aac avi h264 flac matroska mov mp3 mpegps mpegts mpegvideo ogg pcm_s16be pcm_s16le rawvideo wav yuv4mpegpipe"
|
||||||
BR2_PACKAGE_FFMPEG_PARSERS="aac flac ac3 h264 hevc mpegaudio mpeg4video mpegvideo opus vc1 vorbis"
|
BR2_PACKAGE_FFMPEG_PARSERS="aac flac ac3 h264 hevc mpegaudio mpeg4video mpegvideo opus vc1 vorbis"
|
||||||
BR2_PACKAGE_FFMPEG_BSFS=""
|
BR2_PACKAGE_FFMPEG_BSFS=""
|
||||||
BR2_PACKAGE_FFMPEG_PROTOCOLS="file"
|
BR2_PACKAGE_FFMPEG_PROTOCOLS="file"
|
||||||
BR2_PACKAGE_FFMPEG_EXTRACONF="--enable-small"
|
BR2_PACKAGE_FFMPEG_EXTRACONF="--enable-small --enable-omx"
|
||||||
|
BR2_PACKAGE_GSTREAMER1=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BASE_INSTALL_TOOLS=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOCONVERT=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEORATE=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_ALSA=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_GOOD=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_AUTODETECT=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MATROSKA=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_VIDEOFILTER=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_AUTOCONVERT=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_RAWPARSE=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOPARSERS=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOSIGNAL=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FBDEV=y
|
||||||
|
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FDK_AAC=y
|
||||||
|
BR2_PACKAGE_GST_FBDEV2_PLUGINS=y
|
||||||
|
BR2_PACKAGE_GST_OMX=y
|
||||||
BR2_PACKAGE_VORBIS_TOOLS=y
|
BR2_PACKAGE_VORBIS_TOOLS=y
|
||||||
BR2_PACKAGE_P7ZIP=y
|
BR2_PACKAGE_P7ZIP=y
|
||||||
BR2_PACKAGE_XZ=y
|
BR2_PACKAGE_XZ=y
|
||||||
@@ -115,6 +133,10 @@ BR2_PACKAGE_DBUS=y
|
|||||||
BR2_PACKAGE_GPTFDISK=y
|
BR2_PACKAGE_GPTFDISK=y
|
||||||
BR2_PACKAGE_GPTFDISK_GDISK=y
|
BR2_PACKAGE_GPTFDISK_GDISK=y
|
||||||
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
||||||
|
BR2_PACKAGE_LIBCEDARC=y
|
||||||
|
BR2_PACKAGE_LIBCEDARC_ARCHLIB="toolchain-sunxi-arm9-musl"
|
||||||
|
BR2_PACKAGE_LIBCEDARC_DECODER=y
|
||||||
|
BR2_PACKAGE_LIBCEDARC_OPENMAX=y
|
||||||
BR2_PACKAGE_LINUXCONSOLETOOLS=y
|
BR2_PACKAGE_LINUXCONSOLETOOLS=y
|
||||||
BR2_PACKAGE_LINUXCONSOLETOOLS_JOYSTICK=y
|
BR2_PACKAGE_LINUXCONSOLETOOLS_JOYSTICK=y
|
||||||
BR2_PACKAGE_PARTED=y
|
BR2_PACKAGE_PARTED=y
|
||||||
|
|||||||
@@ -515,6 +515,7 @@ endmenu
|
|||||||
source "package/joy2key/Config.in"
|
source "package/joy2key/Config.in"
|
||||||
source "package/kbd/Config.in"
|
source "package/kbd/Config.in"
|
||||||
source "package/lcdproc/Config.in"
|
source "package/lcdproc/Config.in"
|
||||||
|
source "package/libcedarc/Config.in"
|
||||||
source "package/libiec61850/Config.in"
|
source "package/libiec61850/Config.in"
|
||||||
source "package/libubootenv/Config.in"
|
source "package/libubootenv/Config.in"
|
||||||
source "package/libuio/Config.in"
|
source "package/libuio/Config.in"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ FFMPEG_CONF_OPTS = \
|
|||||||
--disable-symver \
|
--disable-symver \
|
||||||
--disable-doc
|
--disable-doc
|
||||||
|
|
||||||
FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
|
FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf $(if $(BR2_PACKAGE_LIBCEDARC),libcedarc)
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
|
ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
|
||||||
FFMPEG_CONF_OPTS += --enable-gpl
|
FFMPEG_CONF_OPTS += --enable-gpl
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ source "package/gstreamer1/gst1-plugins-bayer2rgb-neon/Config.in"
|
|||||||
source "package/gstreamer1/gst1-plugins-good/Config.in"
|
source "package/gstreamer1/gst1-plugins-good/Config.in"
|
||||||
source "package/gstreamer1/gst1-plugins-bad/Config.in"
|
source "package/gstreamer1/gst1-plugins-bad/Config.in"
|
||||||
source "package/gstreamer1/gst1-plugins-ugly/Config.in"
|
source "package/gstreamer1/gst1-plugins-ugly/Config.in"
|
||||||
|
source "package/gstreamer1/gst-fbdev2-plugins/Config.in"
|
||||||
source "package/gstreamer1/gst1-devtools/Config.in"
|
source "package/gstreamer1/gst1-devtools/Config.in"
|
||||||
source "package/gstreamer1/gst1-imx/Config.in"
|
source "package/gstreamer1/gst1-imx/Config.in"
|
||||||
source "package/gstreamer1/gst1-interpipe/Config.in"
|
source "package/gstreamer1/gst1-interpipe/Config.in"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
From 6b5a236aeaac29afa607ac84246c9f840a61f24a Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopex <tiopxyz@gmail.com>
|
||||||
|
Date: Fri, 20 Jun 2025 23:48:05 +0200
|
||||||
|
Subject: [PATCH] framebuffersink: remove log for unexpected system memory
|
||||||
|
overlay
|
||||||
|
|
||||||
|
---
|
||||||
|
src/gstframebuffersink.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/gstframebuffersink.c b/src/gstframebuffersink.c
|
||||||
|
index 934e6eb..a967cdb 100644
|
||||||
|
--- a/src/gstframebuffersink.c
|
||||||
|
+++ b/src/gstframebuffersink.c
|
||||||
|
@@ -2299,8 +2299,8 @@ GstBuffer * buf)
|
||||||
|
overlay frame from system memory (which shouldn't normally happen)
|
||||||
|
poses a bit of problem. We need to allocate a temporary video memory
|
||||||
|
area to store the overlay frame and show it. */
|
||||||
|
- GST_FRAMEBUFFERSINK_MESSAGE_OBJECT (framebuffersink,
|
||||||
|
- "Unexpected system memory overlay in buffer pool mode");
|
||||||
|
+// GST_FRAMEBUFFERSINK_MESSAGE_OBJECT (framebuffersink,
|
||||||
|
+// "Unexpected system memory overlay in buffer pool mode");
|
||||||
|
|
||||||
|
GstMemory *vmem;
|
||||||
|
vmem = gst_allocator_alloc(
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
From c8cb9db356cb7edba473ecf58ddad1209b6fd5e2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopxyz <tiopxyz@gmail.com>
|
||||||
|
Date: Thu, 10 Jul 2025 15:08:29 +0200
|
||||||
|
Subject: [PATCH] sunxifbsink: infer input width/height from upstream caps if
|
||||||
|
not set manually
|
||||||
|
|
||||||
|
---
|
||||||
|
src/gstframebuffersink.c | 47 +++++++++++++++++++++++++---------------
|
||||||
|
1 file changed, 30 insertions(+), 17 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/gstframebuffersink.c b/src/gstframebuffersink.c
|
||||||
|
index a967cdb..9d43c24 100644
|
||||||
|
--- a/src/gstframebuffersink.c
|
||||||
|
+++ b/src/gstframebuffersink.c
|
||||||
|
@@ -1144,23 +1144,36 @@ gst_framebuffersink_caps_set_preferences (GstFramebufferSink *framebuffersink,
|
||||||
|
/* If hardware scaling is supported, and a specific video size is requested,
|
||||||
|
allow any reasonable size (except when the width/height_before_scaler
|
||||||
|
properties are set) and use the scaler. */
|
||||||
|
- if (framebuffersink->use_hardware_overlay &&
|
||||||
|
- (framebuffersink->requested_video_width != 0 ||
|
||||||
|
- framebuffersink->requested_video_height != 0)) {
|
||||||
|
- if (framebuffersink->width_before_scaling != 0)
|
||||||
|
- gst_caps_set_simple (caps, "width", G_TYPE_INT,
|
||||||
|
- framebuffersink->width_before_scaling, NULL);
|
||||||
|
- else
|
||||||
|
- gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1,
|
||||||
|
- GST_VIDEO_INFO_WIDTH (&framebuffersink->screen_info), NULL);
|
||||||
|
- if (framebuffersink->height_before_scaling != 0)
|
||||||
|
- gst_caps_set_simple (caps, "height", G_TYPE_INT,
|
||||||
|
- framebuffersink->height_before_scaling, NULL);
|
||||||
|
- else
|
||||||
|
- gst_caps_set_simple (caps, "height", GST_TYPE_INT_RANGE, 1,
|
||||||
|
- GST_VIDEO_INFO_HEIGHT (&framebuffersink->screen_info), NULL);
|
||||||
|
- goto skip_video_size_request;
|
||||||
|
- }
|
||||||
|
+ if (framebuffersink->use_hardware_overlay &&
|
||||||
|
+ (framebuffersink->requested_video_width != 0 ||
|
||||||
|
+ framebuffersink->requested_video_height != 0)) {
|
||||||
|
+
|
||||||
|
+ gint upstream_width = 0;
|
||||||
|
+ gint upstream_height = 0;
|
||||||
|
+
|
||||||
|
+ GstStructure *structure = gst_caps_get_structure(caps, 0);
|
||||||
|
+ gst_structure_get_int(structure, "width", &upstream_width);
|
||||||
|
+ gst_structure_get_int(structure, "height", &upstream_height);
|
||||||
|
+
|
||||||
|
+ // width
|
||||||
|
+ if (framebuffersink->width_before_scaling != 0) {
|
||||||
|
+ gst_caps_set_simple(caps, "width", G_TYPE_INT,
|
||||||
|
+ framebuffersink->width_before_scaling, NULL);
|
||||||
|
+ } else if (upstream_width > 0) {
|
||||||
|
+ gst_caps_set_simple(caps, "width", G_TYPE_INT, upstream_width, NULL);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // height
|
||||||
|
+ if (framebuffersink->height_before_scaling != 0) {
|
||||||
|
+ gst_caps_set_simple(caps, "height", G_TYPE_INT,
|
||||||
|
+ framebuffersink->height_before_scaling, NULL);
|
||||||
|
+ } else if (upstream_height > 0) {
|
||||||
|
+ gst_caps_set_simple(caps, "height", G_TYPE_INT, upstream_height, NULL);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ goto skip_video_size_request;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
|
||||||
|
/* Honour video size requests, otherwise set the allowable range up to the
|
||||||
|
screen size. */
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
6
package/gstreamer1/gst-fbdev2-plugins/Config.in
Normal file
6
package/gstreamer1/gst-fbdev2-plugins/Config.in
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
config BR2_PACKAGE_GST_FBDEV2_PLUGINS
|
||||||
|
bool "gst-fbdev2-plugins"
|
||||||
|
depends on BR2_PACKAGE_LIBCEDARC
|
||||||
|
select BR2_PACKAGE_GST1_PLUGINS_BASE
|
||||||
|
help
|
||||||
|
GStreamer plug-in to use sunxifbsink
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Locally calculated
|
||||||
|
sha256 03d539f7286faf36fcbdf2a93371ba9945f65a13c8be4e62a6b9ab9a2dfad168 gst-fbdev2-plugins-d576ab21adbb5eacb1000a89fbaea14576784b10.tar.gz
|
||||||
19
package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.mk
Normal file
19
package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.mk
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# gst-fbdev2-plugins
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
GST_FBDEV2_PLUGINS_VERSION = d576ab21adbb5eacb1000a89fbaea14576784b10
|
||||||
|
GST_FBDEV2_PLUGINS_SITE = $(call github,hglm,gst-fbdev2-plugins,$(GST_FBDEV2_PLUGINS_VERSION))
|
||||||
|
|
||||||
|
GST_FBDEV2_PLUGINS_LICENSE = LGPL-2.1
|
||||||
|
GST_FBDEV2_PLUGINS_LICENSE_FILES = COPYING
|
||||||
|
GST_FBDEV2_PLUGINS_DEPENDENCIES = gstreamer1 gst1-plugins-base gst-omx libglib2 libdrm libtool
|
||||||
|
GST_FBDEV2_PLUGINS_AUTORECONF = YES
|
||||||
|
define GST_FBDEV2_PLUGINS_PRE_PATCH_HOOK
|
||||||
|
$(SED) 's/-lgstframebuffersink/libgstframebuffersink.la/g' $(@D)/src/Makefile.am
|
||||||
|
endef
|
||||||
|
GST_FBDEV2_PLUGINS_PRE_PATCH_HOOKS += GST_FBDEV2_PLUGINS_PRE_PATCH_HOOK
|
||||||
|
|
||||||
|
$(eval $(autotools-package))
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
config BR2_PACKAGE_GST_OMX
|
config BR2_PACKAGE_GST_OMX
|
||||||
bool "gst-omx"
|
bool "gst-omx"
|
||||||
depends on BR2_PACKAGE_HAS_LIBOPENMAX
|
depends on BR2_PACKAGE_HAS_LIBOPENMAX || \
|
||||||
|
BR2_PACKAGE_LIBCEDARC
|
||||||
select BR2_PACKAGE_GST1_PLUGINS_BASE
|
select BR2_PACKAGE_GST1_PLUGINS_BASE
|
||||||
help
|
help
|
||||||
GStreamer plug-in to use OpenMAX API.
|
GStreamer plug-in to use OpenMAX API.
|
||||||
|
|
||||||
https://cgit.freedesktop.org/gstreamer/gst-omx
|
https://cgit.freedesktop.org/gstreamer/gst-omx
|
||||||
|
|
||||||
comment "gst-omx requires a OpenMAX implementation"
|
comment "gst-omx requires a libopenmax or libcedarc implementation"
|
||||||
depends on !BR2_PACKAGE_HAS_LIBOPENMAX
|
depends on !BR2_PACKAGE_HAS_LIBOPENMAX && \
|
||||||
|
!BR2_PACKAGE_LIBCEDARC
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# From https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.20.4.tar.xz.sha256sum
|
# From https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.10.4.tar.xz.sha256sum
|
||||||
sha256 70ddd485e2dcab79070164d61ad2ff3a63e15a1d7abf9075d86eb77762b0edfd gst-omx-1.20.4.tar.xz
|
sha256 45072925cf262f0fd528fab78f0de52734e46a5a88aa802fae51c67c09c81aa2 gst-omx-1.10.4.tar.xz
|
||||||
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING
|
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING
|
||||||
|
|||||||
@@ -4,36 +4,31 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
GST_OMX_VERSION = 1.20.4
|
GST_OMX_VERSION = 1.10.4
|
||||||
GST_OMX_SOURCE = gst-omx-$(GST_OMX_VERSION).tar.xz
|
GST_OMX_SOURCE = gst-omx-$(GST_OMX_VERSION).tar.xz
|
||||||
GST_OMX_SITE = https://gstreamer.freedesktop.org/src/gst-omx
|
GST_OMX_SITE = https://gstreamer.freedesktop.org/src/gst-omx
|
||||||
|
|
||||||
GST_OMX_LICENSE = LGPL-2.1
|
GST_OMX_LICENSE = LGPL-2.1
|
||||||
GST_OMX_LICENSE_FILES = COPYING
|
GST_OMX_LICENSE_FILES = COPYING
|
||||||
|
|
||||||
GST_OMX_CONF_OPTS = \
|
GST_OMX_VARIANT = bellagio
|
||||||
-Dexamples=disabled \
|
GST_OMX_CONF_ENV = \
|
||||||
-Dtests=disabled \
|
CFLAGS="$(TARGET_CFLAGS) \
|
||||||
-Dtools=disabled \
|
-DOMX_VERSION_MAJOR=1 \
|
||||||
-Ddoc=disabled
|
-DOMX_VERSION_MINOR=1 \
|
||||||
|
-DOMX_VERSION_REVISION=2 \
|
||||||
|
-DOMX_VERSION_STEP=0"
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
|
GST_OMX_CONF_OPTS += --with-omx-target=$(GST_OMX_VARIANT)
|
||||||
GST_OMX_VARIANT = rpi
|
|
||||||
GST_OMX_CONF_OPTS += -Dheader_path=$(STAGING_DIR)/usr/include/IL
|
|
||||||
else
|
|
||||||
GST_OMX_VARIANT = generic
|
|
||||||
endif
|
|
||||||
|
|
||||||
GST_OMX_CONF_OPTS += -Dtarget=$(GST_OMX_VARIANT)
|
GST_OMX_DEPENDENCIES = gstreamer1 gst1-plugins-base libcedarc
|
||||||
|
|
||||||
GST_OMX_DEPENDENCIES = gstreamer1 gst1-plugins-base libopenmax
|
|
||||||
|
|
||||||
# adjust library paths to where buildroot installs them
|
# adjust library paths to where buildroot installs them
|
||||||
define GST_OMX_FIXUP_CONFIG_PATHS
|
define GST_OMX_FIXUP_CONFIG_PATHS
|
||||||
find $(@D)/config -name gstomx.conf | \
|
find $(@D)/config -name gstomx.conf | \
|
||||||
xargs $(SED) 's|/usr/local|/usr|g' -e 's|/opt/vc|/usr|g'
|
xargs $(SED) 's|/usr/local|/usr|g' -e 's|/opt/vc|/usr|g'
|
||||||
endef
|
endef
|
||||||
|
GST_OMX_AUTORECONF = YES
|
||||||
GST_OMX_POST_PATCH_HOOKS += GST_OMX_FIXUP_CONFIG_PATHS
|
GST_OMX_POST_PATCH_HOOKS += GST_OMX_FIXUP_CONFIG_PATHS
|
||||||
|
|
||||||
$(eval $(meson-package))
|
$(eval $(autotools-package))
|
||||||
|
|||||||
435
package/libcedarc/0001-Add-converstion-to-YV12.patch
Normal file
435
package/libcedarc/0001-Add-converstion-to-YV12.patch
Normal file
@@ -0,0 +1,435 @@
|
|||||||
|
From ec3025abfdec1bdebe76a5f92cce8de3a73bff60 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tiopxyz <tiopxyz@gmail.com>
|
||||||
|
Date: Fri, 11 Jul 2025 23:25:13 +0200
|
||||||
|
Subject: [PATCH] F1C100s: VDU supports only YUV_MB32_420; convert manually to YV12
|
||||||
|
|
||||||
|
On F1C100s boards, the video decoder supports only the
|
||||||
|
YUV_MB32_420 format, which is YUV420 stored in 32×32 macroblocks.
|
||||||
|
|
||||||
|
This format is not natively supported in GStreamer, so manual conversion
|
||||||
|
to standard YV12 is necessary for compatibility with existing video sinks.
|
||||||
|
|
||||||
|
---
|
||||||
|
openmax/vdec/src/omx_vdec_aw_decoder_linux.c | 75 +++++-
|
||||||
|
vdecoder/pixel_format.c | 258 +++++++++++++++++++
|
||||||
|
2 files changed, 330 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/openmax/vdec/src/omx_vdec_aw_decoder_linux.c b/openmax/vdec/src/omx_vdec_aw_decoder_linux.c
|
||||||
|
index 8a619ca..2976fca 100644
|
||||||
|
--- a/openmax/vdec/src/omx_vdec_aw_decoder_linux.c
|
||||||
|
+++ b/openmax/vdec/src/omx_vdec_aw_decoder_linux.c
|
||||||
|
@@ -71,6 +71,10 @@ typedef struct OmxAwDecoderContext
|
||||||
|
VideoPicture* pPicture;
|
||||||
|
|
||||||
|
OMX_BOOL bUseZeroCopyBuffer;
|
||||||
|
+ char* pYV12;
|
||||||
|
+ VideoPicture CvtPicture;
|
||||||
|
+ int tWidth;
|
||||||
|
+ int tHeight;
|
||||||
|
|
||||||
|
|
||||||
|
}OmxAwDecoderContext;
|
||||||
|
@@ -403,6 +407,52 @@ static void liReopenVideoEngine(OmxAwDecoderContext *pCtx)
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int yv12_align_fill(char* p_dst, int w, int h, int aw, int ah)
|
||||||
|
+{
|
||||||
|
+ int i, j;
|
||||||
|
+ int map = aw * ah;
|
||||||
|
+ int v_size = (map) >> 2;
|
||||||
|
+ char *pv = p_dst + map;
|
||||||
|
+ char *pu = pv + v_size;// / 4
|
||||||
|
+
|
||||||
|
+ int dw = aw - w;
|
||||||
|
+ int dh = ah -h;
|
||||||
|
+ int dw_h = dw / 2;
|
||||||
|
+ int dh_h = dh / 2;
|
||||||
|
+ int w_h = w / 2;
|
||||||
|
+ int h_h = h / 2;
|
||||||
|
+ int aw_h = aw / 2;
|
||||||
|
+ int ah_h = ah / 2;
|
||||||
|
+ int map_oft = aw_h * h_h;
|
||||||
|
+
|
||||||
|
+ if((w == aw) && (h == ah))
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ for(i=0;i<h_h;i++)
|
||||||
|
+ {
|
||||||
|
+ for(j=0;j<dw_h;j++)
|
||||||
|
+ {
|
||||||
|
+ pv[w_h + j + aw_h * i] = 128;
|
||||||
|
+ pu[w_h + j + aw_h * i] = 128;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ for(i=0;i<dh_h;i++)
|
||||||
|
+ {
|
||||||
|
+ for(j=0;j<aw_h;j++)
|
||||||
|
+ {
|
||||||
|
+ pv[map_oft + j + aw_h * i] = 128;
|
||||||
|
+ pu[map_oft + j + aw_h * i] = 128;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int __liCallback(OmxDecoder* pDec, DecoderCallback callback,
|
||||||
|
void* pUserData)
|
||||||
|
{
|
||||||
|
@@ -471,7 +521,7 @@ static int __liPrepare(OmxDecoder* pDec)
|
||||||
|
|
||||||
|
pCtx->mVideoConfig.nAlignStride = pCtx->mGpuAlignStride;
|
||||||
|
|
||||||
|
- pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YV12;//* Used to be YV12.
|
||||||
|
+ pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YUV_MB32_420;//* Used to be YV12.
|
||||||
|
|
||||||
|
#if (ENABLE_SCALEDOWN_WHEN_RESOLUTION_MOER_THAN_1080P)
|
||||||
|
if (pCtx->mStreamInfo.nWidth > 1920
|
||||||
|
@@ -482,6 +532,10 @@ static int __liPrepare(OmxDecoder* pDec)
|
||||||
|
pCtx->mVideoConfig.nVerticalScaleDownRatio = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+ pCtx->tWidth = pCtx->mStreamInfo.nWidth;
|
||||||
|
+ pCtx->tHeight = pCtx->mStreamInfo.nHeight;
|
||||||
|
+ pCtx->mStreamInfo.nWidth = (pCtx->mStreamInfo.nWidth + 31) & ~31;
|
||||||
|
+ pCtx->mStreamInfo.nHeight = (pCtx->mStreamInfo.nHeight + 31) & ~31;
|
||||||
|
|
||||||
|
if(pCtx->mStreamInfo.eCodecFormat == VIDEO_CODEC_FORMAT_WMV3)
|
||||||
|
{
|
||||||
|
@@ -506,6 +560,14 @@ static int __liPrepare(OmxDecoder* pDec)
|
||||||
|
ret = InitializeVideoDecoder(pCtx->m_decoder,
|
||||||
|
&(pCtx->mStreamInfo),
|
||||||
|
&pCtx->mVideoConfig);
|
||||||
|
+ pCtx->pYV12 = (char*)malloc(sizeof(char) * pCtx->mStreamInfo.nWidth * pCtx->mStreamInfo.nHeight * 3 / 2);
|
||||||
|
+ if(pCtx->pYV12 == NULL)
|
||||||
|
+ {
|
||||||
|
+ loge("pCtx->pYV12 malloc fail\n");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ pCtx->CvtPicture.pData0 = pCtx->pYV12;
|
||||||
|
+ pCtx->CvtPicture.ePixelFormat = PIXEL_FORMAT_YV12;
|
||||||
|
if(ret != 0)
|
||||||
|
{
|
||||||
|
DestroyVideoDecoder(pCtx->m_decoder);
|
||||||
|
@@ -706,12 +768,14 @@ static OMX_BUFFERHEADERTYPE* __liDrain(OmxDecoder* pDec)
|
||||||
|
pCtx->pPicture->nWidth, pCtx->pPicture->nHeight,
|
||||||
|
pCtx->pPicture->nTopOffset,pCtx->pPicture->nBottomOffset,
|
||||||
|
pCtx->pPicture->nLeftOffset,pCtx->pPicture->nRightOffset);
|
||||||
|
+ RotatePicture(pCtx->decMemOps, pCtx->pPicture, &pCtx->CvtPicture, 0, 32, 32);
|
||||||
|
+ yv12_align_fill(pCtx->CvtPicture.pData0, pCtx-> tWidth, pCtx-> tHeight, pCtx->mStreamInfo.nWidth, pCtx->mStreamInfo.nHeight);
|
||||||
|
CdcMemFlushCache(pCtx->decMemOps, (void*)pCtx->pPicture->pData0,
|
||||||
|
pCtx->pPicture->nLineStride * pCtx->pPicture->nHeight*3/2);
|
||||||
|
OMX_PARAM_PORTDEFINITIONTYPE* outDef = getPortDef(pCtx->pOutPort);
|
||||||
|
#if USE_ALIGN_SIZE
|
||||||
|
AlignCopyYV12((unsigned char*)pOutBufHdr->pBuffer,
|
||||||
|
- (unsigned char*)pCtx->pPicture->pData0,
|
||||||
|
+ (unsigned char*)pCtx->CvtPicture.pData0,
|
||||||
|
outDef->format.video.nFrameWidth,
|
||||||
|
outDef->format.video.nFrameHeight);
|
||||||
|
|
||||||
|
@@ -785,6 +849,11 @@ static void __liClose(OmxDecoder* pDec)
|
||||||
|
DestroyVideoDecoder(pCtx->m_decoder);
|
||||||
|
pCtx->m_decoder = NULL;
|
||||||
|
}
|
||||||
|
+ if(pCtx->pYV12 != NULL)
|
||||||
|
+ {
|
||||||
|
+ free(pCtx->pYV12);
|
||||||
|
+ pCtx->pYV12 = NULL;
|
||||||
|
+ }
|
||||||
|
pCtx->mCodecSpecificDataLen = 0;
|
||||||
|
memset(pCtx->mCodecSpecificData, 0 , CODEC_SPECIFIC_DATA_LENGTH);
|
||||||
|
OmxReleaseMutex(pCtx->awMutexHandler);
|
||||||
|
@@ -835,7 +904,7 @@ static int __liSetOutputEos(OmxDecoder* pDec)
|
||||||
|
static void __liGetFormat(OmxDecoder* pDec)
|
||||||
|
{
|
||||||
|
OmxAwDecoderContext *pCtx = (OmxAwDecoderContext*)pDec;
|
||||||
|
- pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YV12;
|
||||||
|
+ pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YUV_MB32_420;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void __liSetExtBufNum(OmxDecoder* pDec, OMX_S32 num)
|
||||||
|
diff --git a/vdecoder/pixel_format.c b/vdecoder/pixel_format.c
|
||||||
|
index 3d47e6a..3fda569 100755
|
||||||
|
--- a/vdecoder/pixel_format.c
|
||||||
|
+++ b/vdecoder/pixel_format.c
|
||||||
|
@@ -556,6 +556,259 @@ void ConvertMb32422ToYv12C(char* pSrc,char* pDstU, char*pDstV,int nPicWidth, int
|
||||||
|
//****************************************************************//
|
||||||
|
//****************************************************************//
|
||||||
|
|
||||||
|
+static void MB32_CVT_YV12(char* pSrc, char* pSrc_v, char* pDst, int nWidth, int nHeight)
|
||||||
|
+{
|
||||||
|
+ int i = 0;
|
||||||
|
+ int j = 0;
|
||||||
|
+ int m = 0;
|
||||||
|
+ int n = 0;
|
||||||
|
+ int k = 0;
|
||||||
|
+ int nMbWidth = 0;
|
||||||
|
+ int nMbHeight = 0;
|
||||||
|
+ int nMbWidth_uv = 0;
|
||||||
|
+ int nMbHeight_uv = 0;
|
||||||
|
+ int nLineStride = 0;
|
||||||
|
+ int nLineStride_uv = 0;
|
||||||
|
+ int lineNum = 0;
|
||||||
|
+ int lineNum_uv = 0;
|
||||||
|
+ int offset = 0;
|
||||||
|
+ int offset_uv = 0;
|
||||||
|
+ int maxNum = 0;
|
||||||
|
+ char* ptr = NULL;
|
||||||
|
+ char* ptr_uv = NULL;
|
||||||
|
+ char* pDstU = NULL;
|
||||||
|
+ char* pDstV = NULL;
|
||||||
|
+ int nWidth_uv = 0;
|
||||||
|
+ int nHeight_uv = 0;
|
||||||
|
+ char bufferY[32];
|
||||||
|
+ char bufferV[16], bufferU[16];
|
||||||
|
+ int nWidthMatchFlag = 0;
|
||||||
|
+ int nWidthMatchFlag_uv = 0;
|
||||||
|
+ int nCopyMbWidth = 0;
|
||||||
|
+ int nCopyMbWidth_uv = 0;
|
||||||
|
+ char *dstAsm = NULL;
|
||||||
|
+ char *dst0Asm = NULL;
|
||||||
|
+ char *dst1Asm = NULL;
|
||||||
|
+ char *srcAsm = NULL;
|
||||||
|
+ char *srcAsm_uv = NULL;
|
||||||
|
+
|
||||||
|
+ int bCnt2 = 1;
|
||||||
|
+
|
||||||
|
+ nLineStride = (nWidth + 15) &~15;
|
||||||
|
+ nMbWidth = (nWidth + 31)&~31;
|
||||||
|
+ nMbWidth >>= 5;//n 32 width / 32
|
||||||
|
+
|
||||||
|
+ nMbHeight = (nHeight + 31)&~31;
|
||||||
|
+ nMbHeight >>= 5;// / 32
|
||||||
|
+ ptr = pSrc;
|
||||||
|
+
|
||||||
|
+ nWidthMatchFlag = 0;
|
||||||
|
+ nCopyMbWidth = nMbWidth - 1;
|
||||||
|
+
|
||||||
|
+ nWidth_uv = (nWidth + 1) / 2;
|
||||||
|
+ nHeight_uv = (nHeight + 1) / 2;
|
||||||
|
+
|
||||||
|
+ nLineStride_uv = (nWidth_uv + 7)&~7;
|
||||||
|
+
|
||||||
|
+ nMbWidth_uv = (nWidth_uv * 2 + 31)&~31;
|
||||||
|
+ nMbWidth_uv >>= 5;// / 32
|
||||||
|
+
|
||||||
|
+ nMbHeight_uv = (nHeight_uv + 31)&~31;
|
||||||
|
+ nMbHeight_uv >>= 5;// / 32
|
||||||
|
+ ptr_uv = pSrc_v;
|
||||||
|
+ pDstU = pDst + (nWidth * nHeight) + (nWidth / 2 * nHeight / 2);
|
||||||
|
+ pDstV = pDst + (nWidth * nHeight);
|
||||||
|
+ nWidthMatchFlag_uv = 0;
|
||||||
|
+ nCopyMbWidth_uv = nMbWidth_uv - 1;
|
||||||
|
+
|
||||||
|
+ if ((nMbWidth << 5) == nLineStride)// * 32
|
||||||
|
+ {
|
||||||
|
+ nWidthMatchFlag = 1;
|
||||||
|
+ nCopyMbWidth = nMbWidth;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ((nMbWidth_uv << 4) == nLineStride_uv)//*16
|
||||||
|
+ {
|
||||||
|
+ nWidthMatchFlag_uv = 1;
|
||||||
|
+ nCopyMbWidth_uv = nMbWidth_uv;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < nMbHeight; i++)
|
||||||
|
+ {
|
||||||
|
+ for (j = 0; j < nCopyMbWidth; j++)
|
||||||
|
+ {
|
||||||
|
+ for (m = 0; m < 32; m++)
|
||||||
|
+ {
|
||||||
|
+ if (((i << 5) + m) >= nHeight)// * 32
|
||||||
|
+ {
|
||||||
|
+ ptr += 32;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ srcAsm = ptr;
|
||||||
|
+ lineNum = (i << 5) + m; //line num * 32
|
||||||
|
+ offset = lineNum * nLineStride + (j << 5);// * 32
|
||||||
|
+ dstAsm = pDst + offset;
|
||||||
|
+
|
||||||
|
+ memcpy(dstAsm, srcAsm, 32);
|
||||||
|
+
|
||||||
|
+ if (bCnt2)
|
||||||
|
+ {
|
||||||
|
+ if (((i << 4) + m) >= nHeight_uv)//i / 2 * 32
|
||||||
|
+ {
|
||||||
|
+ ptr_uv += 32;
|
||||||
|
+ ptr += 32;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ srcAsm_uv = ptr_uv;
|
||||||
|
+ lineNum_uv = (i << 4) + m; //line num i / 2 * 32
|
||||||
|
+ offset_uv = lineNum_uv * nLineStride_uv + (j << 4);// * 16
|
||||||
|
+ dst0Asm = pDstU + offset_uv;
|
||||||
|
+ dst1Asm = pDstV + offset_uv;
|
||||||
|
+
|
||||||
|
+ //memcpy(dst0Asm, srcAsm_uv, 16);
|
||||||
|
+ //memcpy(dst1Asm, (void *)(srcAsm_uv + 16), 16);
|
||||||
|
+ dst0Asm[0] = srcAsm_uv[0];
|
||||||
|
+ dst0Asm[1] = srcAsm_uv[2];
|
||||||
|
+ dst0Asm[2] = srcAsm_uv[4];
|
||||||
|
+ dst0Asm[3] = srcAsm_uv[6];
|
||||||
|
+ dst0Asm[4] = srcAsm_uv[8];
|
||||||
|
+ dst0Asm[5] = srcAsm_uv[10];
|
||||||
|
+ dst0Asm[6] = srcAsm_uv[12];
|
||||||
|
+ dst0Asm[7] = srcAsm_uv[14];
|
||||||
|
+
|
||||||
|
+ dst0Asm[8] = srcAsm_uv[16];
|
||||||
|
+ dst0Asm[9] = srcAsm_uv[18];
|
||||||
|
+ dst0Asm[10] = srcAsm_uv[20];
|
||||||
|
+ dst0Asm[11] = srcAsm_uv[22];
|
||||||
|
+ dst0Asm[12] = srcAsm_uv[24];
|
||||||
|
+ dst0Asm[13] = srcAsm_uv[26];
|
||||||
|
+ dst0Asm[14] = srcAsm_uv[28];
|
||||||
|
+ dst0Asm[15] = srcAsm_uv[30];
|
||||||
|
+
|
||||||
|
+ dst1Asm[0] = srcAsm_uv[1];
|
||||||
|
+ dst1Asm[1] = srcAsm_uv[3];
|
||||||
|
+ dst1Asm[2] = srcAsm_uv[5];
|
||||||
|
+ dst1Asm[3] = srcAsm_uv[7];
|
||||||
|
+ dst1Asm[4] = srcAsm_uv[9];
|
||||||
|
+ dst1Asm[5] = srcAsm_uv[11];
|
||||||
|
+ dst1Asm[6] = srcAsm_uv[13];
|
||||||
|
+ dst1Asm[7] = srcAsm_uv[15];
|
||||||
|
+
|
||||||
|
+ dst1Asm[8] = srcAsm_uv[17];
|
||||||
|
+ dst1Asm[9] = srcAsm_uv[19];
|
||||||
|
+ dst1Asm[10] = srcAsm_uv[21];
|
||||||
|
+ dst1Asm[11] = srcAsm_uv[23];
|
||||||
|
+ dst1Asm[12] = srcAsm_uv[25];
|
||||||
|
+ dst1Asm[13] = srcAsm_uv[27];
|
||||||
|
+ dst1Asm[14] = srcAsm_uv[29];
|
||||||
|
+ dst1Asm[15] = srcAsm_uv[31];
|
||||||
|
+
|
||||||
|
+ ptr_uv += 32;
|
||||||
|
+ }
|
||||||
|
+ ptr += 32;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (nWidthMatchFlag != 1)
|
||||||
|
+ {
|
||||||
|
+ for (m = 0; m < 32; m++)
|
||||||
|
+ {
|
||||||
|
+ if (((i << 5) + m) >= nHeight)// * 32
|
||||||
|
+ {
|
||||||
|
+ ptr += 32;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ dstAsm = bufferY;
|
||||||
|
+ srcAsm = ptr;
|
||||||
|
+ lineNum = (i << 5) + m; //line num * 32
|
||||||
|
+ offset = lineNum * nLineStride + (j << 5);// * 32
|
||||||
|
+
|
||||||
|
+ memcpy(dstAsm, srcAsm, 32);
|
||||||
|
+ ptr += 32;
|
||||||
|
+ for (k = 0; k < 32; k++)
|
||||||
|
+ {
|
||||||
|
+ if ((j * 32 + k) >= nLineStride)
|
||||||
|
+ {
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ pDst[offset + k] = bufferY[k];
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (bCnt2) {
|
||||||
|
+ if (nWidthMatchFlag_uv != 1)
|
||||||
|
+ {
|
||||||
|
+ for (m = 0; m < 32; m++)
|
||||||
|
+ {
|
||||||
|
+ if (((i << 4) + m) >= nHeight_uv)//i / 2 * 32
|
||||||
|
+ {
|
||||||
|
+ ptr_uv += 32;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ srcAsm_uv = ptr_uv;
|
||||||
|
+ lineNum_uv = (i << 4) + m; //line num i / 2 * 32
|
||||||
|
+ offset = lineNum_uv * nLineStride_uv + (j << 4);// * 16
|
||||||
|
+ dst0Asm = bufferU;
|
||||||
|
+ dst1Asm = bufferV;
|
||||||
|
+
|
||||||
|
+ //memcpy(dst0Asm, srcAsm, 16);
|
||||||
|
+ //memcpy(dst1Asm, (char *)(srcAsm + 16), 16);
|
||||||
|
+ dst0Asm[0] = srcAsm_uv[0];
|
||||||
|
+ dst0Asm[1] = srcAsm_uv[2];
|
||||||
|
+ dst0Asm[2] = srcAsm_uv[4];
|
||||||
|
+ dst0Asm[3] = srcAsm_uv[6];
|
||||||
|
+ dst0Asm[4] = srcAsm_uv[8];
|
||||||
|
+ dst0Asm[5] = srcAsm_uv[10];
|
||||||
|
+ dst0Asm[6] = srcAsm_uv[12];
|
||||||
|
+ dst0Asm[7] = srcAsm_uv[14];
|
||||||
|
+
|
||||||
|
+ dst0Asm[8] = srcAsm_uv[16];
|
||||||
|
+ dst0Asm[9] = srcAsm_uv[18];
|
||||||
|
+ dst0Asm[10] = srcAsm_uv[20];
|
||||||
|
+ dst0Asm[11] = srcAsm_uv[22];
|
||||||
|
+ dst0Asm[12] = srcAsm_uv[24];
|
||||||
|
+ dst0Asm[13] = srcAsm_uv[26];
|
||||||
|
+ dst0Asm[14] = srcAsm_uv[28];
|
||||||
|
+ dst0Asm[15] = srcAsm_uv[30];
|
||||||
|
+
|
||||||
|
+ dst1Asm[0] = srcAsm_uv[1];
|
||||||
|
+ dst1Asm[1] = srcAsm_uv[3];
|
||||||
|
+ dst1Asm[2] = srcAsm_uv[5];
|
||||||
|
+ dst1Asm[3] = srcAsm_uv[7];
|
||||||
|
+ dst1Asm[4] = srcAsm_uv[9];
|
||||||
|
+ dst1Asm[5] = srcAsm_uv[11];
|
||||||
|
+ dst1Asm[6] = srcAsm_uv[13];
|
||||||
|
+ dst1Asm[7] = srcAsm_uv[15];
|
||||||
|
+
|
||||||
|
+ dst1Asm[8] = srcAsm_uv[17];
|
||||||
|
+ dst1Asm[9] = srcAsm_uv[19];
|
||||||
|
+ dst1Asm[10] = srcAsm_uv[21];
|
||||||
|
+ dst1Asm[11] = srcAsm_uv[23];
|
||||||
|
+ dst1Asm[12] = srcAsm_uv[25];
|
||||||
|
+ dst1Asm[13] = srcAsm_uv[27];
|
||||||
|
+ dst1Asm[14] = srcAsm_uv[29];
|
||||||
|
+ dst1Asm[15] = srcAsm_uv[31];
|
||||||
|
+ ptr_uv += 32;
|
||||||
|
+
|
||||||
|
+ for (k = 0; k < 16; k++)
|
||||||
|
+ {
|
||||||
|
+ if (((j << 4) + k) >= nLineStride_uv)// j * 16
|
||||||
|
+ {
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ pDstV[offset + k] = bufferV[k];
|
||||||
|
+ pDstU[offset + k] = bufferU[k];
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ bCnt2 = !bCnt2;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void ConvertPixelFormat(VideoPicture* pPictureIn, VideoPicture* pPictureOut)
|
||||||
|
{
|
||||||
|
int nMemSizeY = 0;
|
||||||
|
@@ -584,6 +837,11 @@ void ConvertPixelFormat(VideoPicture* pPictureIn, VideoPicture* pPictureOut)
|
||||||
|
|
||||||
|
if(pPictureOut->ePixelFormat==PIXEL_FORMAT_YV12)
|
||||||
|
{
|
||||||
|
+ if(pPictureIn->ePixelFormat == PIXEL_FORMAT_YUV_MB32_420)
|
||||||
|
+ {
|
||||||
|
+ MB32_CVT_YV12(pPictureIn->pData0, pPictureIn->pData1, pPictureOut->pData0, \
|
||||||
|
+ pPictureIn->nWidth, pPictureIn->nHeight);
|
||||||
|
+ }
|
||||||
|
#ifdef CEDARX_DECODER_ARM32
|
||||||
|
if(pPictureIn->ePixelFormat == PIXEL_FORMAT_YUV_MB32_420)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
106
package/libcedarc/Config.in
Normal file
106
package/libcedarc/Config.in
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
menuconfig BR2_PACKAGE_LIBCEDARC
|
||||||
|
bool "libcedarc"
|
||||||
|
help
|
||||||
|
Allwinner Cedar Video Engine Library
|
||||||
|
|
||||||
|
if BR2_PACKAGE_LIBCEDARC
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_ARCHLIB
|
||||||
|
string "Arch library select"
|
||||||
|
default "arm-linux-gnueabihf"
|
||||||
|
help
|
||||||
|
akk44_32
|
||||||
|
anou70_32
|
||||||
|
alp50_32
|
||||||
|
alp50_64
|
||||||
|
amm60_32
|
||||||
|
amm60_64
|
||||||
|
aore80_32
|
||||||
|
arm-none-linux-gnueabi
|
||||||
|
arm-linux-gnueabi
|
||||||
|
arm-linux-gnueabihf
|
||||||
|
toolchain-sunxi-arm-glibc
|
||||||
|
toolchain-sunxi-arm-musl
|
||||||
|
toolchain-sunxi-aarch64-glibc
|
||||||
|
toolchain-sunxi-aarch64-musl
|
||||||
|
toolchain-sunxi-arm9-glibc
|
||||||
|
toolchain-sunxi-arm9-musl
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_ENCODER
|
||||||
|
bool "Encoder support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable MJPEG / H.264 / H.265 encoder
|
||||||
|
|
||||||
|
menuconfig BR2_PACKAGE_LIBCEDARC_DECODER
|
||||||
|
bool "Decoder support"
|
||||||
|
help
|
||||||
|
Allwinner Cedar Video Engine Decoder library
|
||||||
|
|
||||||
|
if BR2_PACKAGE_LIBCEDARC_DECODER
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_AVS
|
||||||
|
bool "AVS support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable AVS decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_H264
|
||||||
|
bool "H.264 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable H.264 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_H265
|
||||||
|
bool "H.265 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable H.265 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_MJPEG
|
||||||
|
bool "MJPEG support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable MJPEG decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_MPEG2
|
||||||
|
bool "MPEG2 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable MPEG2 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_MPEG4
|
||||||
|
bool "MPEG4 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable MPEG4 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_VP8
|
||||||
|
bool "VP8 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable VP8 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_VP9
|
||||||
|
bool "VP9 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable VP9 decoder
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_DECODER_WMV3
|
||||||
|
bool "WMV3 support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable WMV3 decoder
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
comment "OpenMax required both encoder & decoder support"
|
||||||
|
|
||||||
|
config BR2_PACKAGE_LIBCEDARC_OPENMAX
|
||||||
|
bool "OpenMax framework support"
|
||||||
|
depends on BR2_PACKAGE_LIBCEDARC_DECODER && BR2_PACKAGE_LIBCEDARC_ENCODER
|
||||||
|
help
|
||||||
|
Enable OpenMax framework
|
||||||
|
|
||||||
|
endif
|
||||||
2
package/libcedarc/libcedarc.hash
Normal file
2
package/libcedarc/libcedarc.hash
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Locally calculated
|
||||||
|
sha256 41133d8763bd75380c28e3037d4946508ad6fa84313be8c5051eb6d5256a2aec libcedarc-e4246be521203adb2d93d52482239044a7f9b6fe.tar.gz
|
||||||
82
package/libcedarc/libcedarc.mk
Normal file
82
package/libcedarc/libcedarc.mk
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# libcedarc
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
LIBCEDARC_VERSION = e4246be521203adb2d93d52482239044a7f9b6fe
|
||||||
|
LIBCEDARC_LICENSE = PROPRIETARY
|
||||||
|
LIBCEDARC_SITE = $(call github,aodzip,libcedarc,$(LIBCEDARC_VERSION))
|
||||||
|
LIBCEDARC_DEPENDENCIES =
|
||||||
|
LIBCEDARC_INSTALL_STAGING = YES
|
||||||
|
LIBCEDARC_INSTALL_TARGET = YES
|
||||||
|
LIBCEDARC_AUTORECONF = YES
|
||||||
|
LIBCEDARC_ARCHLIB = $(call qstrip,$(BR2_PACKAGE_LIBCEDARC_ARCHLIB))
|
||||||
|
LIBCEDARC_CONF_ENV = \
|
||||||
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
LDFLAGS="$(TARGET_LDFLAGS) -L$(@D)/library/$(LIBCEDARC_ARCHLIB)"
|
||||||
|
LIBCEDARC_CONF_OPTS =
|
||||||
|
|
||||||
|
LIBCEDARC_INSTALL_STAGING_CMDS = $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install;
|
||||||
|
|
||||||
|
LIBCEDARC_INSTALL_STAGING_CMDS += cp $(@D)/include/* '$(STAGING_DIR)/usr/include/';
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_OPENMAX),y)
|
||||||
|
LIBCEDARC_INSTALL_STAGING_CMDS += cp $(@D)/openmax/include/* '$(STAGING_DIR)/usr/include/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS = $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install;
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libVE.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libvideoengine.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_AVS),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawavs.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_H264),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawh264.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_H265),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawh265.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MJPEG),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmjpeg.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmjpegplus.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MPEG2),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg2.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MPEG4),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4base.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4dx.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4h263.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4normal.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4vp6.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_VP8),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawvp8.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_VP9),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawvp9Hw.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_WMV3),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawwmv3.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_LIBCEDARC_ENCODER),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libvencoder.so' '$(TARGET_DIR)/usr/lib/';
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(BR2_PACKAGE_LIBCEDARC_OPENMAX),y)
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxCore.so';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxVdec.so';
|
||||||
|
LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxVenc.so';
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(eval $(autotools-package))
|
||||||
Reference in New Issue
Block a user