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 343196 - basetransform not handles ro/rw buffer flagging for transform_ip in all cases
basetransform not handles ro/rw buffer flagging for transform_ip in all cases
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.9
Assigned To: Wim Taymans
GStreamer Maintainers
: 340045 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-28 14:52 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2006-07-05 08:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes both basetransform problems (3.48 KB, patch)
2006-05-28 14:57 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
fixes both basetransform problems (3.28 KB, patch)
2006-05-28 15:19 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
reviewed Details | Review
reworked patch (2.40 KB, patch)
2006-07-03 13:50 UTC, Wim Taymans
none Details | Review
updated patch (2.96 KB, patch)
2006-07-03 17:18 UTC, Wim Taymans
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2006-05-28 14:52:13 UTC
two issues:

(1) basetranssform class does not make sure that buffers given to transsform_ip in passthrough-mode as read-only. This us required so that elements can immediately return, if they don't do analysis of the data or the like.

(2) if src and sink-caps of an element are the same gst_base_transform_prepare_output_buffer() just returns the in_buf as out_buf, but refs the in_buf. Then in_buf and out_buf are not writeable anymore.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2006-05-28 14:57:14 UTC
Created attachment 66374 [details] [review]
fixes both basetransform problems

to test the patch add these lines to the beginning of gstvolume::volume_transform_ip

  /* don't process data in passthrough-mode */
  if (!gst_buffer_is_writable (outbuf)) return GST_FLOW_OK;

then go to gst-plugins-base/tests/check and run
  make elements/volume.check
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2006-05-28 15:19:03 UTC
Created attachment 66377 [details] [review]
fixes both basetransform problems   	 

remove a g_assert()
Comment 3 Wim Taymans 2006-07-03 13:44:31 UTC
not sure what an unwritable buffer has to do with passthrough mode. better to leave the current implementation in volume, ie, check if the plugin is in passthrough mode to decide if it should do something. It's perfectly possible and also optimal to have a writable buffer in passthrough mode as opposed to artificially make it READONLY.

Second patch is ok, working on a better path (there is an unref missing).
Comment 4 Wim Taymans 2006-07-03 13:46:39 UTC
*** Bug 340045 has been marked as a duplicate of this bug. ***
Comment 5 Wim Taymans 2006-07-03 13:50:34 UTC
Created attachment 68302 [details] [review]
reworked patch

updated patch that only makes sure the buffer is still writable in transform_ip.
Comment 6 Wim Taymans 2006-07-03 17:18:16 UTC
Created attachment 68316 [details] [review]
updated patch

this patch also handles the case where we receive an additional ref when the prepare_buffer vmethod is implemented by the subclass.
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2006-07-04 09:06:35 UTC
I've reworked my code and now happy if only the reffing gets fixed.
Comment 8 Wim Taymans 2006-07-04 14:41:34 UTC
does the last patch not fix the refcounting?
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2006-07-05 06:37:17 UTC
yes, it does. I just wanted to say. That I've fixed my code to not misuse the gst_buffer_is_writable() for passthrough detection.
Comment 10 Wim Taymans 2006-07-05 08:16:29 UTC
        * libs/gst/base/gstbasetransform.c:
        (gst_base_transform_prepare_output_buffer),
        (gst_base_transform_buffer_alloc),
        (gst_base_transform_handle_buffer):
        Make sure the buffer we pass to transform_ip has a refcount of
        1 and thus is writable. Fixes #343196