Re: Gnomad2 and libmtp

Linus Walleij <[email protected]> Thu, 23 Mar 2006 14:49:39 +0100 (CET)
Newsgroups gmane.comp.multimedia.libnjb.user
Message-ID <[email protected]>
On Thu, 23 Mar 2006 [email protected] wrote:

> One approach to the multiple-API issue might be that
> libnjb decides when to use libmtp in place of its own
> code, hiding this from the app?

The way it works is that each device have their own vendor and product ID, 
which is actually two 16-bit numbers, something like 0x041e (Creative) and 
0x4123 (Zen model such and such). When Creative upgraded their firmware 
with MTP they also changed the product ID, so for example the Zen Micro 
have two different numbers depending on whether it is PDE or MTP.

What you do (well, what I do) is first scan for devices using libnjb, and 
then scan for devices using libmtp, and concatenate the list, assigning 
each device the desired library. This way you know which device uses which 
protocol in a very simple way. libnjb detects PDE devices (and the NJB1 
which is not PDE but OASiS) and libmtp detects the MTP devices.

Linus


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642