Skip to content

Instantly share code, notes, and snippets.

@Sakura286
Last active August 15, 2023 15:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Sakura286/26777ea8204c1819885e093806a4f7ca to your computer and use it in GitHub Desktop.
From 489cc70aa2e4b1fc7dcc7eb75d94d21bd658e8a8 Mon Sep 17 00:00:00 2001
From: Sakura286 <sakura286@outlook.com>
Date: Mon, 17 Jul 2023 11:14:24 +0800
Subject: [PATCH] configure gl support
---
rules | 1 +
1 file changed, 1 insertion(+)
diff --git a/rules b/rules
index eb276f6..9eb4edc 100755
--- a/rules
+++ b/rules
@@ -30,6 +30,7 @@ endif
conf_flags = -Dpackage-name=$(GST_PACKAGE_NAME) -Dpackage-origin=$(GST_PACKAGE_ORIGIN)
conf_flags += -Dinstall_plugins_helper="/usr/bin/gstreamer-codec-install"
conf_flags += -Dauto_features=enabled -Dexamples=disabled -Dtremor=disabled -Ddoc=disabled
+conf_flags += -Dgl_api=[\'gles2\'] -Dgl_platform=[\'egl\']
ifeq ($(DEB_HOST_ARCH_OS),hurd)
conf_flags += -Dcdparanoia=disabled
--
2.40.1
Index: gst-omx-1.22.4/config/bellagio/gstomx.conf
===================================================================
--- gst-omx-1.22.4.orig/config/bellagio/gstomx.conf
+++ gst-omx-1.22.4/config/bellagio/gstomx.conf
@@ -1,8 +1,8 @@
[omxmpeg4videodec]
type-name=GstOMXMPEG4VideoDec
core-name=/usr/local/lib/libomxil-bellagio.so.0
-component-name=OMX.st.video_decoder.mpeg4
-rank=257
+component-name=OMX.hantro.VC8000D.video.decoder.mpeg4
+rank=258
in-port-index=0
out-port-index=1
hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1
@@ -46,8 +46,8 @@ hacks=event-port-settings-changed-ndata-
[omxh264dec]
type-name=GstOMXH264Dec
core-name=/usr/lib/libomxil-bellagio.so.0
-component-name=OMX.mesa.video_decoder.avc
-rank=0
+component-name=OMX.hantro.VC8000D.video.decoder.avc
+rank=258
in-port-index=0
out-port-index=1
@@ -58,3 +58,35 @@ component-name=OMX.mesa.video_decoder.mp
rank=0
in-port-index=0
out-port-index=1
+
+[omxh264enc]
+type-name=GstOMXH264Enc
+core-name=/usr/lib/libomxil-bellagio.so.0
+component-name=OMX.hantro.H2.video.encoder.avc
+rank=258
+in-port-index=0
+out-port-index=1
+
+[omxh265dec]
+type-name=GstOMXH265Dec
+core-name=/usr/lib/libomxil-bellagio.so.0
+component-name=OMX.hantro.VC8000D.video.decoder.hevc
+rank=258
+in-port-index=0
+out-port-index=1
+
+[omxh265enc]
+type-name=GstOMXH265Enc
+core-name=/usr/lib/libomxil-bellagio.so.0
+component-name=OMX.hantro.H2.video.encoder.hevc
+rank=258
+in-port-index=0
+out-port-index=1
+
+[omxvp9dec]
+type-name=GstOMXVP9Dec
+core-name=/usr/lib/libomxil-bellagio.so.0
+component-name=OMX.hantro.VC8000D.video.decoder.vp9
+rank=258
+in-port-index=0
+out-port-index=1
Index: gst-omx-1.22.4/omx/gstomx.c
===================================================================
--- gst-omx-1.22.4.orig/omx/gstomx.c
+++ gst-omx-1.22.4/omx/gstomx.c
@@ -3451,8 +3451,28 @@ gst_omx_port_set_dmabuf (GstOMXPort * po
return TRUE;
#else
- /* dmabuf not supported for this platform */
- return FALSE;
+ OMX_CSI_BUFFER_MODE_CONFIGTYPE buffer_mode;
+ OMX_ERRORTYPE err;
+
+ GST_OMX_INIT_STRUCT (&buffer_mode);
+ buffer_mode.nPortIndex = port->index;
+
+ if (dmabuf)
+ buffer_mode.eMode = OMX_CSI_BUFFER_MODE_DMA;
+ else
+ buffer_mode.eMode = OMX_CSI_BUFFER_MODE_NORMAL;
+
+ err =
+ gst_omx_component_set_parameter (port->comp,
+ (OMX_INDEXTYPE) OMX_CSI_IndexParamBufferMode, &buffer_mode);
+ if (err != OMX_ErrorNone) {
+ GST_WARNING_OBJECT (port->comp->parent,
+ "Failed to set port %d in %sdmabuf mode: %s (0x%08x)",
+ port->index, dmabuf ? "" : "non-", gst_omx_error_to_string (err), err);
+ return FALSE;
+ }
+
+ return TRUE;
#endif
}
Index: gst-omx-1.22.4/omx/gstomxvideodec.c
===================================================================
--- gst-omx-1.22.4.orig/omx/gstomxvideodec.c
+++ gst-omx-1.22.4/omx/gstomxvideodec.c
@@ -305,10 +305,10 @@ gst_omx_video_dec_open (GstVideoDecoder
self->dec_in_port = gst_omx_component_add_port (self->dec, in_port_index);
self->dec_out_port = gst_omx_component_add_port (self->dec, out_port_index);
-#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
+//#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
GST_DEBUG_OBJECT (self, "Configure decoder output to export dmabuf");
self->dmabuf = gst_omx_port_set_dmabuf (self->dec_out_port, TRUE);
-#endif
+//#endif
if (!self->dec_in_port || !self->dec_out_port)
return FALSE;
Index: gst-omx-1.22.4/omx/openmax/OMX_CsiExt.h
===================================================================
--- /dev/null
+++ gst-omx-1.22.4/omx/openmax/OMX_CsiExt.h
@@ -0,0 +1,327 @@
+/****************************************************************************
+* Copyright 2021-2022 Alibaba Group Holding Limited
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*****************************************************************************/
+
+#ifndef OMX_CsiExt_h
+#define OMX_CsiExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <OMX_Video.h>
+
+typedef enum OMX_CSI_INDEXTYPE {
+ OMX_CSI_IndexStartUnused = OMX_IndexVendorStartUnused + 0x00110000,
+ OMX_CSI_IndexConfigVideoIntraArea,
+ OMX_CSI_IndexConfigVideoRoiArea,
+ OMX_CSI_IndexConfigVideoRoiDeltaQp,
+ OMX_CSI_IndexConfigVideoRoiQp,
+ OMX_CSI_IndexConfigVideoOsd,
+ OMX_CSI_IndexParamVideoHevc,
+ OMX_CSI_IndexParamVideoVp9,
+ OMX_CSI_IndexParamVideoConfig,
+ OMX_CSI_IndexParamVideoAvcExt,
+ OMX_CSI_IndexParamBufferMode,
+ OMX_CSI_IndexParamCompressionMode,
+} OMX_CSI_INDEXTYPE;
+
+typedef enum OMX_CSI_VIDEO_CODINGTYPE {
+ OMX_CSI_VIDEO_CodingStartUnused = OMX_VIDEO_CodingVendorStartUnused + 0x00110000,
+ OMX_CSI_VIDEO_CodingVP6,
+ OMX_CSI_VIDEO_CodingAVS,
+ OMX_CSI_VIDEO_CodingHEVC,
+ OMX_CSI_VIDEO_CodingVP9,
+ OMX_CSI_VIDEO_CodingAVS2,
+} OMX_CSI_VIDEO_CODINGTYPE;
+
+typedef enum OMX_CSI_COLOR_FORMATTYPE {
+ OMX_CSI_COLOR_FormatStartUnused = OMX_COLOR_FormatVendorStartUnused + 0x00110000,
+ OMX_CSI_COLOR_FormatYUV420SemiPlanarP010 /* P010 format */
+} OMX_CSI_COLOR_FORMATTYPE;
+
+/** Structure for configuring Intra area for 8290/H1/H2 encoder */
+typedef struct OMX_CSI_VIDEO_CONFIG_INTRAAREATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_U32 nTop; /* Top mb row inside area [0..heightMbs-1] */
+ OMX_U32 nLeft; /* Left mb row inside area [0..widthMbs-1] */
+ OMX_U32 nBottom; /* Bottom mb row inside area [top..heightMbs-1] */
+ OMX_U32 nRight; /* Right mb row inside area [left..widthMbs-1] */
+} OMX_CSI_VIDEO_CONFIG_INTRAAREATYPE;
+
+/** Structure for configuring ROI area for 8290/H1/H2 encoder */
+typedef struct OMX_CSI_VIDEO_CONFIG_ROIAREATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_U32 nArea; /* ROI area number [1..2] */
+ OMX_U32 nTop; /* Top mb row inside area [0..heightMbs-1] */
+ OMX_U32 nLeft; /* Left mb row inside area [0..widthMbs-1] */
+ OMX_U32 nBottom; /* Bottom mb row inside area [top..heightMbs-1] */
+ OMX_U32 nRight; /* Right mb row inside area [left..widthMbs-1] */
+} OMX_CSI_VIDEO_CONFIG_ROIAREATYPE;
+
+/** Structure for configuring ROI Delta QP for 8290/H1/H2 encoder */
+typedef struct OMX_CSI_VIDEO_CONFIG_ROIDELTAQPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nArea; /* ROI area number [1..2] */
+ OMX_S32 nDeltaQP; /* QP delta value [-127..0] for VP8 */
+ /* [-15..0] for H264 */
+} OMX_CSI_VIDEO_CONFIG_ROIDELTAQPTYPE;
+
+/** Structure for configuring ROI Absolute QP for 8290/H1/H2 encoder */
+typedef struct OMX_CSI_VIDEO_CONFIG_ROIQPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nArea; /* ROI area number [1..2] */
+ OMX_S32 nQP; /* absolute QP value */
+} OMX_CSI_VIDEO_CONFIG_ROIQPTYPE;
+
+typedef struct OMX_CSI_VIDEO_CONFIG_OSDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ /** Global alpha value for this osd area, not used for ARGB8888*/
+ OMX_U32 nAlpha;
+ /** Top left column offset of this osd area */
+ OMX_U32 nOffsetX;
+ /** Top left row offset of this osd area */
+ OMX_U32 nOffsetY;
+ /** Global luma Y value for bitmap format */
+ OMX_U32 nBitmapY;
+ /** Global chroma cb value for bitmap format */
+ OMX_U32 nBitmapU;
+ /** Global chroma cr value for bitmap format */
+ OMX_U32 nBitmapV;
+} OMX_CSI_VIDEO_CONFIG_OSDTYPE;
+
+typedef enum OMX_CSI_VIDEO_AVCLEVELTYPEEXT {
+ OMX_CSI_VIDEO_AVCLevelUnused = OMX_VIDEO_AVCLevelVendorStartUnused + 0x00110000,
+ OMX_CSI_VIDEO_AVCLevel52,
+ OMX_CSI_VIDEO_AVCLevel60,
+ OMX_CSI_VIDEO_AVCLevel61,
+ OMX_CSI_VIDEO_AVCLevel62
+} OMX_CSI_VIDEO_AVCLEVELTYPEEXT;
+
+
+typedef enum OMX_CSI_VIDEO_HEVCPROFILETYPE {
+ OMX_CSI_VIDEO_HEVCProfileMain = 0x01, /**< Main profile */
+ OMX_CSI_VIDEO_HEVCProfileMain10 = 0x02, /**< Main10 profile */
+ OMX_CSI_VIDEO_HEVCProfileMainStillPicture = 0x04, /**< Main still picture profile */
+} OMX_CSI_VIDEO_HEVCPROFILETYPE;
+
+typedef enum OMX_CSI_VIDEO_HEVCLEVELTYPE {
+ OMX_CSI_VIDEO_HEVCLevel1 = 0x01, /**< Level 1 */
+ OMX_CSI_VIDEO_HEVCLevel2 = 0x02, /**< Level 2 */
+ OMX_CSI_VIDEO_HEVCLevel21 = 0x04, /**< Level 2.1 */
+ OMX_CSI_VIDEO_HEVCLevel3 = 0x08, /**< Level 3 */
+ OMX_CSI_VIDEO_HEVCLevel31 = 0x10, /**< Level 3.1 */
+ OMX_CSI_VIDEO_HEVCLevel4 = 0x20, /**< Level 4 */
+ OMX_CSI_VIDEO_HEVCLevel41 = 0x40, /**< Level 4.1 */
+ OMX_CSI_VIDEO_HEVCLevel5 = 0x80, /**< Level 5 */
+ OMX_CSI_VIDEO_HEVCLevel51 = 0x100, /**< Level 5.1 */
+ OMX_CSI_VIDEO_HEVCLevel52 = 0x200, /**< Level 5.2 */
+ OMX_CSI_VIDEO_HEVCLevel6 = 0x400, /**< Level 6 */
+ OMX_CSI_VIDEO_HEVCLevel61 = 0x800, /**< Level 6.1 */
+ OMX_CSI_VIDEO_HEVCLevel62 = 0x1000, /**< Level 6.2 */
+} OMX_CSI_VIDEO_HEVCLEVELTYPE;
+
+/**
+ * AVC Encoder VSI Extension params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBitDepthLuma : Luma component valid bit depth.
+ * nBitDepthChroma : Chroma component valid bit depth.
+ * gopSize : GOP Size, [0..8], 0 for adaptive GOP size; 1~7 for fixed GOP size
+ * hrdCpbSize : HRD Coded Picture Buffer size in bits. Buffer size used by the HRD model.
+ * firstPic : First picture of input file to encode.
+ * lastPic : Last picture of input file to encode.
+ * coded chroma_format_idc
+ * codedChromaIdc : Specify coded chroma format idc.[1]. 0 -400, 1- 420, 2- 422
+
+ * rdoLevel : Programable hardware RDO Level [1..3].
+ * crf : Specify constant rate factor mode, working with look-ahead turned on.
+ : [-1..51], -1=disable.
+ : CRF mode is to keep a certain level of quality based on crf value, working as constant QP with complexity rate control.
+ : CRF adjusts frame level QP within range of crf constant +-3 based on frame complexity.
+ : CRF will disable VBR mode if both enabled.
+ * preset : Specify preset parameter to trade off performance and compression efficiency. 0...4 for HEVC. 0..1 for H264.
+ */
+typedef struct OMX_CSI_VIDEO_PARAM_AVCTYPEEXT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_U32 nPreset; /* 1 for AVC. Trade off performance and compression efficiency */
+
+ OMX_U32 nBitDepthLuma;
+ OMX_U32 nBitDepthChroma;
+
+ OMX_BOOL bEnableConstrainedVBR;
+ OMX_S32 nQpMinI;
+ OMX_S32 nQpMaxI;
+ OMX_S32 nQpMinPB;
+ OMX_S32 nQpMaxPB;
+ OMX_U32 nHrdCpbSize;
+ OMX_S32 nIntraQpDelta;
+
+ OMX_S32 nCTBRC;
+ OMX_S32 nCTBRCBlockSize;
+ OMX_S32 nCTBRCTolInter;
+ OMX_S32 nCTBRCTolIntra;
+
+ OMX_BOOL bEnableMBS; // Memory bandwidth saving mode
+ OMX_BOOL bLowLatencyEncoding;
+} OMX_CSI_VIDEO_PARAM_AVCTYPEEXT;
+
+typedef struct OMX_CSI_VIDEO_PARAM_HEVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_CSI_VIDEO_HEVCPROFILETYPE eProfile;
+ OMX_CSI_VIDEO_HEVCLEVELTYPE eLevel;
+ OMX_U32 nPFrames;
+ OMX_U32 nRefFrames;
+
+ OMX_U32 nPreset; /* 1...3 for HEVC. Trade off performance and compression efficiency */
+
+ OMX_U32 nBitDepthLuma;
+ OMX_U32 nBitDepthChroma;
+ OMX_S32 nVideoRange;
+ OMX_S32 nSliceSize;
+ OMX_U32 nTileColumns;
+ OMX_U32 nTileRows;
+
+ OMX_BOOL bEnableSAO;
+ OMX_S32 nTcOffset;
+ OMX_S32 nBetaOffset;
+ OMX_BOOL bEnableDeblockOverride;
+ OMX_BOOL bDeblockOverride;
+ OMX_BOOL bEnableCrossTileLF; /* Set to 1 to enable loop filter accross tiles */
+
+ OMX_BOOL bEnableConstrainedVBR;
+ OMX_S32 nQpMinI;
+ OMX_S32 nQpMaxI;
+ OMX_S32 nQpMinPB;
+ OMX_S32 nQpMaxPB;
+ OMX_S32 nTolMovingBitRate; /* 0...2000%% percent tolerance over target bitrate of moving bit rate */
+ OMX_S32 nMonitorFrames;
+ OMX_S32 nBitVarRangeI;
+ OMX_S32 nBitVarRangeP;
+ OMX_S32 nStaticSceneIbitPercent;
+ OMX_S32 nCTBRC;
+ OMX_S32 nCTBRCBlockSize; /* Block size in CTB QP adjustment for Subjective Quality */
+ OMX_S32 nCTBRCTolInter;
+ OMX_S32 nCTBRCTolIntra;
+ OMX_S32 nRcQpDeltaRange;
+ OMX_S32 nRcBaseMBComplexity;
+ OMX_S32 nCTBRowQpStep;
+ OMX_S32 nPicQpDeltaMin;
+ OMX_S32 nPicQpDeltaMax;
+ OMX_U32 nHrdCpbSize;
+ OMX_S32 nBitrateWindow;
+ OMX_S32 nIntraQpDelta;
+ OMX_S32 nFixedIntraQp;
+ OMX_U32 nChromaQpOffset;
+ OMX_BOOL bEnableVuiTimingInfo;
+
+ OMX_U32 nGdrDuration;
+ OMX_U32 nCirStart;
+ OMX_U32 nCirInterval;
+ OMX_U32 nRoiMapDeltaQpBlockUnit;
+ OMX_U32 nEnableRoiMapDeltaQp;
+ OMX_U32 nRoiQpDeltaVersion;
+
+ OMX_BOOL bStrongIntraSmoothing;
+ OMX_BOOL bDisablePcmLF; /* Set to 1 to disable PCM loop filter */
+
+ OMX_BOOL bEnableMBS; // Memory bandwidth saving mode
+ OMX_BOOL bLowLatencyEncoding;
+} OMX_CSI_VIDEO_PARAM_HEVCTYPE;
+
+/** VP9 profiles */
+typedef enum OMX_CSI_VIDEO_VP9PROFILETYPE {
+ OMX_CSI_VIDEO_VP9Profile0 = 0x01, /* 8-bit 4:2:0 */
+ OMX_CSI_VIDEO_VP9Profile1 = 0x02, /* 8-bit 4:2:2, 4:4:4, alpha channel */
+ OMX_CSI_VIDEO_VP9Profile2 = 0x04, /* 10-bit/12-bit 4:2:0, YouTube Premium Content Profile */
+ OMX_CSI_VIDEO_VP9Profile3 = 0x08, /* 10-bit/12-bit 4:2:2, 4:4:4, alpha channel */
+} OMX_CSI_VIDEO_VP9PROFILETYPE;
+
+/** VP9 Param */
+typedef struct OMX_CSI_VIDEO_PARAM_VP9TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_CSI_VIDEO_VP9PROFILETYPE eProfile;
+ OMX_U32 nBitDepthLuma;
+ OMX_U32 nBitDepthChroma;
+} OMX_CSI_VIDEO_PARAM_VP9TYPE;
+
+/** AVS2 profiles */
+typedef enum OMX_CSI_VIDEO_AVS2PROFILETYPE {
+ OMX_CSI_VIDEO_AVS2ProfileMain = 0x01, /* Main profile */
+ OMX_CSI_VIDEO_AVS2ProfileMain10 = 0x02, /* Main10 profile */
+} OMX_CSI_VIDEO_AVS2PROFILETYPE;
+
+/** Structure for configuring decoder */
+typedef struct OMX_CSI_VIDEO_PARAM_CONFIGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableAdaptiveBuffers;
+ OMX_BOOL bEnableRFC;
+ OMX_BOOL bDisableReordering;
+} OMX_CSI_VIDEO_PARAM_CONFIGTYPE;
+
+typedef enum OMX_CSI_BUFFER_MODE {
+ OMX_CSI_BUFFER_MODE_NORMAL = 0,
+ OMX_CSI_BUFFER_MODE_DMA = 1,
+} OMX_CSI_BUFFER_MODE;
+
+/** Structure for configuring port buffer mode */
+typedef struct OMX_CSI_BUFFER_MODE_CONFIGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_CSI_BUFFER_MODE eMode;
+} OMX_CSI_BUFFER_MODE_CONFIGTYPE;
+
+typedef enum OMX_CSI_COMPRESSION_MODE {
+ OMX_CSI_COMPRESSION_MODE_DISABLED = 0,
+ OMX_CSI_COMPRESSION_MODE_LOSSLESS = 1,
+} OMX_CSI_COMPRESSION_MODE;
+
+/** Structure for configuring port compression mode */
+typedef struct OMX_CSI_COMPRESSION_MODE_CONFIGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_CSI_COMPRESSION_MODE eMode;
+} OMX_CSI_COMPRESSION_MODE_CONFIGTYPE;
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_CsiExt_h */
Index: gst-omx-1.22.4/omx/openmax/OMX_VideoExt.h
===================================================================
--- gst-omx-1.22.4.orig/omx/openmax/OMX_VideoExt.h
+++ gst-omx-1.22.4/omx/openmax/OMX_VideoExt.h
@@ -39,6 +39,7 @@ extern "C" {
* for this header file to compile successfully
*/
#include <OMX_Core.h>
+#include "openmax/OMX_CsiExt.h"
/** NALU Formats */
typedef enum OMX_NALUFORMATSTYPE {
Index: gst-omx-1.22.4/meson.build
===================================================================
--- gst-omx-1.22.4.orig/meson.build
+++ gst-omx-1.22.4/meson.build
@@ -309,15 +309,10 @@ if have_omx_theora
cdata.set('HAVE_THEORA', 1)
endif
-have_omx_hevc = cc.has_header_symbol(
- 'OMX_Video.h',
- 'OMX_VIDEO_CodingHEVC',
- prefix : extra_video_headers,
- args : gst_omx_args,
- include_directories : [omx_inc])
-if have_omx_hevc
- cdata.set('HAVE_HEVC', 1)
-endif
+
+cdata.set('HAVE_HEVC', 1)
+
+cdata.set('HAVE_VP9', 1)
if gstgl_dep.found()
cdata.set ('HAVE_GST_GL', 1)
Index: gst-omx-1.22.4/omx/gstomx.c
===================================================================
--- gst-omx-1.22.4.orig/omx/gstomx.c
+++ gst-omx-1.22.4/omx/gstomx.c
@@ -49,6 +49,7 @@
#include "gstomxamrdec.h"
#include "gstomxanalogaudiosink.h"
#include "gstomxhdmiaudiosink.h"
+#include "gstomxvp9dec.h"
GST_DEBUG_CATEGORY (gstomx_debug);
#define GST_CAT_DEFAULT gstomx_debug
@@ -3553,6 +3554,9 @@ static const GGetTypeFunction types[] =
#ifdef HAVE_HEVC
, gst_omx_h265_enc_get_type, gst_omx_h265_dec_get_type
#endif
+#ifdef HAVE_VP9
+ , gst_omx_vp9_dec_get_type
+#endif
};
struct TypeOffest
Index: gst-omx-1.22.4/omx/gstomxh265enc.c
===================================================================
--- gst-omx-1.22.4.orig/omx/gstomxh265enc.c
+++ gst-omx-1.22.4/omx/gstomxh265enc.c
@@ -422,9 +422,9 @@ update_param_hevc (GstOMXH265Enc * self,
if (self->b_frames != GST_OMX_H265_VIDEO_ENC_B_FRAMES_DEFAULT)
param.nBFrames = self->b_frames;
#else
- if (self->interval_intraframes !=
- GST_OMX_H265_VIDEO_ENC_INTERVAL_OF_CODING_INTRA_FRAMES_DEFAULT)
- param.nKeyFrameInterval = self->interval_intraframes;
+ // if (self->interval_intraframes !=
+ // GST_OMX_H265_VIDEO_ENC_INTERVAL_OF_CODING_INTRA_FRAMES_DEFAULT)
+ // param.nKeyFrameInterval = self->interval_intraframes;
#endif
err =
Index: gst-omx-1.22.4/omx/gstomxvp9dec.c
===================================================================
--- /dev/null
+++ gst-omx-1.22.4/omx/gstomxvp9dec.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2013, Collabora Ltd.
+ * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ *
+ * 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 "gstomxvp9dec.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_omx_vp9_dec_debug_category);
+#define GST_CAT_DEFAULT gst_omx_vp9_dec_debug_category
+
+/* prototypes */
+static gboolean gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec,
+ GstOMXPort * port, GstVideoCodecState * state);
+static gboolean gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec,
+ GstOMXPort * port, GstVideoCodecState * state);
+
+enum
+{
+ PROP_0
+};
+
+/* class initialization */
+
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_omx_vp9_dec_debug_category, "omxvp9dec", 0, \
+ "debug category for gst-omx video decoder base class");
+
+G_DEFINE_TYPE_WITH_CODE (GstOMXVP9Dec, gst_omx_vp9_dec,
+ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT);
+
+static void
+gst_omx_vp9_dec_class_init (GstOMXVP9DecClass * klass)
+{
+ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass);
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
+ videodec_class->is_format_change =
+ GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_is_format_change);
+ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_set_format);
+
+ videodec_class->cdata.default_sink_template_caps = "video/x-vp9, "
+ "width=(int) [1,MAX], " "height=(int) [1,MAX]";
+
+ gst_element_class_set_static_metadata (element_class,
+ "OpenMAX VP9 Video Decoder",
+ "Codec/Decoder/Video/Hardware",
+ "Decode VP9 video streams",
+ "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
+
+ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.vp9");
+}
+
+static void
+gst_omx_vp9_dec_init (GstOMXVP9Dec * self)
+{
+}
+
+static gboolean
+gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec,
+ GstOMXPort * port, GstVideoCodecState * state)
+{
+ return FALSE;
+}
+
+static gboolean
+gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port,
+ GstVideoCodecState * state)
+{
+ gboolean ret;
+ OMX_PARAM_PORTDEFINITIONTYPE port_def;
+
+ gst_omx_port_get_port_definition (port, &port_def);
+ port_def.format.video.eCompressionFormat =
+ (OMX_VIDEO_CODINGTYPE) OMX_VIDEO_CodingVP9;
+ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone;
+
+ return ret;
+}
Index: gst-omx-1.22.4/omx/gstomxvp9dec.h
===================================================================
--- /dev/null
+++ gst-omx-1.22.4/omx/gstomxvp9dec.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013, Collabora Ltd.
+ * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ *
+ * 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_VP9_DEC_H__
+#define __GST_OMX_VP9_DEC_H__
+
+#include <gst/gst.h>
+#include "gstomxvideodec.h"
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_OMX_VP9_DEC \
+ (gst_omx_vp9_dec_get_type())
+#define GST_OMX_VP9_DEC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9Dec))
+#define GST_OMX_VP9_DEC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass))
+#define GST_OMX_VP9_DEC_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass))
+#define GST_IS_OMX_VP9_DEC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VP9_DEC))
+#define GST_IS_OMX_VP9_DEC_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VP9_DEC))
+
+typedef struct _GstOMXVP9Dec GstOMXVP9Dec;
+typedef struct _GstOMXVP9DecClass GstOMXVP9DecClass;
+
+struct _GstOMXVP9Dec
+{
+ GstOMXVideoDec parent;
+};
+
+struct _GstOMXVP9DecClass
+{
+ GstOMXVideoDecClass parent_class;
+};
+
+GType gst_omx_vp9_dec_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_OMX_VP9_DEC_H__ */
+
Index: gst-omx-1.22.4/omx/meson.build
===================================================================
--- gst-omx-1.22.4.orig/omx/meson.build
+++ gst-omx-1.22.4/omx/meson.build
@@ -37,11 +37,11 @@ if have_omx_theora
omx_sources += 'gstomxtheoradec.c'
endif
-if have_omx_hevc
- omx_sources += 'gstomxh265utils.c'
- omx_sources += 'gstomxh265enc.c'
- omx_sources += 'gstomxh265dec.c'
-endif
+omx_sources += 'gstomxh265utils.c'
+omx_sources += 'gstomxh265enc.c'
+omx_sources += 'gstomxh265dec.c'
+
+omx_sources += 'gstomxvp9dec.c'
optional_deps = []
if gstgl_dep.found()
Index: gst-omx-1.22.4/omx/openmax/OMX_VideoExt.h
===================================================================
--- gst-omx-1.22.4.orig/omx/openmax/OMX_VideoExt.h
+++ gst-omx-1.22.4/omx/openmax/OMX_VideoExt.h
@@ -51,7 +51,6 @@ typedef enum OMX_NALUFORMATSTYPE {
OMX_NaluFormatCodingMax = 0x7FFFFFFF
} OMX_NALUFORMATSTYPE;
-
/** NAL Stream Format */
typedef struct OMX_NALSTREAMFORMATTYPE{
OMX_U32 nSize;
@@ -60,7 +59,131 @@ typedef struct OMX_NALSTREAMFORMATTYPE{
OMX_NALUFORMATSTYPE eNaluFormat;
} OMX_NALSTREAMFORMATTYPE;
+/** VP8 profiles */
+typedef enum OMX_VIDEO_VP8PROFILETYPE {
+ OMX_VIDEO_VP8ProfileMain = 0x01,
+ OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_VP8PROFILETYPE;
+
+/** VP8 levels */
+typedef enum OMX_VIDEO_VP8LEVELTYPE {
+ OMX_VIDEO_VP8Level_Version0 = 0x01,
+ OMX_VIDEO_VP8Level_Version1 = 0x02,
+ OMX_VIDEO_VP8Level_Version2 = 0x04,
+ OMX_VIDEO_VP8Level_Version3 = 0x08,
+ OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_VP8LEVELTYPE;
+
+/** VP8 Param */
+typedef struct OMX_VIDEO_PARAM_VP8TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_VP8PROFILETYPE eProfile;
+ OMX_VIDEO_VP8LEVELTYPE eLevel;
+ OMX_U32 nDCTPartitions;
+ OMX_BOOL bErrorResilientMode;
+} OMX_VIDEO_PARAM_VP8TYPE;
+
+/** Structure for configuring VP8 reference frames */
+typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bPreviousFrameRefresh;
+ OMX_BOOL bGoldenFrameRefresh;
+ OMX_BOOL bAlternateFrameRefresh;
+ OMX_BOOL bUsePreviousFrame;
+ OMX_BOOL bUseGoldenFrame;
+ OMX_BOOL bUseAlternateFrame;
+} OMX_VIDEO_VP8REFERENCEFRAMETYPE;
+
+/** Structure for querying VP8 reference frame type */
+typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bIsIntraFrame;
+ OMX_BOOL bIsGoldenOrAlternateFrame;
+} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE;
+
+/** HEVC Profiles */
+typedef enum OMX_VIDEO_HEVCPROFILETYPE {
+ OMX_VIDEO_HEVCProfileMain = 0x01,
+ OMX_VIDEO_HEVCProfileMain10 = 0x02,
+ OMX_VIDEO_HEVCProfileUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_HEVCPROFILETYPE;
+
+/** HEVC levels */
+typedef enum OMX_VIDEO_HEVCLEVELTYPE {
+ OMX_VIDEO_HEVCMainTierLevel1 = 0x01,
+ OMX_VIDEO_HEVCMainTierLevel2 = 0x02,
+ OMX_VIDEO_HEVCMainTierLevel21 = 0x04,
+ OMX_VIDEO_HEVCMainTierLevel3 = 0x08,
+ OMX_VIDEO_HEVCMainTierLevel31 = 0x10,
+ OMX_VIDEO_HEVCMainTierLevel4 = 0x20,
+ OMX_VIDEO_HEVCMainTierLevel41 = 0x40,
+ OMX_VIDEO_HEVCMainTierLevel5 = 0x80,
+ OMX_VIDEO_HEVCMainTierLevel51 = 0x100,
+ OMX_VIDEO_HEVCMainTierLevel52 = 0x200,
+ OMX_VIDEO_HEVCMainTierLevel6 = 0x400,
+ OMX_VIDEO_HEVCMainTierLevel61 = 0x800,
+ OMX_VIDEO_HEVCMainTierLevel62 = 0x1000,
+ OMX_VIDEO_HEVCHighTierLevel1 = 0x2000,
+ OMX_VIDEO_HEVCHighTierLevel2 = 0x4000,
+ OMX_VIDEO_HEVCHighTierLevel21 = 0x8000,
+ OMX_VIDEO_HEVCHighTierLevel3 = 0x10000,
+ OMX_VIDEO_HEVCHighTierLevel31 = 0x20000,
+ OMX_VIDEO_HEVCHighTierLevel4 = 0x40000,
+ OMX_VIDEO_HEVCHighTierLevel41 = 0x80000,
+ OMX_VIDEO_HEVCHighTierLevel5 = 0x100000,
+ OMX_VIDEO_HEVCHighTierLevel51 = 0x200000,
+ OMX_VIDEO_HEVCHighTierLevel52 = 0x400000,
+ OMX_VIDEO_HEVCHighTierLevel6 = 0x800000,
+ OMX_VIDEO_HEVCHighTierLevel61 = 0x1000000,
+ OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000,
+ OMX_VIDEO_HEVCLevelUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_HEVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_HEVCLEVELTYPE;
+
+/** HEVC Param */
+typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_HEVCPROFILETYPE eProfile;
+ OMX_VIDEO_HEVCLEVELTYPE eLevel;
+ OMX_U32 nKeyFrameInterval; /* 0 => undefined. Codec-default */
+ OMX_U8 unused[848];
+} OMX_VIDEO_PARAM_HEVCTYPE;
+
+/**
+ * Structure for configuring video compression intra refresh period
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRefreshPeriod : Intra refreh period in frames. Value 0 means disable intra refresh
+*/
+typedef struct OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRefreshPeriod;
+} OMX_VIDEO_CONFIG_ANDROID_INTRAREFRESHTYPE;
+typedef enum OMX_VIDEO_CODINGTYPET {
+ OMX_VIDEO_CodingHEVC = OMX_VIDEO_CodingVendorStartUnused + 0x00100006,
+ OMX_VIDEO_CodingVP9,
+} OMX_VIDEO_CODINGTYPET;
+
+typedef enum OMX_INDEXTYPET {
+ OMX_IndexParamVideoHevc = OMX_IndexVendorStartUnused + 0x00100007
+} OMX_INDEXTYPET;
#ifdef __cplusplus
}
Index: parole-4.18.0/src/gst/parole-gst.c
===================================================================
--- parole-4.18.0.orig/src/gst/parole-gst.c
+++ parole-4.18.0/src/gst/parole-gst.c
@@ -2004,6 +2004,10 @@ parole_gst_constructed(GObject *object)
}
#endif
+ if (G_LIKELY(gst->priv->video_sink == NULL)) {
+ gst->priv->video_sink = gst_element_factory_make("glimagesink", "video");
+ }
+
if (G_UNLIKELY(gst->priv->video_sink == NULL)) {
gst->priv->image_sink = XIMAGESINK;
g_debug("%s trying to load ximagesink",
Index: gst-plugins-base1.0-1.22.0/docs/plugins/gst_plugins_cache.json
===================================================================
--- gst-plugins-base1.0-1.22.0.orig/docs/plugins/gst_plugins_cache.json
+++ gst-plugins-base1.0-1.22.0/docs/plugins/gst_plugins_cache.json
@@ -153,7 +153,7 @@
"writable": false
}
},
- "rank": "primary"
+ "rank": "primary + 20"
},
"alsasrc": {
"author": "Wim Taymans <wim@fluendo.com>",
Index: gst-plugins-base1.0-1.22.0/ext/alsa/gstalsasink.c
===================================================================
--- gst-plugins-base1.0-1.22.0.orig/ext/alsa/gstalsasink.c
+++ gst-plugins-base1.0-1.22.0/ext/alsa/gstalsasink.c
@@ -75,7 +75,7 @@ enum
#define gst_alsasink_parent_class parent_class
G_DEFINE_TYPE (GstAlsaSink, gst_alsasink, GST_TYPE_AUDIO_SINK);
-GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (alsasink, "alsasink", GST_RANK_PRIMARY,
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (alsasink, "alsasink", GST_RANK_PRIMARY + 20,
GST_TYPE_ALSA_SINK, alsa_element_init (plugin));
static void gst_alsasink_finalise (GObject * object);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment