Hi Marco,

I think before synchronizing the supported formats in Gaia and Gecko, maybe 
Gecko can 
first sync with DeviceStorage.properties, nsMediaSniffer and 
nsExternalHelperAppService.

Music app uses MediaDB which integrates the DeviceStorage API and the IndexedDB 
API, 
and DeviceStorage will return files to be parsed with metadata parser in Music 
app. 
Because DeviceStorage returns formats base on DeviceStorage.properties, if we 
already 
know some formats are not supported in Gecko, we shouldn't pass them to the 
metadata 
parser, also MediaDB will not record them and not to mention they will not be 
listed 
in Music app. And for the known supported formats, nsExternalHelperAppService 
should 
not block them, right?

If we filter out the unsupported formats with the first step, it's still 
possible that 
some supported formats/containers with unsupported encodings will be recorded 
in MediaDB,
and when Music app tries to play them, we might still encounter the error of 
"Warning: HTTP "Content-Type" of "audio/xxx" is not supported."

But does using only the logic of audio.canPlayType() to judge files can 
playable or not 
solve this problem? I guess probably, but the metadata parsing time will take 
even longer 
because we have to try to decode every files before we parse the metadata, I am 
not sure 
how long it takes to decode one audio file, but certainly it saves time if we 
parse files
without decoding them first.

I am thinking that maybe error handling ui is a good choice if we cannot 
guarantee the 
so-called "audio" files listed in Music app can be playable or not.

Cheers,
Dominic

----- Original Message -----
From: "Marco Chen" <[email protected]>
To: "dev-b2g" <[email protected]>
Cc: "Paul Adenot" <[email protected]>
Sent: Friday, May 3, 2013 6:46:00 PM
Subject: [b2g] [Media] The media filter between Gaia - music app and Gecko - 
nsMediaSniffer & nsExternalHelperAppService

Hi all,

Even this topic seems to be related to media (dev-media) but according it also 
related to Gaia and b2g I post it to dev-b2g first.

Issue:
  Currently, we met a bug about some files which can be listed by Music app but 
can't play by Gecko.
  The main reason is that there are two media sniffer mechanism performed by 
Gaia and Gecko separately. 

Detail:
  Gaia: Music app used media sniffer mechanism from metadata.js which will try 
to parse metadata by itself in first.
        If first step is failed then fall into Gecko's mechanism 
(audio.canPlayType())
  Gecko:nsMediaSniffer implemented metadata parsing for some media type too.
        If nsMediaSniffer is failed then check into 
nsExternalHelperAppService's mimetype entries.

  So if Gaia's metadata.js is implemented with different way then Gecko's then 
issue mentioned by this mail will be occurred.

Discussion Item:
  Do we really need Gaia to do filter by itself or just to use Gecko's 
mechanism (audio.canPlayType()) is enough?
  Then this way can avoid the in-consistent filter capability between Gaia & 
Gecko.

Thanks,
Sincerely yours
-------------------------------------
Marco Chen
System Engineer in Firefox OS
Mozilla Taiwan

Tel: +886-2-87861100 # 352
mail: [email protected]

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to