[haiku-development] Streaming Fixes for the Plugin Manager

  • From: Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 2 Mar 2016 20:25:39 +0100

Hello,

The first step to rework the plugin manager sniffing is to introduce the
wrapped BDataIO when a BPositionIO is not available, I think good part of
the work is already done in the BBufferedDataIO class and the wrapper can
be implemented starting from it. That wrapper I guess should have two
subclasses, one implementing the BDataIO interface and another implementing
the BPositionIO one depending on the object passed to sniff. In any case we
can get a performance gain if we buffer the data used to sniff.

What emerges from the discussions is that we have to actually reduce the
use of seekable operations from the plugins side. Most plugins are using
ReadAt calls in various places where it's not strictly needed and I think
in most cases it's not really tricky to replace them with BDataIO's non
seeked calls being mostly iterative.

If my understanding is correct, the plugins should at this point make a
distinction between BPositionIO and pure BDataIO objects, from what I can
see this will imply to avoid the usage of GetSize and Position mostly.

At this point we would have the plugins (in this case I'm starting from
ffmpeg) to avoid seeking whenever it's possible. What I've not clear is how
we can manage pseudo-seeking, I've read in previous discussions the example
where a plugin want to seek to the center or the end of the file to find
informations, how can it be done if the stream is passed as BDataIO? The
only thing I can think of is that it depends on the particular
protocol/format to be available for streaming.

Other than that, I see that BMediaFile is using BBufferIO class which needs
a BPositionIO. Should we change it to be a BBufferedDataIO?

-- 
Best Regards,
Dario

Other related posts: