GNOME Bugzilla – Bug 567497
[fakesrc] respect output size/offset of basesrc
Last modified: 2011-04-13 12:49:08 UTC
Seems like 'stop' parameter of a (segment) seek event is ignored by basesrc. I was facing this problem in Rygel that uses filesrc ! fakesink and now I have a test-app that reproduces this issue with 'fakesrc ! fakesink' that I am going to attach to this bug. The app asks for byte 20 to 45 but gets the whole 4096-byte buffer (default blocksize on the source).
Created attachment 126274 [details] Test app that reproduces this bug To build, get yourself the recent version of valac and: valac -o test-seekable --pkg gstreamer-0.10 test-seekable.vala
Created attachment 126276 [details] The generated C file for vala-impaired
Created attachment 126280 [details] The original C file Sorry! the previous one i pasted was generated after I made a change to the vala source: set the blocksize of src to "5", though it seems that size is ignored so it didn't really make any diff.
Like I said on IRC, seek requests for a particular time range don't necessarily clip the buffers to be within that time range, it just sends all buffers that fall within the given range, along with a new-segment that describes which portions are 'valid'. We probably want some element that does the clipping for you to use.
Audio sinks clip to a TIME segment, so my thinking is that filesink should clip to BYTES segments. Same for all ANY caps sinks in fact.
> Audio sinks clip to a TIME segment, so my thinking is that filesink should clip > to BYTES segments. Same for all ANY caps sinks in fact. I think audiosinks can only do that because GST_BUFFER_TIMESTAMP() can be assumed to be reliable if it is set, which is something that can't be said for GST_BUFFER_OFFSET(), partly because it's not used a lot, or at least not consistently, but also because it can mean different things in different circumstances if not the same circumstances, so using it automatically for clipping is likely to lead to disaster.
Right, offset is "media specific", so there can't be a general way of handling it.
I now have my own sink in rygel that does the require clipping.