Re: [Tracker] How tracker use libstreamanalyzer?

Many thanks, Philip and Martyn! It seems that libstreamanayzer may be not suitable for my work.

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 
  This is the method suggested by Philip 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'm not sure are other 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

-----Original Message-----
From: Martyn Russell [mailto:martyn lanedo com] 
Sent: Thursday, February 17, 2011 6:22 PM
To: Lin, Mengdong
Cc: tracker-list gnome org
Subject: Re: [Tracker] How tracker use libstreamanalyzer?

On 17/02/11 08:20, Lin, Mengdong wrote:
Could someone tell me how tracker may use of libstreamanalyzer? Is there
any code that I can refer to?

Hi there,

You have to do several things.

1. Build with libstreamanalyzer supported (see configure options)
2. Have no other extractors available for a mime-type to be use it. This 
can be done changing the environment before starting the command:


This means there will be no extractors found and LSA should be used.

We should probably have a command line option for this if LSA is available.

What Philip says is also true, the ontology generated is not inline with 
what Tracker expects so you might have some issues when using it. We 
already have to strip all nfo:FileDataObject properties from the 
generated sparql because the miner-fs already does that. There may also 
be some ontologies missing we expect and/or some just not in our ontology.


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