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>
This commit is contained in:
+72
@@ -0,0 +1,72 @@
|
||||
--- a/sys/fbdev/gstfbdevsink.c 2021-07-06 16:02:46.304928800 +0800
|
||||
+++ b/sys/fbdev/gstfbdevsink.c 2021-07-06 16:02:11.593693100 +0800
|
||||
@@ -73,7 +73,7 @@
|
||||
static GstStateChangeReturn gst_fbdevsink_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
-#define VIDEO_CAPS "{ RGB, BGR, BGRx, xBGR, RGB, RGBx, xRGB, RGB15, RGB16 }"
|
||||
+#define VIDEO_CAPS "{ RGB, BGR, BGRx, xBGR, RGB, RGBx, xRGB, RGB15, RGB16, I420, NV12, NV21 }"
|
||||
|
||||
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
@@ -133,7 +133,10 @@
|
||||
/* FIXME: locking */
|
||||
if (!fbdevsink->framebuffer)
|
||||
goto done;
|
||||
-
|
||||
+ if (fbdevsink->varinfo.grayscale == 1) {
|
||||
+ format = GST_VIDEO_FORMAT_NV12;
|
||||
+ goto common;
|
||||
+ }
|
||||
bpp = fbdevsink->varinfo.bits_per_pixel;
|
||||
|
||||
rmask = ((1 << fbdevsink->varinfo.red.length) - 1)
|
||||
@@ -182,6 +185,8 @@
|
||||
if (format == GST_VIDEO_FORMAT_UNKNOWN)
|
||||
goto unknown_format;
|
||||
|
||||
+common:
|
||||
+
|
||||
caps = gst_caps_make_writable (caps);
|
||||
gst_caps_set_simple (caps, "format", G_TYPE_STRING,
|
||||
gst_video_format_to_string (format), NULL);
|
||||
@@ -272,12 +277,33 @@
|
||||
if (!gst_buffer_map (buf, &map, GST_MAP_READ))
|
||||
return GST_FLOW_ERROR;
|
||||
|
||||
- for (i = 0; i < fbdevsink->lines; i++) {
|
||||
- memcpy (fbdevsink->framebuffer
|
||||
- + (i + fbdevsink->cy) * fbdevsink->fixinfo.line_length
|
||||
- + fbdevsink->cx * fbdevsink->bytespp,
|
||||
- map.data + i * fbdevsink->width * fbdevsink->bytespp,
|
||||
- fbdevsink->linelen);
|
||||
+ if (fbdevsink->varinfo.grayscale == 1) {
|
||||
+ int screen_offset = fbdevsink->varinfo.xres * fbdevsink->varinfo.yres;
|
||||
+ int buffer_offset = fbdevsink->height * fbdevsink->width;
|
||||
+
|
||||
+ for (i = 0; i < fbdevsink->lines; i++) {
|
||||
+ memcpy (fbdevsink->framebuffer
|
||||
+ + (i + fbdevsink->cy) * fbdevsink->varinfo.xres
|
||||
+ + fbdevsink->cx * 1,
|
||||
+ map.data + i * fbdevsink->width * 1,
|
||||
+ fbdevsink->width);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < fbdevsink->lines/2; i++) {
|
||||
+ memcpy (fbdevsink->framebuffer + screen_offset
|
||||
+ + (i + fbdevsink->cy/2) * fbdevsink->varinfo.xres
|
||||
+ + fbdevsink->cx * 1,
|
||||
+ map.data + buffer_offset + i * fbdevsink->width * 1,
|
||||
+ fbdevsink->width);
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (i = 0; i < fbdevsink->lines; i++) {
|
||||
+ memcpy (fbdevsink->framebuffer
|
||||
+ + (i + fbdevsink->cy) * fbdevsink->fixinfo.line_length
|
||||
+ + fbdevsink->cx * fbdevsink->bytespp,
|
||||
+ map.data + i * fbdevsink->width * fbdevsink->bytespp,
|
||||
+ fbdevsink->linelen);
|
||||
+ }
|
||||
}
|
||||
|
||||
gst_buffer_unmap (buf, &map);
|
||||
Reference in New Issue
Block a user