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 589314 - [basetransform] clears GAP flag in passthrough mode
[basetransform] clears GAP flag in passthrough mode
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.25
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-22 01:34 UTC by Kipp
Modified: 2009-07-23 05:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
call gst_base_transform_set_gap_aware() in progressreport's init method (533 bytes, patch)
2009-07-22 01:35 UTC, Kipp
none Details | Review
basetransform-passthrough-gap.diff (692 bytes, patch)
2009-07-22 06:06 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Kipp 2009-07-22 01:34:29 UTC
The progressreport element is clearing the gap flags on buffers passed through it.  It should be a pure pass-through element, and not modify the buffers.  This can be fixed by calling gst_base_transform_set_gap_aware() in the element's init method.
Comment 1 Kipp 2009-07-22 01:35:36 UTC
Created attachment 138958 [details] [review]
call gst_base_transform_set_gap_aware() in progressreport's init method
Comment 2 Sebastian Dröge (slomo) 2009-07-22 06:06:14 UTC
Created attachment 138965 [details] [review]
basetransform-passthrough-gap.diff

If acting in passthrough mode basetransform should keep the GAP flag, the elements can't change the buffer content anyways.
Comment 3 Sebastian Dröge (slomo) 2009-07-22 06:07:30 UTC
I'll commit this after freeze.
Comment 4 Sebastian Dröge (slomo) 2009-07-22 07:07:31 UTC
commit be2a6bb6a9fa1418d35454bc853a8383832aaa82
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Jul 22 09:01:56 2009 +0200

    basetransform: Don't unset GAP flag if working in passthrough mode
    
    Fixes bug #589314.
Comment 5 Kipp 2009-07-22 18:11:44 UTC
Is this a good approach?  Initially I was going to submit this as a basetransform bug, too, but then I thought that even a pass-through element might not be gap-aware.  For example, a pass-through element might be doing something with the data as is goes through, like measuring a spectrum or something, and the element might not know what to do with a gap.  It seems to me that "is pass-through" and "is gap aware" really are two independent properties of an element.

Maybe what should happen is that "is pass-through" and "is gap-aware" should remain independent properties of a sub-class, but a check should be added to the basetransform class that if a sub-class has set the pass-through flag and has *not* set the gap-aware flag and a gap buffer is seen on the sink pad, then the basetransform class raises a "not supported" error.  That way elements that are not gap aware are prevented from accidentally processing data they don't understand, and if an element is gap aware but its maintainer has forgotten to say so in the init method then they'll find out from the error message and be reminded to fix it.
Comment 6 Sebastian Dröge (slomo) 2009-07-23 05:56:26 UTC
GAP aware and passthrough are two different properties but passthrough implies GAP aware (not the other way around).

A passthrough element will never (and can't) change the content of the buffers, i.e. the output buffers will still contain silence if the GAP flag was set and there's no reason to unset it.

The reason why the GAP aware mode exists is only to make sure that the output buffers only contain the GAP flag if the elements make sure that the buffers only have a GAP flag if they really contain silence. For a passthrough element this is always true and if the element understands the GAP flag or not doesn't matter, a buffer with GAP flag must contain silence.