[haiku-development] Re: Alternatives to plug-in sniffing

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 18 Aug 2010 12:26:38 +0200

Le 18 août 2010 à 03:16, Christopher Humphries a écrit :

> Hi all,
> I had some problems with the sniffing functions in the media plug-ins.
> I realise that for streaming to work properly the plug-ins need to be
> adapted to make do with a BDataIO when the data isn’t seekable, but it’s
> still a problem when only a small chunk of data is available.
> Asking each plug-in to sniff the data works on files, where seeking is a
> simple matter, but for live streams, seeking is tricky. If the file is
> small, seeking in the saved data can work, but bulkier content, e.g., HD
> video and DVD data, takes up several gigabytes.
> In my opinion, it would be much easier to optionally be able to directly ask
> for a certain plug-in, using the device API (libdvdnav can return accurate
> format data) or the media MIME type, and avoid the format sniffing.

In BeOS the extractor addons were passed a BDataIO but they dynamic_cast them 
to BPositionIO to Seek() them back to 0 after sniffing...

It should also be possible to use dynamic_cast to check for a subtype and use 
this one to check for properties (mime type...) instead of checking the data 

BStreamingIO *s = dynamic_cast<BStreamingIO *>io;
if (s) {
        BString mime;
        if (mime == "video/mpeg-ts") {

Dano had those MetaData calls added on BDataIO that mapped to Read/WriteAttr() 
for BFile which allowed to get the BEOS:TYPE attribute this way, maybe we 
should also do it alike.


Other related posts: