Re: [Tracker] Can a tracker extractor change the MIME type of a input file?

On 08/12/10 08:04, Lin, Mengdong wrote:
I wonder whether the a extractor can change the MIME type?

I want to support media types protected by OMA DRM V1. There is a
encryption wrapper outside the original media content. The wrapper
file's MIME type is : application/vnd.oma.drm.content By registering
this mime type to "shared-mime-info", I can write a tracker extractor
to handle this type of file. And the extractor can find the MIME type
of the original media content by reading the file header.

Then, is it possible for the extractor to inform tracker the real
MIME type? So the DRM-protected media can still be sorted by its read
media type. Eg. For a DRM-protected mp3, it will change the mime type
from "application/vnd.oma.drm.content" to "audio/mp3". Thus a music
player application will find it by letting tracker list all audio

In theory, it is possible, but I don't recommend it.

Tracker also already would register this file as an "audio" class in the ontology used and written to the database, so the mime type shouldn't need changing if you mean to search for all audio files in Tracker.

I'm asking this question because "shared-mime-info" uses file name
suffix and simple string match to register a new MIME type, so it
cannot find the mime type of the embedded media content.

That's right, but ideally, the extractor should know how to handle that embedded data.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]