From 5c87ad49194583f565697267006fe444edb1f976 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Wed, 21 Jul 2010 21:27:58 +0300 Subject: [PATCH] media-export: MediaExportItem -> Item Since this class is in MediaExport namespace now, there is no need for this prefix anymore. --- .../media-export/rygel-media-export-harvester.vala | 13 +- .../media-export/rygel-media-export-item.vala | 134 ++++++++++----------- 2 files changed, 71 insertions(+), 76 deletions(-) diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala index 1861708..c079e81 100644 --- a/src/plugins/media-export/rygel-media-export-harvester.vala +++ b/src/plugins/media-export/rygel-media-export-harvester.vala @@ -300,13 +300,12 @@ public class Rygel.MediaExport.Harvester : GLib.Object { return; } if (file == entry) { - var item = MediaExportItem.create_from_info ( - this.containers.peek_head (), - file, - dlna, - mime, - size, - mtime); + var item = Item.create_from_info (this.containers.peek_head (), + file, + dlna, + mime, + size, + mtime); if (item != null) { item.parent_ref = this.containers.peek_head (); try { diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala index 5ec1ce1..1f3f65f 100644 --- a/src/plugins/media-export/rygel-media-export-item.vala +++ b/src/plugins/media-export/rygel-media-export-item.vala @@ -27,14 +27,13 @@ using Gst; /** * Represents MediaExport item. */ -public class Rygel.MediaExport.MediaExportItem : Rygel.MediaItem { - public static MediaExportItem? create_from_info ( - MediaContainer parent, - File file, - GUPnP.DLNAInformation dlna_info, - string mime, - uint64 size, - uint64 mtime) { +public class Rygel.MediaExport.Item : Rygel.MediaItem { + public static Item? create_from_info (MediaContainer parent, + File file, + GUPnP.DLNAInformation dlna_info, + string mime, + uint64 size, + uint64 mtime) { string id = Checksum.compute_for_string (ChecksumType.MD5, file.get_uri ()); unowned Gst.StreamInformation audio = null; @@ -54,51 +53,48 @@ public class Rygel.MediaExport.MediaExportItem : Rygel.MediaItem { if (video != null) { if (audio == null && video.streamtype == Gst.StreamType.IMAGE) { - return new MediaExportItem.photo ( - parent, - id, - file, - dlna_info, - (Gst.StreamVideoInformation) video, - mime, - size, - mtime); + return new Item.photo (parent, + id, + file, + dlna_info, + (Gst.StreamVideoInformation) video, + mime, + size, + mtime); } else { - return new MediaExportItem.video ( - parent, - id, - file, - dlna_info, - (Gst.StreamVideoInformation) video, - (Gst.StreamAudioInformation) audio, - mime, - size, - mtime); + return new Item.video (parent, + id, + file, + dlna_info, + (Gst.StreamVideoInformation) video, + (Gst.StreamAudioInformation) audio, + mime, + size, + mtime); } } else if (audio != null) { - return new MediaExportItem.audio ( - parent, - id, - file, - dlna_info, - (Gst.StreamAudioInformation) audio, - mime, - size, - mtime); + return new Item.audio (parent, + id, + file, + dlna_info, + (Gst.StreamAudioInformation) audio, + mime, + size, + mtime); } else { return null; } } - private MediaExportItem.video (MediaContainer parent, - string id, - File file, - GUPnP.DLNAInformation dlna_info, - Gst.StreamVideoInformation? video, - Gst.StreamAudioInformation? audio, - string mime, - uint64 size, - uint64 mtime) { + private Item.video (MediaContainer parent, + string id, + File file, + GUPnP.DLNAInformation dlna_info, + Gst.StreamVideoInformation? video, + Gst.StreamAudioInformation? audio, + string mime, + uint64 size, + uint64 mtime) { this (parent, id, file, @@ -123,14 +119,14 @@ public class Rygel.MediaExport.MediaExportItem : Rygel.MediaItem { this.sample_freq = (int) audio.sample_rate; } - private MediaExportItem.photo (MediaContainer parent, - string id, - File file, - GUPnP.DLNAInformation dlna_info, - Gst.StreamVideoInformation? video, - string mime, - uint64 size, - uint64 mtime) { + private Item.photo (MediaContainer parent, + string id, + File file, + GUPnP.DLNAInformation dlna_info, + Gst.StreamVideoInformation? video, + string mime, + uint64 size, + uint64 mtime) { this (parent, id, file, @@ -145,14 +141,14 @@ public class Rygel.MediaExport.MediaExportItem : Rygel.MediaItem { this.color_depth = (int) video.depth; } - private MediaExportItem.audio (MediaContainer parent, - string id, - File file, - GUPnP.DLNAInformation dlna_info, - Gst.StreamAudioInformation? audio, - string mime, - uint64 size, - uint64 mtime) { + private Item.audio (MediaContainer parent, + string id, + File file, + GUPnP.DLNAInformation dlna_info, + Gst.StreamAudioInformation? audio, + string mime, + uint64 size, + uint64 mtime) { this (parent, id, file, @@ -166,14 +162,14 @@ public class Rygel.MediaExport.MediaExportItem : Rygel.MediaItem { this.sample_freq = (int) audio.sample_rate; } - private MediaExportItem (MediaContainer parent, - string id, - File file, - GUPnP.DLNAInformation dlna_info, - string mime, - uint64 size, - uint64 mtime, - string upnp_class) { + private Item (MediaContainer parent, + string id, + File file, + GUPnP.DLNAInformation dlna_info, + string mime, + uint64 size, + uint64 mtime, + string upnp_class) { string title = null; if (dlna_info.info.tags == null || -- 2.7.4