Files
fml13v01-buildroot/package/starfive/sf-gst-omx/0003-add-video-scale-support.patch
T
sw.multimedia 4cf0377617 Add Multimedia Feature:
1. add starfive private packages: v4l2_test, pp_test, sf-gst-omx, sf-omx-il, stfisp_setfile, wave511, wave521
  v4l2_test: used to test v4l2 device
  pp_test: used to switch format and resolution for framebuffer framework
  sf-gst-omx: from gst-omx and compatible with the omx-il library
  sf-omx-il: starfive openmax il library for VPU hardware decode
  stfisp_setfile: this is the host build package, used to generate the isp registrer setting bin for v4l2 framework
  wave511: this is chip&media decode hardware wave511 vendor code building
  wave521: this is chip&media encode hardware wave521 vendor code building

2. Add the following gstreamer patch:
  add patch to support gstreamer plugin fbdevsink NV12 format
  add patch to support gst-play take priority to decoding h264/h265 with gst-omx plugin

Signed-off-by: sw.multimedia <sw.multimedia@starfivetech.com>
Signed-off-by: andy.hu <andy.hu@starfivetech.com>
Signed-off-by: michael.yan <michael.yan@starfivetech.com>
Signed-off-by: david.li <david.li@starfivetech.com>
Signed-off-by: Curry Zhang <curry.zhang@starfivetech.com>
Signed-off-by: keithzhao <keith.zhao@starfivetech.com>

(cherry picked from http://192.168.110.45/jh7100/buildroot/-/commit/fce6b25d98f81388fa4372739631c49222bf8eea)
2022-10-28 22:14:41 +08:00

51 lines
1.6 KiB
Diff

--- a/omx/gstomxvideodec.c 2020-10-26 19:17:03.000000000 +0800
+++ b/omx/gstomxvideodec.c 2021-08-16 16:23:08.082113380 +0800
@@ -2185,6 +2185,7 @@
gst_omx_video_dec_negotiate (GstOMXVideoDec * self)
{
OMX_VIDEO_PARAM_PORTFORMATTYPE param;
+ OMX_PARAM_PORTDEFINITIONTYPE port_def;
OMX_ERRORTYPE err;
GstCaps *comp_supported_caps;
GList *negotiation_map = NULL, *l;
@@ -2192,6 +2193,7 @@
GstVideoFormat format;
GstStructure *s;
const gchar *format_str;
+ gint width, height;
GST_DEBUG_OBJECT (self, "Trying to negotiate a video format with downstream");
@@ -2281,6 +2283,31 @@
gst_omx_error_to_string (err), err);
}
+ if (gst_structure_get_int(s, "width", &width) && gst_structure_get_int(s, "height", &height))
+ {
+ GST_OMX_INIT_STRUCT (&port_def);
+ port_def.nPortIndex = self->dec_out_port->index;
+ err = gst_omx_component_get_parameter (self->dec,
+ OMX_IndexParamPortDefinition, &port_def);
+ if (err != OMX_ErrorNone) {
+ GST_ERROR_OBJECT (self, "Failed to get video port definition: %s (0x%08x)",
+ gst_omx_error_to_string (err), err);
+ return FALSE;
+ }
+
+ port_def.format.video.nFrameHeight = height;
+ port_def.format.video.nFrameWidth = width;
+
+ err =
+ gst_omx_component_set_parameter (self->dec,
+ OMX_IndexParamPortDefinition, &port_def);
+ if (err != OMX_ErrorNone) {
+ GST_ERROR_OBJECT (self, "Failed to set video port definition: %s (0x%08x)",
+ gst_omx_error_to_string (err), err);
+ return FALSE;
+ }
+ }
+
gst_caps_unref (intersection);
return (err == OMX_ErrorNone);
}