gstreamer1.0-plugins-nvvideo4linux2: update patches for L4T R35.1.0

* Drop patch for missing gstnvdsseimeta header/library that was fixed in R35.1.0
* Update dependencies for libgstnvdsseimeta
* Rebase/renumber patches
* Minor whitespace cleanup

Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
Matt Madison
2022-10-30 07:01:14 -07:00
parent fe9722fa30
commit 9832fb2a23
9 changed files with 67 additions and 135 deletions

View File

@@ -1,73 +0,0 @@
From 3c8282072303831f26ab7ae269c5b4bb4e2e27db Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Fri, 8 Apr 2022 13:10:30 -0700
Subject: [PATCH] Work around missing nvdsseimeta header
Signed-off-by: Matt Madison <matt@madison.systems>
---
gstv4l2videodec.c | 4 ++++
gstv4l2videoenc.c | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/gstv4l2videodec.c b/gstv4l2videodec.c
index c43f8aa..9bd5362 100644
--- a/gstv4l2videodec.c
+++ b/gstv4l2videodec.c
@@ -31,7 +31,9 @@
#include <string.h>
#include "gstv4l2object.h"
#include "gstv4l2videodec.h"
+#ifdef HAVE_NVDSSEIMETA
#include "gstnvdsseimeta.h"
+#endif
#include "stdlib.h"
@@ -1676,6 +1678,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS |
GST_BUFFER_COPY_META, 0, 0);
+#ifdef HAVE_NVDSSEIMETA
/* Parse SEI data from the bitsream */
if ((is_cuvid == TRUE) && (self->extract_sei_type5_data == TRUE))
{
@@ -1706,6 +1709,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
gst_buffer_unmap (tmp, &map);
}
}
+#endif
gst_buffer_unref (tmp);
diff --git a/gstv4l2videoenc.c b/gstv4l2videoenc.c
index 35a62fd..f31bec9 100644
--- a/gstv4l2videoenc.c
+++ b/gstv4l2videoenc.c
@@ -37,7 +37,9 @@
#include "gstv4l2object.h"
#include "gstv4l2videoenc.h"
+#ifdef HAVE_NVDSSEIMETA
#include "gstnvdsseimeta.h"
+#endif
#include <string.h>
#include <gst/gst-i18n-plugin.h>
@@ -1336,7 +1338,8 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder,
}
if (frame->input_buffer) {
-
+
+#ifdef HAVE_NVDSSEIMETA
GstVideoSEIMeta *meta =
(GstVideoSEIMeta *) gst_buffer_get_meta (frame->input_buffer,
GST_VIDEO_SEI_META_API_TYPE);
@@ -1354,6 +1357,7 @@ gst_v4l2_video_enc_handle_frame (GstVideoEncoder * encoder,
self->v4l2output->sei_payload = (void *) meta->sei_metadata_ptr;
}
}
+#endif
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
ret =

View File

@@ -1,7 +1,7 @@
From 5649d9265fbdceb97d560c0fdf392264a97ceb9d Mon Sep 17 00:00:00 2001
From 5f263d373442ae6636c5f533ce192c6e1a06f781 Mon Sep 17 00:00:00 2001
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date: Thu, 25 Jun 2020 16:46:23 -0400
Subject: [PATCH 1/3] v4l2videoenc: Fix negotiation caps leak
Subject: [PATCH 1/7] v4l2videoenc: Fix negotiation caps leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
@@ -10,10 +10,10 @@ Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
1 file changed, 3 insertions(+)
diff --git a/gstv4l2videoenc.c b/gstv4l2videoenc.c
index 22700e0..3889b6a 100644
index a3dc7dd..35a62fd 100644
--- a/gstv4l2videoenc.c
+++ b/gstv4l2videoenc.c
@@ -888,6 +888,9 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder)
@@ -993,6 +993,9 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder)
if (gst_caps_foreach (allowed_caps, negotiate_profile_and_level, &ctx)) {
goto no_profile_level;
}
@@ -24,5 +24,5 @@ index 22700e0..3889b6a 100644
#ifndef USE_V4L2_TARGET_NV
--
2.29.2
2.34.1

View File

@@ -1,7 +1,7 @@
From a3961db8a37fb55440075b8eb2f14dd2d67d043a Mon Sep 17 00:00:00 2001
From 114ca7843aea535a1621518f4f392a40109568e6 Mon Sep 17 00:00:00 2001
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date: Fri, 26 Jun 2020 09:53:13 -0400
Subject: [PATCH 2/3] v4l2allocator: Fix data offset / bytesused size
Subject: [PATCH 2/7] v4l2allocator: Fix data offset / bytesused size
validation
The check was too strict causing spurious warning. Now check for <= so that 0
@@ -14,10 +14,10 @@ Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gstv4l2allocator.c b/gstv4l2allocator.c
index e66da49..9dd071b 100644
index ba8eb68..7ce40d5 100644
--- a/gstv4l2allocator.c
+++ b/gstv4l2allocator.c
@@ -1483,7 +1483,7 @@ gst_v4l2_allocator_dqbuf (GstV4l2Allocator * allocator,
@@ -1504,7 +1504,7 @@ gst_v4l2_allocator_dqbuf (GstV4l2Allocator * allocator,
offset = group->planes[i].data_offset;
@@ -27,5 +27,5 @@ index e66da49..9dd071b 100644
} else {
GST_WARNING_OBJECT (allocator, "V4L2 provided buffer has bytesused %"
--
2.29.2
2.34.1

View File

@@ -1,7 +1,7 @@
From fb987d2657da10b886550f5d0dbf6e535ff5a95e Mon Sep 17 00:00:00 2001
From e44664958ad6154c95d559011bc33c38751f9932 Mon Sep 17 00:00:00 2001
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Date: Fri, 26 Jun 2020 11:05:25 -0400
Subject: [PATCH 3/3] v4l2bufferpool: Avoid set_flushing warning
Subject: [PATCH 3/7] v4l2bufferpool: Avoid set_flushing warning
The gst_buffer_pool_set_flushing() warns when that function is called
on an inactive pool. Avoid the warning by checking the state, this is
@@ -14,10 +14,10 @@ Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gstv4l2bufferpool.c b/gstv4l2bufferpool.c
index f7d5638..cc60067 100644
index 1023d4c..15345d1 100644
--- a/gstv4l2bufferpool.c
+++ b/gstv4l2bufferpool.c
@@ -1241,7 +1241,7 @@ gst_v4l2_buffer_pool_flush_start (GstBufferPool * bpool)
@@ -1269,7 +1269,7 @@ gst_v4l2_buffer_pool_flush_start (GstBufferPool * bpool)
g_cond_broadcast (&pool->empty_cond);
GST_OBJECT_UNLOCK (pool);
@@ -26,7 +26,7 @@ index f7d5638..cc60067 100644
gst_buffer_pool_set_flushing (pool->other_pool, TRUE);
}
@@ -1252,7 +1252,7 @@ gst_v4l2_buffer_pool_flush_stop (GstBufferPool * bpool)
@@ -1280,7 +1280,7 @@ gst_v4l2_buffer_pool_flush_stop (GstBufferPool * bpool)
GST_DEBUG_OBJECT (pool, "stop flushing");
@@ -36,5 +36,5 @@ index f7d5638..cc60067 100644
#ifndef USE_V4L2_TARGET_NV
--
2.29.2
2.34.1

View File

@@ -1,8 +1,8 @@
From 9a51231d30e67a1a3e52cae44b5f14db49e12a1d Mon Sep 17 00:00:00 2001
From 362866771c3adfeba0d81c3983d389da48d1494e Mon Sep 17 00:00:00 2001
From: Jose Quaresma <quaresma.jose@gmail.com>
Date: Sun, 8 Nov 2020 01:53:55 +0000
Subject: [PATCH 1/2] gstv4l2videodec: use ifdef macro for consistency with
the rest of the code
Subject: [PATCH 4/7] gstv4l2videodec: use ifdef macro for consistency with the
rest of the code
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
@@ -10,10 +10,10 @@ Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gstv4l2videodec.c b/gstv4l2videodec.c
index 3a6188c..6daf863 100644
index 0c98bb5..bce7627 100644
--- a/gstv4l2videodec.c
+++ b/gstv4l2videodec.c
@@ -593,7 +593,7 @@ gst_v4l2_video_dec_start (GstVideoDecoder * decoder)
@@ -672,7 +672,7 @@ gst_v4l2_video_dec_start (GstVideoDecoder * decoder)
gst_v4l2_object_unlock (self->v4l2output);
g_atomic_int_set (&self->active, TRUE);
self->output_flow = GST_FLOW_OK;
@@ -22,7 +22,7 @@ index 3a6188c..6daf863 100644
self->decoded_picture_cnt = 0;
#endif
@@ -1178,7 +1178,7 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
@@ -1302,7 +1302,7 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
gst_caps_unref(reference);
}
@@ -32,5 +32,5 @@ index 3a6188c..6daf863 100644
if (!gst_buffer_copy_into (frame->output_buffer, frame->input_buffer,
(GstBufferCopyFlags)GST_BUFFER_COPY_METADATA, 0, -1)) {
--
2.29.2
2.34.1

View File

@@ -1,7 +1,7 @@
From 90d286c1e2261bddabdb84ea1e9a217516c4e44c Mon Sep 17 00:00:00 2001
From d7ad6c853a9df7fec6472b02ba3129054624c117 Mon Sep 17 00:00:00 2001
From: Jose Quaresma <quaresma.jose@gmail.com>
Date: Sun, 8 Nov 2020 12:49:03 +0000
Subject: [PATCH 2/2] gstv4l2videodec: check if we have a pool before the
Subject: [PATCH 5/7] gstv4l2videodec: check if we have a pool before the
locking in video decoder set format
There's a dead lock on nvv4l2decoder.
@@ -23,10 +23,10 @@ Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gstv4l2videodec.c b/gstv4l2videodec.c
index fd80d68..ea64b38 100644
index bce7627..b04e659 100644
--- a/gstv4l2videodec.c
+++ b/gstv4l2videodec.c
@@ -743,14 +743,16 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
@@ -801,14 +801,16 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
#ifdef USE_V4L2_TARGET_NV
if (self->is_drc == TRUE)
{
@@ -51,5 +51,5 @@ index fd80d68..ea64b38 100644
gst_v4l2_object_close (self->v4l2capture);
gst_v4l2_object_open (self->v4l2output);
--
2.29.2
2.34.1

View File

@@ -1,7 +1,7 @@
From cf9373f7517dde11b0752a7dce13c9c9cd0117d0 Mon Sep 17 00:00:00 2001
From 6812a3e081d5ec48d4881c626c532333d2c48d92 Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Mon, 27 Sep 2021 05:22:43 -0700
Subject: [PATCH] Fix resource leak in nvv4l2decoder
Subject: [PATCH 6/7] Fix resource leak in nvv4l2decoder
See: https://forums.developer.nvidia.com/t/175198/11
@@ -11,11 +11,11 @@ Signed-off-by: Matt Madison <matt@madison.systems>
gstv4l2videodec.c | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
Index: gst-v4l2/gstv4l2object.c
===================================================================
--- gst-v4l2.orig/gstv4l2object.c
+++ gst-v4l2/gstv4l2object.c
@@ -3753,6 +3753,13 @@ gst_v4l2_object_set_format_full (GstV4l2
diff --git a/gstv4l2object.c b/gstv4l2object.c
index ad7193e..c1aeb0b 100644
--- a/gstv4l2object.c
+++ b/gstv4l2object.c
@@ -3764,6 +3764,13 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
(v4l2object->open_mjpeg_block == TRUE) &&
(g_str_equal(gst_structure_get_name(gst_caps_get_structure (caps, 0)), "image/jpeg")))
format.fmt.pix_mp.pixelformat = pixelformat = V4L2_PIX_FMT_MJPEG;
@@ -29,11 +29,11 @@ Index: gst-v4l2/gstv4l2object.c
#endif
#ifdef USE_V4L2_TARGET_NV
Index: gst-v4l2/gstv4l2videodec.c
===================================================================
--- gst-v4l2.orig/gstv4l2videodec.c
+++ gst-v4l2/gstv4l2videodec.c
@@ -832,8 +832,10 @@ gst_v4l2_video_dec_set_format (GstVideoD
diff --git a/gstv4l2videodec.c b/gstv4l2videodec.c
index b04e659..40e2c2a 100644
--- a/gstv4l2videodec.c
+++ b/gstv4l2videodec.c
@@ -828,8 +828,10 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
if (ret)
self->input_state = gst_video_codec_state_ref (state);
@@ -45,3 +45,6 @@ Index: gst-v4l2/gstv4l2videodec.c
#ifdef USE_V4L2_TARGET_NV
{
--
2.34.1

View File

@@ -1,17 +1,18 @@
From b38d37dc9dad6cb7097d4d524f274a0941f541d8 Mon Sep 17 00:00:00 2001
From 79af9ca6b45ae89598eacdd407e55aaed294aa85 Mon Sep 17 00:00:00 2001
From: Ilies CHERGUI <ilies.chergui@gmail.com>
Date: Fri, 15 Apr 2022 21:20:30 +0100
Subject: [PATCH 8/8] Makefile fixes for OE builds
Subject: [PATCH 7/7] Makefile fixes for OE builds
Signed-off-by: Ilies CHERGUI <ilies.chergui@gmail.com>
Signed-off-by: Matt Madison <matt@madison.systems>
---
Makefile | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
Makefile | 44 ++++++++++++++++++++------------------------
1 file changed, 20 insertions(+), 24 deletions(-)
Index: gst-v4l2/Makefile
===================================================================
--- gst-v4l2.orig/Makefile
+++ gst-v4l2/Makefile
diff --git a/Makefile b/Makefile
index 21fe10e..90978fc 100644
--- a/Makefile
+++ b/Makefile
@@ -10,49 +10,44 @@
#
###############################################################################
@@ -37,8 +38,7 @@ Index: gst-v4l2/Makefile
-endif
+SO_NAME := libgstnvvideo4linux2.so
-LIBS:= -lnvbufsurface -lnvbufsurftransform -lgstnvdsseimeta
+LIBS:= -lnvbufsurface -lnvbufsurftransform
LIBS:= -lnvbufsurface -lnvbufsurftransform -lgstnvdsseimeta
SRCS := $(wildcard *.c)
-
-INCLUDES += -I./ -I../
@@ -91,3 +91,6 @@ Index: gst-v4l2/Makefile
.PHONY: clean
clean:
--
2.34.1

View File

@@ -8,17 +8,16 @@ LIC_FILES_CHKSUM = "file://LICENSE.gst-nvvideo4linux2;md5=457fb5d7ae2d8cd8cabcc2
TEGRA_SRC_SUBARCHIVE = "Linux_for_Tegra/source/public/gst-nvvideo4linux2_src.tbz2"
require recipes-bsp/tegra-sources/tegra-sources-35.1.0.inc
SRC_URI += "file://0002-v4l2videoenc-Fix-negotiation-caps-leak.patch \
file://0003-v4l2allocator-Fix-data-offset-bytesused-size-validat.patch \
file://0004-v4l2bufferpool-Avoid-set_flushing-warning.patch \
file://0005-gstv4l2videodec-use-ifdef-macro-for-consistency-with.patch \
file://0006-gstv4l2videodec-check-if-we-have-a-pool-before-the-l.patch \
file://0007-Fix-resource-leak-in-nvv4l2decoder.patch \
file://0001-Work-around-missing-nvdsseimeta-header.patch \
file://0008-Makefile-fixes-for-OE-builds.patch \
"
DEPENDS = "gstreamer1.0 glib-2.0 gstreamer1.0-plugins-base virtual/egl tegra-libraries-multimedia tegra-mmapi"
SRC_URI += "\
file://0001-v4l2videoenc-Fix-negotiation-caps-leak.patch \
file://0002-v4l2allocator-Fix-data-offset-bytesused-size-validat.patch \
file://0003-v4l2bufferpool-Avoid-set_flushing-warning.patch \
file://0004-gstv4l2videodec-use-ifdef-macro-for-consistency-with.patch \
file://0005-gstv4l2videodec-check-if-we-have-a-pool-before-the-l.patch \
file://0006-Fix-resource-leak-in-nvv4l2decoder.patch \
file://0007-Makefile-fixes-for-OE-builds.patch \
"
DEPENDS = "gstreamer1.0 glib-2.0 gstreamer1.0-plugins-base virtual/egl tegra-libraries-multimedia tegra-libraries-nvdsseimeta tegra-mmapi"
PACKAGECONFIG ??= "libv4l2"
PACKAGECONFIG[libv4l2] = ",,v4l-utils,tegra-libraries-multimedia-v4l"
@@ -32,7 +31,7 @@ inherit gettext pkgconfig features_check
REQUIRED_DISTRO_FEATURES = "opengl"
remove_headers() {
rm ${WORKDIR}/nvbuf_utils.h
rm ${WORKDIR}/nvbuf_utils.h
rm ${WORKDIR}/nvbufsurface.h
rm ${WORKDIR}/v4l2_nv_extensions.h
}