[tracker/tracker-0.10] NMM: Add property nmm:dlnaMime for dlna specific mimetypes tracker-extract-gstreamer: Add support fo



commit fab6d541c715b3d6ba6de548cfb3cee4946d2fe4
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Thu Aug 18 15:52:13 2011 +0300

    NMM: Add property nmm:dlnaMime for dlna specific mimetypes
    tracker-extract-gstreamer: Add support for dlnaMime
    
    Fixes NB#246131, DLNA mime-types needed

 data/ontologies/38-nmm.ontology                 |    9 ++++++++-
 src/tracker-extract/tracker-extract-gstreamer.c |    9 +++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/data/ontologies/38-nmm.ontology b/data/ontologies/38-nmm.ontology
index 732881e..ea3e6be 100644
--- a/data/ontologies/38-nmm.ontology
+++ b/data/ontologies/38-nmm.ontology
@@ -13,7 +13,7 @@
 
 nmm: a tracker:Namespace, tracker:Ontology ;
 	tracker:prefix "nmm" ;
-	nao:lastModified "2011-06-10T16:59:00Z" .
+	nao:lastModified "2011-08-19T13:05:00Z" .
 
 nmm:MusicPiece a rdfs:Class ;
 	rdfs:label "Music" ;
@@ -530,6 +530,13 @@ nmm:dlnaProfile a rdf:Property ;
 	rdfs:domain nfo:Media ;
 	rdfs:range xsd:string .
 
+nmm:dlnaMime a rdf:Property ;
+	rdfs:label "DLNA mimetype" ;
+	rdfs:comment "Mimetypes as defined for DLNA (occasional differences compared to xdg-mime)" ;
+	nrl:maxCardinality 1 ;
+	rdfs:domain nfo:Media ;
+	rdfs:range xsd:string .
+
 nmm:uPnPShared a rdf:Property ;
 	rdfs:label "uPnP shared" ;
 	rdfs:comment "Tells the uPnP MediaServer (e.g. Rygel) whether to export/share the resource or not" ;
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index c598903..1f500bb 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -135,6 +135,7 @@ typedef struct {
 	GUPnPDLNADiscoverer  *discoverer;
 	GUPnPDLNAInformation *dlna_info;
 	const gchar          *dlna_profile;
+	const gchar          *dlna_mime;
 #endif
 
 #if defined(GSTREAMER_BACKEND_DISCOVERER) || \
@@ -894,6 +895,13 @@ common_extract_stream_metadata (MetadataExtractor    *extractor,
 	} else {
 		g_debug ("No DLNA profile for file '%s'", uri);
 	}
+
+	if (extractor->dlna_mime) {
+		tracker_sparql_builder_predicate (metadata, "nmm:dlnaMime");
+		tracker_sparql_builder_object_string (metadata, extractor->dlna_mime);
+	} else {
+		g_debug ("No DLNA mime for file '%s'", uri);
+	}
 #endif /* GSTREAMER_BACKEND_GUPNP_DLNA */
 }
 
@@ -970,6 +978,7 @@ discoverer_init_and_run (MetadataExtractor *extractor,
 
 	/* Get DLNA profile */
 	extractor->dlna_profile = gupnp_dlna_information_get_name (extractor->dlna_info);
+	extractor->dlna_mime = gupnp_dlna_information_get_mime (extractor->dlna_info);
 
 	info = (GstDiscovererInfo *) gupnp_dlna_information_get_info (extractor->dlna_info);
 #else  /* GSTREAMER_BACKEND_GUPNP_DLNA */



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