2008-06-27 Zeeshan Ali Khattak <zeenix@gmail.com>
+ * src/gupnp-metadata-extractor.vala:
+
+ Extract the mime-type using GIO.
+
+2008-06-27 Zeeshan Ali Khattak <zeenix@gmail.com>
+
* configure.ac:
* src/Makefile.am:
this.playbin.uri = value;
if (this.playbin.uri != null) {
+ extract_mime ();
/* Start the extaction when we get a new URI */
this.playbin.set_state (State.PAUSED);
}
}
}
+ private void extract_mime () {
+ File file = File.new_for_uri (this.uri);
+
+ weak FileInfo file_info;
+
+ try {
+ file_info = file.query_info (FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ FileQueryInfoFlags.NONE,
+ null);
+ } catch (Error error) {
+ critical ("Failed to query content type for '%s'\n", this.uri);
+
+ return;
+ }
+
+ weak string content_type = file_info.get_content_type ();
+ weak string mime = g_content_type_get_mime_type (content_type);
+ if (mime != null) {
+ GLib.Value value;
+
+ value.init (typeof (string));
+ value.set_string (mime);
+
+ /* signal the availability of new tag */
+ this.metadata_available (this.playbin.uri, "mime-type", ref value);
+ }
+ }
+
private void tag_cb (Gst.Bus bus,
Gst.Message message) {
TagList tag_list;