[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/tracker-list gnome org/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



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