From: Zeeshan Ali (Khattak) Date: Tue, 3 Aug 2010 13:13:28 +0000 (+0300) Subject: core,plugins: Don't pass ContentDir to plugins X-Git-Tag: RYGEL_0_7_4~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef7e6d2a41439061fcb07d559b4626dcc1215716;p=profile%2Fivi%2Frygel.git core,plugins: Don't pass ContentDir to plugins Instead of ContentDirectory, pass the associated GUPnP.Context to MediaServer plugins when requesting their root containers. --- diff --git a/src/plugins/external/rygel-external-plugin.vala b/src/plugins/external/rygel-external-plugin.vala index c9539cd..641985b 100644 --- a/src/plugins/external/rygel-external-plugin.vala +++ b/src/plugins/external/rygel-external-plugin.vala @@ -51,15 +51,14 @@ public class Rygel.External.Plugin : Rygel.MediaServerPlugin { } } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return new Container ("0", this.title, this.child_count, this.searchable, this.service_name, this.root_object, - content_dir.context.host_ip, + context.host_ip, null); } } diff --git a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala index 10a59b3..5c531b1 100644 --- a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala +++ b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala @@ -34,8 +34,7 @@ public class Rygel.GstLaunch.Plugin : Rygel.MediaServerPlugin { base ("GstLaunch", "Gst Launch"); } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return new RootContainer (this.title); } } diff --git a/src/plugins/media-export/rygel-media-export-plugin.vala b/src/plugins/media-export/rygel-media-export-plugin.vala index 5e93017..467c003 100644 --- a/src/plugins/media-export/rygel-media-export-plugin.vala +++ b/src/plugins/media-export/rygel-media-export-plugin.vala @@ -38,8 +38,7 @@ public class Rygel.MediaExport.Plugin : Rygel.MediaServerPlugin { base ("MediaExport", _("@REALNAME@'s media")); } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return RootContainer.get_instance (); } } diff --git a/src/plugins/mediathek/rygel-mediathek-plugin.vala b/src/plugins/mediathek/rygel-mediathek-plugin.vala index 86f7da2..db78eee 100644 --- a/src/plugins/mediathek/rygel-mediathek-plugin.vala +++ b/src/plugins/mediathek/rygel-mediathek-plugin.vala @@ -34,8 +34,7 @@ public class Rygel.Mediathek.Plugin : Rygel.MediaServerPlugin { base ("ZDFMediathek", "ZDF Mediathek"); } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return RootContainer.get_instance (); } } diff --git a/src/plugins/test/rygel-test-plugin.vala b/src/plugins/test/rygel-test-plugin.vala index ad57e66..a55fea4 100644 --- a/src/plugins/test/rygel-test-plugin.vala +++ b/src/plugins/test/rygel-test-plugin.vala @@ -36,8 +36,7 @@ public class Rygel.Test.Plugin : Rygel.MediaServerPlugin { base ("Test", "Test Streams"); } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return new RootContainer (this.title); } } diff --git a/src/plugins/tracker/rygel-tracker-plugin.vala b/src/plugins/tracker/rygel-tracker-plugin.vala index b31f4a2..2a6739a 100644 --- a/src/plugins/tracker/rygel-tracker-plugin.vala +++ b/src/plugins/tracker/rygel-tracker-plugin.vala @@ -47,8 +47,7 @@ public class Rygel.Tracker.Plugin : Rygel.MediaServerPlugin { } } - public override MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public override MediaContainer? get_root_container (GUPnP.Context context) { return new RootContainer (this.title); } } diff --git a/src/rygel/rygel-content-directory.vala b/src/rygel/rygel-content-directory.vala index 9fa0752..a29e2a0 100644 --- a/src/rygel/rygel-content-directory.vala +++ b/src/rygel/rygel-content-directory.vala @@ -70,7 +70,7 @@ public class Rygel.ContentDirectory: Service { var plugin = this.root_device.resource_factory as MediaServerPlugin; - this.root_container = plugin.get_root_container (this); + this.root_container = plugin.get_root_container (this.context); try { this.http_server = new HTTPServer (this, plugin.name); diff --git a/src/rygel/rygel-media-server-plugin.vala b/src/rygel/rygel-media-server-plugin.vala index 9aa10bf..2eac2b0 100644 --- a/src/rygel/rygel-media-server-plugin.vala +++ b/src/rygel/rygel-media-server-plugin.vala @@ -52,8 +52,7 @@ public class Rygel.MediaServerPlugin : Rygel.Plugin { this.add_resource (resource_info); } - public virtual MediaContainer? get_root_container ( - ContentDirectory content_dir) { + public virtual MediaContainer? get_root_container (GUPnP.Context context) { return null; } }