After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751420 - basesink: need to deep-copy last buffer list in drain
basesink: need to deep-copy last buffer list in drain
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-24 05:24 UTC by Hyunjun Ko
Modified: 2015-06-24 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bufferlist: add new api gst_buffer_list_copy_deep (5.03 KB, patch)
2015-06-24 05:32 UTC, Hyunjun Ko
committed Details | Review
basesink: need to deep-copy last buffer list in drain (1.09 KB, patch)
2015-06-24 05:33 UTC, Hyunjun Ko
committed Details | Review

Description Hyunjun Ko 2015-06-24 05:24:35 UTC
Since https://bugzilla.gnome.org/show_bug.cgi?id=751026 is closed, basesink supports buffer-list for last-sample.
In gst_base_sink_drain function, the last buffer list needs to be deep-copied as same as last buffer.
Comment 1 Hyunjun Ko 2015-06-24 05:32:43 UTC
Created attachment 305980 [details] [review]
bufferlist: add new api gst_buffer_list_copy_deep

In IRC, slomo recommends all buffers need to be deep-copied in the list.
Comment 2 Hyunjun Ko 2015-06-24 05:33:13 UTC
Created attachment 305981 [details] [review]
basesink: need to deep-copy last buffer list in drain
Comment 3 Sebastian Dröge (slomo) 2015-06-24 08:47:40 UTC
Review of attachment 305980 [details] [review]:

::: gst/gstbufferlist.c
@@ +390,3 @@
+  for (i = 0; i < len; i++) {
+    GstBuffer *old = list->buffers[i];
+    gst_buffer_list_insert (result, i, gst_buffer_copy_deep (old));

Copying can fail for various reasons unfortunately, so you would insert NULL buffers here
Comment 4 Sebastian Dröge (slomo) 2015-06-24 08:53:08 UTC
commit 85aad81647e0de0bfa46c01b6c41399a4e0e221a
Author: Hyunjun Ko <zzoon.ko@samsung.com>
Date:   Wed Jun 24 14:19:04 2015 +0900

    basesink: need to deep-copy last buffer list in drain
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751420

commit d78b9a5adaf7f0c875caab3145a1b6ae6acd18df
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Jun 24 10:52:02 2015 +0200

    bufferlist: Warn if copying a buffer fails in gst_buffer_list_copy_deep()

commit 7ecef53dbb46c5938ef3019fcf79f162c3caa845
Author: Hyunjun Ko <zzoon.ko@samsung.com>
Date:   Wed Jun 24 14:18:47 2015 +0900

    bufferlist: add new api gst_buffer_list_copy_deep
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751420