From: Zeeshan Ali (Khattak) Date: Mon, 7 Sep 2009 13:01:02 +0000 (+0300) Subject: core,tracker: Derive Thumbnail from IconInfo X-Git-Tag: RYGEL_0_4~137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52add37d16f44476043aa0a264d1a81c3621662d;p=profile%2Fivi%2Frygel.git core,tracker: Derive Thumbnail from IconInfo --- diff --git a/src/plugins/tracker/rygel-tracker-plugin.vala b/src/plugins/tracker/rygel-tracker-plugin.vala index 5142d23..7bf6214 100644 --- a/src/plugins/tracker/rygel-tracker-plugin.vala +++ b/src/plugins/tracker/rygel-tracker-plugin.vala @@ -39,11 +39,12 @@ public class Rygel.TrackerPlugin : Rygel.Plugin { this.add_resource (resource_info); - var icon_info = new IconInfo ("image/png", // Mimetype - 48, // width - 48, // height - 24, // depth - ICON); // Icon Path + var icon_info = new IconInfo ("image/png"); + + icon_info.path = ICON; + icon_info.width = 48; + icon_info.height = 48; + icon_info.depth = 24; this.add_icon (icon_info); } diff --git a/src/rygel/rygel-icon-info.vala b/src/rygel/rygel-icon-info.vala index 66a68d3..52607eb 100644 --- a/src/rygel/rygel-icon-info.vala +++ b/src/rygel/rygel-icon-info.vala @@ -25,21 +25,16 @@ * Holds information about an icon. */ public class Rygel.IconInfo { - public string mimetype; - public uint width; - public uint height; - public uint depth; + public string mime_type; public string path; - public IconInfo (string mimetype, - uint width, - uint height, - uint depth, - string path) { - this.mimetype = mimetype; - this.width = width; - this.height = height; - this.depth = depth; + public long size = -1; // Size in bytes + public int width = -1; // Width in pixels + public int height = -1; // Height in pixels + public int depth = -1; // depth of pixels in bytes + + public IconInfo (string mime_type) { + this.mime_type = mime_type; this.path = path; } } diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala index b29da43..354e1e4 100644 --- a/src/rygel/rygel-root-device-factory.vala +++ b/src/rygel/rygel-root-device-factory.vala @@ -245,7 +245,7 @@ public class Rygel.RootDeviceFactory { string height = icon_info.height.to_string (); string depth = icon_info.depth.to_string (); - icon_node->new_child (null, "mimetype", icon_info.mimetype); + icon_node->new_child (null, "mimetype", icon_info.mime_type); icon_node->new_child (null, "width", width); icon_node->new_child (null, "height", height); icon_node->new_child (null, "depth", depth); diff --git a/src/rygel/rygel-thumbnail.vala b/src/rygel/rygel-thumbnail.vala index 63f5e7d..d040fc9 100644 --- a/src/rygel/rygel-thumbnail.vala +++ b/src/rygel/rygel-thumbnail.vala @@ -22,26 +22,17 @@ using GUPnP; -private errordomain Rygel.ThumbnailError { - BAD_URI -} - /** * Represents a picture or video thumbnail. */ -public class Rygel.Thumbnail : GLib.Object { +public class Rygel.Thumbnail : Rygel.IconInfo { public string uri; - public string mime_type; public string dlna_profile; - public long size = -1; // Size in bytes - public int width = -1; // Width in pixels - public int height = -1; // Height in pixels - public int color_depth = -1; // depth of pixels in bytes - public Thumbnail (string mime_type = "image/jpeg", string dlna_profile = "JPEG_TN") { - this.mime_type = mime_type; + base (mime_type); + this.dlna_profile = dlna_profile; } @@ -54,7 +45,7 @@ public class Rygel.Thumbnail : GLib.Object { res.width = this.width; res.height = this.height; - res.color_depth = this.color_depth; + res.color_depth = this.depth; /* Protocol info */ res.protocol_info = this.get_protocol_info (protocol);