From: Zeeshan Ali (Khattak) Date: Sat, 31 Jul 2010 23:28:55 +0000 (+0300) Subject: core,gst-plugins: Special MediaRenderer plugin constructor X-Git-Tag: RYGEL_0_7_3~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ebbbe95e563748bd07f3775da691fc67cec1fde;p=profile%2Fivi%2Frygel.git core,gst-plugins: Special MediaRenderer plugin constructor Convenient constructor for MediaRenderer plugins. --- diff --git a/src/plugins/gst-renderer/rygel-gst-renderer-plugin.vala b/src/plugins/gst-renderer/rygel-gst-renderer-plugin.vala index c1eddba..f970956 100644 --- a/src/plugins/gst-renderer/rygel-gst-renderer-plugin.vala +++ b/src/plugins/gst-renderer/rygel-gst-renderer-plugin.vala @@ -26,30 +26,12 @@ using Rygel; using Gee; public void module_init (PluginLoader loader) { - string MEDIA_RENDERER_DESC_PATH = BuildConfig.DATA_DIR + - "/xml/MediaRenderer2.xml"; - - var plugin = new Plugin (MEDIA_RENDERER_DESC_PATH, - "GstRenderer", - _("GStreamer Renderer")); - - var resource = new ResourceInfo (ConnectionManager.UPNP_ID, - ConnectionManager.UPNP_TYPE, - ConnectionManager.DESCRIPTION_PATH, - typeof (GstRenderer.ConnectionManager)); - plugin.add_resource (resource); - - resource = new ResourceInfo (Rygel.AVTransport.UPNP_ID, - Rygel.AVTransport.UPNP_TYPE, - Rygel.AVTransport.DESCRIPTION_PATH, - typeof (GstRenderer.AVTransport)); - plugin.add_resource (resource); - - resource = new ResourceInfo (RenderingControl.UPNP_ID, - RenderingControl.UPNP_TYPE, - RenderingControl.DESCRIPTION_PATH, - typeof (GstRenderer.RenderingControl)); - plugin.add_resource (resource); + var plugin = new Plugin.MediaRenderer ( + "GstRenderer", + _("GStreamer Renderer"), + typeof (GstRenderer.ConnectionManager), + typeof (GstRenderer.AVTransport), + typeof (GstRenderer.RenderingControl)); loader.add_plugin (plugin); } diff --git a/src/rygel/rygel-plugin.vala b/src/rygel/rygel-plugin.vala index 864221f..72387ee 100644 --- a/src/rygel/rygel-plugin.vala +++ b/src/rygel/rygel-plugin.vala @@ -31,6 +31,9 @@ using GUPnP; public class Rygel.Plugin : GUPnP.ResourceFactory { private static const string MEDIA_SERVER_DESC_PATH = BuildConfig.DATA_DIR + "/xml/MediaServer2.xml"; + private static const string MEDIA_RENDERER_DESC_PATH = + BuildConfig.DATA_DIR + + "/xml/MediaRenderer2.xml"; private static const string ICON_BIG = "file://" + BuildConfig.BIG_ICON_DIR + @@ -121,6 +124,33 @@ public class Rygel.Plugin : GUPnP.ResourceFactory { this.add_resource (resource_info); } + public Plugin.MediaRenderer (string name, + string? title, + Type connection_manager_type, + Type av_transport_type, + Type rendering_control_type, + string? description = null) { + this (MEDIA_RENDERER_DESC_PATH, name, title, description); + + var resource = new ResourceInfo (ConnectionManager.UPNP_ID, + ConnectionManager.UPNP_TYPE, + ConnectionManager.DESCRIPTION_PATH, + connection_manager_type); + this.add_resource (resource); + + resource = new ResourceInfo (Rygel.AVTransport.UPNP_ID, + Rygel.AVTransport.UPNP_TYPE, + Rygel.AVTransport.DESCRIPTION_PATH, + av_transport_type); + this.add_resource (resource); + + resource = new ResourceInfo (RenderingControl.UPNP_ID, + RenderingControl.UPNP_TYPE, + RenderingControl.DESCRIPTION_PATH, + rendering_control_type); + this.add_resource (resource); + } + public void add_resource (ResourceInfo resource_info) { this.resource_infos.add (resource_info); this.register_resource_type (resource_info.upnp_type,