[Bug 747495] New: gst_base_text_overlay_push_frame() doesn't make memory copy when video buffer's memory is ready only

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Apr 8 02:52:41 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=747495

            Bug ID: 747495
           Summary: gst_base_text_overlay_push_frame() doesn't  make
                    memory copy when video buffer's  memory is ready only
    Classification: Platform
           Product: GStreamer
           Version: 1.4.5
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: mingke.wang at freescale.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 301113
  --> https://bugzilla.gnome.org/attachment.cgi?id=301113&action=edit
make gst_base_text_overlay_push_frame perform deep copy when memory of a buffer
is read only

gst_base_text_overlay_push_frame() just call gst_buffer_make_writable() to make
a copy of a buffer, but gst_buffer_make_writable just lookup the refcount to
determine if a buffer is writable, and it will use _gst_buffer_copy() which
don't perform a deep memory copy even if the flag of a memory is set to
GST_MEMORY_FLAG_READONLY. 

there is a case that a decoder output a gst buffer, for some reason, the output
video frame can't be modified. (eg, the output frame is used as the reference
frame by the decoder). in this case, the gst buffer is writable, we could
modify its meta, but the memory of the gst buffer is read only. the decoder
will set GST_MEMORY_FLAG_READONLY to its pool allocator to make the allocated
memory is read only.

So, we should detect the memory flag and use gst_buffer_copy_region with
GST_BUFFER_COPY_DEEP parameter to perform deep memory copy.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list