[OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
-Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF This makes sure that the buffer is not reffed another time when storing it in the GstVideoFrame, keeping it writable if it was writable. -Don't ref buffers twice when mapping Signed-off-by: Yuqing Zhu --- ...rame-Don-t-ref-buffers-twice-when-mapping.patch | 25 +++ ...frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch | 87 ++ 2 files changed, 112 insertions(+) create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch new file mode 100644 index 000..c4eef00 --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch @@ -0,0 +1,25 @@ +From 269f642c45d85cfd630ed490478e6bd6b71a767f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Tue, 16 Sep 2014 01:07:18 +0300 +Subject: [PATCH] video-frame: Don't ref buffers twice when mapping + +--- + gst-libs/gst/video/video-frame.c |2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c +index 01f23c0..8a9ae96 100644 +--- a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c +@@ -105,7 +105,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info, + frame->data[i] = frame->map[0].data + info->offset[i]; + } + } +- frame->buffer = gst_buffer_ref (buffer); ++ frame->buffer = buffer; + if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) + gst_buffer_ref (frame->buffer); + +-- +1.7.9.5 + diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch new file mode 100644 index 000..554b8ac --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch @@ -0,0 +1,87 @@ +From 40a293d44d1aeccf5eb8e86f23a0b13666111c5c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Fri, 12 Sep 2014 14:39:16 +0300 +Subject: [PATCH 2/3] video-frame: Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF + +This makes sure that the buffer is not reffed another time when +storing it in the GstVideoFrame, keeping it writable if it was +writable. + +Upstream Status: Accepted +https://bugzilla.gnome.org/show_bug.cgi?id=736118 +--- + gst-libs/gst/video/video-frame.c |9 - + gst-libs/gst/video/video-frame.h | 18 ++ + 2 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c +index 537cf70..01f23c0 100644 +--- a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c +@@ -106,6 +106,9 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info, + } + } + frame->buffer = gst_buffer_ref (buffer); ++ if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) ++gst_buffer_ref (frame->buffer); ++ + frame->meta = meta; + + /* buffer flags enhance the frame flags */ +@@ -189,11 +192,13 @@ gst_video_frame_unmap (GstVideoFrame * frame) + GstBuffer *buffer; + GstVideoMeta *meta; + gint i; ++ GstMapFlags flags; + + g_return_if_fail (frame != NULL); + + buffer = frame->buffer; + meta = frame->meta; ++ flags = frame->map[0].flags; + + if (meta) { + for (i = 0; i < frame->info.finfo->n_planes; i++) { +@@ -202,7 +207,9 @@ gst_video_frame_unmap (GstVideoFrame * frame) + } else { + gst_buffer_unmap (buffer, &frame->map[0]); + } +- gst_buffer_unref (buffer); ++ ++ if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) ++gst_buffer_unref (frame->buffer); + } + + /** +diff --git a/gst-libs/gst/video/video-frame.h b/gst-libs/gst/video/video-frame.h +index 627fab0..f8e6304 100644 +--- a/gst-libs/gst/video/video-frame.h b/gst-libs/gst/video/video-frame.h +@@ -149,6 +149,24 @@ typedef enum { + GST_VIDEO_BUFFER_FLAG_LAST= (GST_BUFFER_FLAG_LAST << 8) + } GstVideoBufferFlags; + ++/** ++ * GstVideoBufferFlags: ++ * @GST_VIDEO_FRAME_MAP_FLAG_NO_REF: Don't take another reference of the buffer and store it in ++ *the GstVideoFrame. This makes sure that the buffer stays ++ *writable while the frame is mapped, but requires that the ++ *buffer reference stays valid until the
Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
On Mon, Jul 27, 2015 at 8:26 AM, Yuqing Zhu wrote: > -Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF > This makes sure that the buffer is not reffed another time when > storing it in the GstVideoFrame, keeping it writable if it was writable. > > -Don't ref buffers twice when mapping > > Signed-off-by: Yuqing Zhu Which recipe is applying this? It seems it is not being applied. > --- > ...rame-Don-t-ref-buffers-twice-when-mapping.patch | 25 +++ > ...frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch | 87 > ++ > 2 files changed, 112 insertions(+) > create mode 100644 > meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch > create mode 100644 > meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > > diff --git > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch > > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch > new file mode 100644 > index 000..c4eef00 > --- /dev/null > +++ > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch > @@ -0,0 +1,25 @@ > +From 269f642c45d85cfd630ed490478e6bd6b71a767f Mon Sep 17 00:00:00 2001 > +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= > +Date: Tue, 16 Sep 2014 01:07:18 +0300 > +Subject: [PATCH] video-frame: Don't ref buffers twice when mapping Upstream-Status: ??? > +--- > + gst-libs/gst/video/video-frame.c |2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/gst-libs/gst/video/video-frame.c > b/gst-libs/gst/video/video-frame.c > +index 01f23c0..8a9ae96 100644 > +--- a/gst-libs/gst/video/video-frame.c > b/gst-libs/gst/video/video-frame.c > +@@ -105,7 +105,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, > GstVideoInfo * info, > + frame->data[i] = frame->map[0].data + info->offset[i]; > + } > + } > +- frame->buffer = gst_buffer_ref (buffer); > ++ frame->buffer = buffer; > + if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) > + gst_buffer_ref (frame->buffer); > + > +-- > +1.7.9.5 > + > diff --git > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > new file mode 100644 > index 000..554b8ac > --- /dev/null > +++ > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > @@ -0,0 +1,87 @@ > +From 40a293d44d1aeccf5eb8e86f23a0b13666111c5c Mon Sep 17 00:00:00 2001 > +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= > +Date: Fri, 12 Sep 2014 14:39:16 +0300 > +Subject: [PATCH 2/3] video-frame: Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF > + > +This makes sure that the buffer is not reffed another time when > +storing it in the GstVideoFrame, keeping it writable if it was > +writable. > + > +Upstream Status: Accepted > +https://bugzilla.gnome.org/show_bug.cgi?id=736118 The field is: Upstream-Status: Submitted [https://...] > +--- > + gst-libs/gst/video/video-frame.c |9 - > + gst-libs/gst/video/video-frame.h | 18 ++ > + 2 files changed, 26 insertions(+), 1 deletion(-) > + > +diff --git a/gst-libs/gst/video/video-frame.c > b/gst-libs/gst/video/video-frame.c > +index 537cf70..01f23c0 100644 > +--- a/gst-libs/gst/video/video-frame.c > b/gst-libs/gst/video/video-frame.c > +@@ -106,6 +106,9 @@ gst_video_frame_map_id (GstVideoFrame * frame, > GstVideoInfo * info, > + } > + } > + frame->buffer = gst_buffer_ref (buffer); > ++ if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) > ++gst_buffer_ref (frame->buffer); > ++ > + frame->meta = meta; > + > + /* buffer flags enhance the frame flags */ > +@@ -189,11 +192,13 @@ gst_video_frame_unmap (GstVideoFrame * frame) > + GstBuffer *buffer; > + GstVideoMeta *meta; > + gint i; > ++ GstMapFlags flags; > + > + g_return_if_fail (frame != NULL); > + > + buffer = frame->buffer; > + meta = frame->meta; > ++ flags = frame->map[0].flags; > + > + if (meta) { > + for (i = 0; i < frame->info.finfo->n_planes; i++) { > +@@ -202,7 +207,9 @@ gst_video_frame_unmap (GstVideoFrame * frame) > + } else { > + gst_buffer_unmap (buffer, &frame->map[0]); > + } > +- gst_buffer_unref (buffer); > ++ > ++ if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) > ++gst_buffer_unref (frame->buffer); > + } > + > + /** > +diff --git a/gst-libs/gst/video/video-frame.h > b/gst-libs/gst/video/video-frame.h > +index 627fab0..f8e6304 100644 > +--- a/gst-libs/gst/video/video-frame.h > b/gst-libs/gst/video/video-frame.h > +@@ -149,6 +149,24 @@ typedef enum { > + GST_VIDEO_BUFFER_FLAG_LAST= (GST_BUFFER_FLAG_LA
Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
Hi Otavio, Really sorry for the Upstream-Status format error, we just kept the same with some patches on fido branch, maybe they are old version. And I still have a little confusion about the third comment. My question are as followed. -Original Message- From: Otavio Salvador [mailto:otavio.salva...@ossystems.com.br] Sent: Tuesday, July 28, 2015 12:51 AM To: Zhu Yuqing-B54851 Cc: Patches and discussions about the oe-core layer Subject: Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch On Mon, Jul 27, 2015 at 8:26 AM, Yuqing Zhu wrote: > -Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF > This makes sure that the buffer is not reffed another time when > storing it in the GstVideoFrame, keeping it writable if it was writable. > > -Don't ref buffers twice when mapping > > Signed-off-by: Yuqing Zhu Which recipe is applying this? It seems it is not being applied. > --- > ...rame-Don-t-ref-buffers-twice-when-mapping.patch | 25 +++ > ...frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch | 87 > ++ > 2 files changed, 112 insertions(+) > create mode 100644 > meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video > -frame-Don-t-ref-buffers-twice-when-mapping.patch > create mode 100644 > meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video > -frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > > diff --git > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-vid > eo-frame-Don-t-ref-buffers-twice-when-mapping.patch > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-vid > eo-frame-Don-t-ref-buffers-twice-when-mapping.patch > new file mode 100644 > index 000..c4eef00 > --- /dev/null > +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001 > +++ -video-frame-Don-t-ref-buffers-twice-when-mapping.patch > @@ -0,0 +1,25 @@ > +From 269f642c45d85cfd630ed490478e6bd6b71a767f Mon Sep 17 00:00:00 > +2001 > +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= > +Date: Tue, 16 Sep 2014 01:07:18 +0300 > +Subject: [PATCH] video-frame: Don't ref buffers twice when mapping Upstream-Status: ??? > +--- > + gst-libs/gst/video/video-frame.c |2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/gst-libs/gst/video/video-frame.c > +b/gst-libs/gst/video/video-frame.c > +index 01f23c0..8a9ae96 100644 > +--- a/gst-libs/gst/video/video-frame.c > b/gst-libs/gst/video/video-frame.c > +@@ -105,7 +105,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, > GstVideoInfo * info, > + frame->data[i] = frame->map[0].data + info->offset[i]; > + } > + } > +- frame->buffer = gst_buffer_ref (buffer); > ++ frame->buffer = buffer; > + if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0) > + gst_buffer_ref (frame->buffer); > + > +-- > +1.7.9.5 > + > diff --git > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-vid > eo-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-vid > eo-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > new file mode 100644 > index 000..554b8ac > --- /dev/null > +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002 > +++ -video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch > @@ -0,0 +1,87 @@ > +From 40a293d44d1aeccf5eb8e86f23a0b13666111c5c Mon Sep 17 00:00:00 > +2001 > +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= > +Date: Fri, 12 Sep 2014 14:39:16 +0300 > +Subject: [PATCH 2/3] video-frame: Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF > + > +This makes sure that the buffer is not reffed another time when > +storing it in the GstVideoFrame, keeping it writable if it was > +writable. > + > +Upstream Status: Accepted > +https://bugzilla.gnome.org/show_bug.cgi?id=736118 The field is: Upstream-Status: Submitted [https://...] [Yuqing Zhu-b54851]: the Upstream-Status of this patch is "Accepted", I am not very clear about your comments "Submitted", do you mean I should add the web site in the same line with Upstream-Status? Just like this: Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=736118] I've read the guide line, here is my understanding: Upstream-Status: Pending Upstream-Status: Submitted [where] Upstream-Status: Accepted Upstream-Status: Backport [from where] Upstream-Status: Denied Upstream-Status: Inappropriate [reason] Just obey this, right? So that is Upstream-Status: Accepted That's it ? > +--- > + gst-libs/gst/video/video-frame.c |9 - > + gst-libs/gst/video/video-frame.h | 18 ++ > + 2 files changed, 26 insertions(+), 1
Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
On Tue, Jul 28, 2015 at 2:23 AM, Zhu Carol wrote: > Hi Otavio, >Really sorry for the Upstream-Status format error, we just kept the same > with some patches on fido branch, maybe they are old version. And I still > have a little confusion about the third comment. My question are as followed. No problem; thanks by being responsive with the feedback. Comments below... ... >> +Upstream Status: Accepted >> +https://bugzilla.gnome.org/show_bug.cgi?id=736118 > > The field is: > > Upstream-Status: Submitted [https://...] > > [Yuqing Zhu-b54851]: the Upstream-Status of this patch is "Accepted", I am > not very clear about your comments "Submitted", do you mean I should add the > web site in the same line with Upstream-Status? > Just like this: > Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=736118] Accepted would be when upstream says it will apply it for next release but you don't know when. Looking at the bug, it seemed it was not been applied yet so it would be submitted. > I've read the guide line, here is my understanding: > Upstream-Status: Pending > Upstream-Status: Submitted [where] > Upstream-Status: Accepted > Upstream-Status: Backport [from where] > Upstream-Status: Denied > Upstream-Status: Inappropriate [reason] > > Just obey this, right? Yes. > So that is > Upstream-Status: Accepted > That's it ? To be honest, this specific case seems to have been addressed in 1.4.2 in a different way; http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?h=1.4&id=f711288c7c86c33aed18f52ed6d7787d19b7741d So this could be dropped. -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
Hi Otavio, The 1.4.2 fix is ugly, so [OE-core] [poky][PATCH v3 5/6] gstreamer1.0-plugins-base: Add videofilter related patch is used to revert it. Actually these patches are all back port from 1.5.1, I will change the Upstream-Status and merge these two patches together. B.R. Carol -Original Message- From: Otavio Salvador [mailto:otavio.salva...@ossystems.com.br] Sent: Tuesday, July 28, 2015 7:19 PM To: Zhu Yuqing-B54851 Cc: Patches and discussions about the oe-core layer Subject: Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch On Tue, Jul 28, 2015 at 2:23 AM, Zhu Carol wrote: > Hi Otavio, >Really sorry for the Upstream-Status format error, we just kept the same > with some patches on fido branch, maybe they are old version. And I still > have a little confusion about the third comment. My question are as followed. No problem; thanks by being responsive with the feedback. Comments below... ... >> +Upstream Status: Accepted >> +https://bugzilla.gnome.org/show_bug.cgi?id=736118 > > The field is: > > Upstream-Status: Submitted [https://...] > > [Yuqing Zhu-b54851]: the Upstream-Status of this patch is "Accepted", I am > not very clear about your comments "Submitted", do you mean I should add the > web site in the same line with Upstream-Status? > Just like this: > Upstream-Status: Accepted > [https://bugzilla.gnome.org/show_bug.cgi?id=736118] Accepted would be when upstream says it will apply it for next release but you don't know when. Looking at the bug, it seemed it was not been applied yet so it would be submitted. > I've read the guide line, here is my understanding: > Upstream-Status: Pending > Upstream-Status: Submitted [where] > Upstream-Status: Accepted > Upstream-Status: Backport [from where] > Upstream-Status: Denied > Upstream-Status: Inappropriate [reason] > > Just obey this, right? Yes. > So that is > Upstream-Status: Accepted > That's it ? To be honest, this specific case seems to have been addressed in 1.4.2 in a different way; http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?h=1.4&id=f711288c7c86c33aed18f52ed6d7787d19b7741d So this could be dropped. -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [poky][PATCH v2 4/6] gstreamer1.0-plugins-base: Add video-frame related patch
On Wed, Jul 29, 2015 at 6:22 AM, Zhu Carol wrote: >The 1.4.2 fix is ugly, so [OE-core] [poky][PATCH v3 5/6] > gstreamer1.0-plugins-base: Add videofilter related patch is used to revert it. >Actually these patches are all back port from 1.5.1, I will change the > Upstream-Status and merge these two patches together. I am sure Sebastian had a reason to not backport 1.5.1 fix but I am not in a position to make a call here... Carlos know the code better and should be the final word on this. -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core