I opened another loop to discuss this : http://mail.gnome.org/archives/tracker-list/2011-February/msg00042.html
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lin, Mengdong Sent: Friday, February 18, 2011 4:21 PM To: [email protected] Subject: [Tracker] Add support for OMA DRM Content format I want to add support for OMA DRM Content Format (DCF), an encrypted file format. Here is my solution: (1) I've registered *.dcf files in shared-mime-info, MIME type is "application/vnd.oma.drm.content". (2) We developed a DRM-aware GStreamer file source plug-in that can decrypt the protected content. So GStreamer can play the content and extract meta data from it. This means the GStreamer extractor can be re-used to extract metadata. (3) I plan to write a extractor: It will get the original media MIME type from the DCF file header, since the file header is not encrypted. If the MIME type is video, audio or image, the extractor will call GStreamer extractor to do the following work. This is the method suggested by Philip http://www.mail-archive.com/[email protected]/msg06840.html The difference is that not specific extractors (eg. MP3 extractor) but the general extractor - GStreamer will be used to extract meta data, because specific extractors cannot parse the encrypted DCF format. Is this method doable? I want to make code like this. But I still have two questions: 1. How can my extractor see the general extractors? "priv-> generic_extractors" is a private data structure of tracker-extract. But I don't want to duplicate the work of GStreamer-extractor to use the decodebin2. 2. Are there any other generic extractors that can disturb the flow? static TrackerExtractData extract_data[] = { { "application/vnd.oma.drm.content", extract_drm} { NULL, NULL } }; TrackerExtractData * tracker_extract_get_data (void) { return extract_data; } And it passes that to a native one: static void extract_drm (const gchar *uri, TrackerSparqlBuilder *preupdate, TrackerSparqlBuilder *metadata) { /* parse the original media MIME type, If this is video or audio, set the pattern as "audio/*" or "video/*" */ for (i = 0; i < priv-> generic_extractors->len; i++) { const TrackerExtractData *edata; ModuleData *mdata; mdata = &g_array_index (priv->generic_extractors, ModuleData, i); edata = mdata->edata; if (g_pattern_match (mdata->pattern, length, "audio/*", reversed)) { (*edata->func) (uri, preupdate, statements); else if if (g_pattern_match (mdata->pattern, length, "video/*", reversed)) { (*edata->func) (uri, preupdate, statements); else if if (g_pattern_match (mdata->pattern, length, "image/*", reversed)) { (*edata->func) (uri, preupdate, statements); /* DCF can also be used to protect JAVA applications, but we have no underlying components can extract their meta data */ } } } Thanks & Best Regards Amanda _______________________________________________ tracker-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/tracker-list _______________________________________________ tracker-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/tracker-list
