rygel r442 - in trunk/src: plugins/dvb plugins/test plugins/tracker rygel



Author: zeeshanak
Date: Sun Jan 18 19:27:11 2009
New Revision: 442
URL: http://svn.gnome.org/viewvc/rygel?rev=442&view=rev

Log:
Rename Streamer to HTTPServer.

Added:
   trunk/src/rygel/rygel-http-server.vala
      - copied, changed from r441, /trunk/src/rygel/rygel-streamer.vala
Removed:
   trunk/src/rygel/rygel-streamer.vala
Modified:
   trunk/src/plugins/dvb/rygel-dvb-channel-group.vala
   trunk/src/plugins/dvb/rygel-dvb-channel.vala
   trunk/src/plugins/dvb/rygel-dvb-content-dir.vala
   trunk/src/plugins/test/rygel-test-audio-item.vala
   trunk/src/plugins/test/rygel-test-content-dir.vala
   trunk/src/plugins/test/rygel-test-item.vala
   trunk/src/plugins/test/rygel-test-video-item.vala
   trunk/src/plugins/tracker/rygel-media-tracker.vala
   trunk/src/plugins/tracker/rygel-tracker-container.vala
   trunk/src/plugins/tracker/rygel-tracker-item.vala
   trunk/src/rygel/Makefile.am
   trunk/src/rygel/rygel-media-item.vala

Modified: trunk/src/plugins/dvb/rygel-dvb-channel-group.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-channel-group.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-channel-group.vala	Sun Jan 18 19:27:11 2009
@@ -43,7 +43,7 @@
     /* Hashmap of (UPnP) IDs to channels */
     private HashMap<string, DVBChannel> channels;
 
-    public Streamer streamer;
+    public HTTPServer http_server;
 
     private uint gid; /* The DVB Daemon Device Group ID */
 
@@ -51,7 +51,7 @@
                             string              title,
                             string              parent_id,
                             dynamic DBus.Object channel_list,
-                            Streamer            streamer) {
+                            HTTPServer          http_server) {
         base (GID_PREFIX + gid.to_string (), // UPnP ID
               parent_id,
               title,
@@ -59,11 +59,11 @@
         this.gid = gid;
         //this.upnp_class = "object.container.channelGroup";
         this.channel_list = channel_list;
-        this.streamer = streamer;
+        this.http_server = http_server;
 
         this.fetch_channels ();
 
-        this.streamer.item_requested += this.on_item_requested;
+        this.http_server.item_requested += this.on_item_requested;
     }
 
     public uint add_channels (DIDLLiteWriter didl_writer,
@@ -110,7 +110,7 @@
                 var channel = new DVBChannel (channel_id,
                                               this.id,
                                               channel_list,
-                                              streamer);
+                                              http_server);
                 this.channels.set (channel.id, channel);
             } catch (GLib.Error error) {
                 critical ("Failed to create DVB Channel object: %s",
@@ -121,7 +121,7 @@
         this.child_count = this.channels.size;
     }
 
-    private void on_item_requested (Streamer      streamer,
+    private void on_item_requested (HTTPServer    http_server,
                                     string        item_id,
                                     out MediaItem item) {
         var channel = this.find_channel (item_id);

Modified: trunk/src/plugins/dvb/rygel-dvb-channel.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-channel.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-channel.vala	Sun Jan 18 19:27:11 2009
@@ -39,14 +39,14 @@
     public DVBChannel (uint                cid,
                        string              parent_id,
                        dynamic DBus.Object channel_list,
-                       Streamer            streamer) throws GLib.Error {
+                       HTTPServer          http_server) throws GLib.Error {
         string id = parent_id + ":" + cid.to_string (); /* UPnP ID */
 
         base (id,
               parent_id,
               "Unknown",        /* Title Unknown at this point */
               "Unknown",        /* UPnP Class Unknown at this point */
-              streamer);
+              http_server);
 
         this.cid = cid;
         this.channel_list = channel_list;

Modified: trunk/src/plugins/dvb/rygel-dvb-content-dir.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-content-dir.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-content-dir.vala	Sun Jan 18 19:27:11 2009
@@ -69,7 +69,7 @@
             return;
         }
 
-        Streamer streamer = new Streamer (this.context, "DVB");
+        HTTPServer http_server = new HTTPServer (this.context, "DVB");
 
         this.groups = new List<DVBChannelGroup> ();
         foreach (uint group_id in dev_groups) {
@@ -97,7 +97,7 @@
                                                      group_name,
                                                      this.root_container.id,
                                                      channel_list,
-                                                     streamer));
+                                                     http_server));
         }
     }
 

Modified: trunk/src/plugins/test/rygel-test-audio-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-audio-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-audio-item.vala	Sun Jan 18 19:27:11 2009
@@ -35,16 +35,16 @@
 public class Rygel.TestAudioItem : Rygel.TestItem {
     const string TEST_MIMETYPE = "audio/x-wav";
 
-    public TestAudioItem (string   id,
-                          string   parent_id,
-                          string   title,
-                          Streamer streamer) {
+    public TestAudioItem (string     id,
+                          string     parent_id,
+                          string     title,
+                          HTTPServer http_server) {
         base (id,
               parent_id,
               title,
               TEST_MIMETYPE,
               MediaItem.AUDIO_CLASS,
-              streamer);
+              http_server);
     }
 
     public override Element create_gst_source () throws Error {

Modified: trunk/src/plugins/test/rygel-test-content-dir.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-content-dir.vala	(original)
+++ trunk/src/plugins/test/rygel-test-content-dir.vala	Sun Jan 18 19:27:11 2009
@@ -34,27 +34,27 @@
 public class Rygel.TestContentDir : ContentDirectory {
     private List<MediaItem> items;
 
-    private Streamer streamer;
+    private HTTPServer http_server;
 
     /* Pubic methods */
     public override void constructed () {
         // Chain-up to base first
         base.constructed ();
 
-        this.streamer = new Streamer (context, "RygelTest");
+        this.http_server = new HTTPServer (context, "RygelTest");
 
-        this.streamer.item_requested += this.on_item_requested;
-        this.streamer.need_stream_source += this.on_need_stream_source;
+        this.http_server.item_requested += this.on_item_requested;
+        this.http_server.need_stream_source += this.on_need_stream_source;
 
         this.items = new List<MediaItem> ();
         this.items.append (new TestAudioItem ("sinewave",
                                               this.root_container.id,
                                               "Sine Wave",
-                                              this.streamer));
+                                              this.http_server));
         this.items.append (new TestVideoItem ("smtpe",
                                               this.root_container.id,
                                               "SMTPE",
-                                              this.streamer));
+                                              this.http_server));
 
         // Now we know how many top-level items we have
         this.root_container.child_count = this.items.length ();
@@ -96,13 +96,13 @@
         return item;
     }
 
-    private void on_item_requested (Streamer      streamer,
+    private void on_item_requested (HTTPServer    http_server,
                                     string        item_id,
                                     out MediaItem item) {
         item = this.find_item_by_id (item_id);
     }
 
-    private void on_need_stream_source (Streamer    streamer,
+    private void on_need_stream_source (HTTPServer  http_server,
                                         MediaItem   item,
                                         out Element src) {
         try {

Modified: trunk/src/plugins/test/rygel-test-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-item.vala	Sun Jan 18 19:27:11 2009
@@ -34,13 +34,13 @@
 public abstract class Rygel.TestItem : Rygel.MediaItem {
     const string TEST_AUTHOR = "Zeeshan Ali (Khattak)";
 
-    public TestItem (string   id,
-                     string   parent_id,
-                     string   title,
-                     string   mime,
-                     string   upnp_class,
-                     Streamer streamer) {
-        base (id, parent_id, title, upnp_class, streamer);
+    public TestItem (string     id,
+                     string     parent_id,
+                     string     title,
+                     string     mime,
+                     string     upnp_class,
+                     HTTPServer http_server) {
+        base (id, parent_id, title, upnp_class, http_server);
 
         this.res.mime_type = mime;
         this.author = TEST_AUTHOR;

Modified: trunk/src/plugins/test/rygel-test-video-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-video-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-video-item.vala	Sun Jan 18 19:27:11 2009
@@ -35,16 +35,16 @@
 public class Rygel.TestVideoItem : Rygel.TestItem {
     const string TEST_MIMETYPE = "video/mpeg";
 
-    public TestVideoItem (string   id,
-                          string   parent_id,
-                          string   title,
-                          Streamer streamer) {
+    public TestVideoItem (string     id,
+                          string     parent_id,
+                          string     title,
+                          HTTPServer http_server) {
         base (id,
               parent_id,
               title,
               TEST_MIMETYPE,
               MediaItem.VIDEO_CLASS,
-              streamer);
+              http_server);
     }
 
     public override Element create_gst_source () throws Error {

Modified: trunk/src/plugins/tracker/rygel-media-tracker.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-media-tracker.vala	(original)
+++ trunk/src/plugins/tracker/rygel-media-tracker.vala	Sun Jan 18 19:27:11 2009
@@ -37,16 +37,16 @@
     private List<TrackerContainer> containers;
 
     private SearchCriteriaParser search_parser;
-    private Streamer streamer;
+    private HTTPServer http_server;
 
     /* Pubic methods */
     public override void constructed () {
         // Chain-up to base first
         base.constructed ();
 
-        this.streamer = new Streamer (this.context, "Tracker");
+        this.http_server = new HTTPServer (this.context, "Tracker");
 
-        this.streamer.item_requested += on_item_requested;
+        this.http_server.item_requested += on_item_requested;
 
         this.containers = new List<TrackerContainer> ();
         this.containers.append
@@ -55,21 +55,21 @@
                                                "All Images",
                                                "Images",
                                                MediaItem.IMAGE_CLASS,
-                                               streamer));
+                                               http_server));
         this.containers.append
                         (new TrackerContainer ("14",
                                                this.root_container.id,
                                                "All Music",
                                                "Music",
                                                MediaItem.MUSIC_CLASS,
-                                               streamer));
+                                               http_server));
         this.containers.append
                         (new TrackerContainer ("15",
                                                this.root_container.id,
                                                "All Videos",
                                                "Videos",
                                                MediaItem.VIDEO_CLASS,
-                                               streamer));
+                                               http_server));
 
         // Now we know how many top-level containers we have
         this.root_container.child_count = this.containers.length ();
@@ -183,7 +183,7 @@
         return container;
     }
 
-    private void on_item_requested (Streamer      streamer,
+    private void on_item_requested (HTTPServer    http_server,
                                     string        item_id,
                                     out MediaItem item) {
         TrackerContainer container = get_item_parent (item_id);

Modified: trunk/src/plugins/tracker/rygel-tracker-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-container.vala	Sun Jan 18 19:27:11 2009
@@ -44,7 +44,7 @@
     public static dynamic DBus.Object files;
     public static dynamic DBus.Object tracker;
 
-    public Streamer streamer;
+    public HTTPServer http_server;
     public string category;
 
     /* UPnP class of items under this container */
@@ -74,17 +74,17 @@
                                            TrackerContainer.TRACKER_IFACE);
     }
 
-    public TrackerContainer (string  id,
-                             string  parent_id,
-                             string  title,
-                             string  category,
-                             string  child_class,
-                             Streamer streamer) {
+    public TrackerContainer (string     id,
+                             string     parent_id,
+                             string     title,
+                             string     category,
+                             string     child_class,
+                             HTTPServer http_server) {
         base (id, parent_id, title, 0);
 
         this.category = category;
         this.child_class = child_class;
-        this.streamer = streamer;
+        this.http_server = http_server;
     }
 
     public override void serialize (DIDLLiteWriter didl_writer)

Modified: trunk/src/plugins/tracker/rygel-tracker-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-item.vala	Sun Jan 18 19:27:11 2009
@@ -37,7 +37,7 @@
     public TrackerItem (string           id,
                         string           path,
                         TrackerContainer parent) throws GLib.Error {
-        base (id, parent.id, "", parent.child_class, parent.streamer);
+        base (id, parent.id, "", parent.child_class, parent.http_server);
 
         this.path = path;
         this.parent = parent;

Modified: trunk/src/rygel/Makefile.am
==============================================================================
--- trunk/src/rygel/Makefile.am	(original)
+++ trunk/src/rygel/Makefile.am	Sun Jan 18 19:27:11 2009
@@ -35,8 +35,8 @@
 		rygel-plugin.c \
 		rygel-plugin-loader.h \
 		rygel-plugin-loader.c \
-                rygel-streamer.c \
-                rygel-streamer.h \
+                rygel-http-server.c \
+                rygel-http-server.h \
                 rygel-stream.c \
                 rygel-stream.h \
                 rygel-gst-stream.c \
@@ -75,12 +75,12 @@
 		rygel-plugin-loader.h \
 		rygel-plugin-loader.c \
 		rygel-plugin-loader.vala \
-                rygel-streamer.c \
-                rygel-streamer.h \
-                rygel-stream.c \
-                rygel-stream.h \
-                rygel-gst-stream.c \
-                rygel-gst-stream.h \
+		rygel-http-server.c \
+		rygel-http-server.h \
+		rygel-stream.c \
+		rygel-stream.h \
+		rygel-gst-stream.c \
+		rygel-gst-stream.h \
 		rygel-resource-info.h \
 		rygel-resource-info.c \
 		rygel-icon-info.h \
@@ -118,9 +118,9 @@
 rygel-1.0.vapi: rygel-content-directory.vala \
 		rygel-connection-manager.vala \
 		rygel-media-receiver-registrar.vala \
-                rygel-streamer.vala \
-                rygel-stream.vala \
-                rygel-gst-stream.vala \
+		rygel-http-server.vala \
+		rygel-stream.vala \
+		rygel-gst-stream.vala \
 		rygel-resource-info.vala \
 		rygel-icon-info.vala \
 		rygel-plugin.vala \

Copied: trunk/src/rygel/rygel-http-server.vala (from r441, /trunk/src/rygel/rygel-streamer.vala)
==============================================================================
--- /trunk/src/rygel/rygel-streamer.vala	(original)
+++ trunk/src/rygel/rygel-http-server.vala	Sun Jan 18 19:27:11 2009
@@ -28,15 +28,15 @@
 using Gst;
 using GUPnP;
 
-public errordomain Rygel.StreamerError {
+public errordomain Rygel.HTTPServerError {
     UNACCEPTABLE = Soup.KnownStatusCode.NOT_ACCEPTABLE,
     INVALID_RANGE = Soup.KnownStatusCode.BAD_REQUEST,
     OUT_OF_RANGE = Soup.KnownStatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
 }
 
-public class Rygel.Streamer : GLib.Object {
-    private const string SERVER_PATH_PREFIX = "/RygelStreamer";
-    private string server_path_root;
+public class Rygel.HTTPServer : GLib.Object {
+    private const string SERVER_PATH_PREFIX = "/RygelHTTPServer";
+    private string path_root;
 
     private GUPnP.Context context;
     private List<GstStream> streams;
@@ -46,19 +46,19 @@
     public signal void item_requested (string item_id,
                                        out MediaItem item);
 
-    public Streamer (GUPnP.Context context, string name) {
+    public HTTPServer (GUPnP.Context context, string name) {
         this.context = context;
         this.streams = new List<GstStream> ();
 
-        this.server_path_root = SERVER_PATH_PREFIX + "/" + name;
+        this.path_root = SERVER_PATH_PREFIX + "/" + name;
 
-        context.server.add_handler (this.server_path_root, server_handler);
+        context.server.add_handler (this.path_root, server_handler);
     }
 
     private string create_uri_for_path (string path) {
         return "http://%s:%u%s%s".printf (this.context.host_ip,
                                           this.context.port,
-                                          this.server_path_root,
+                                          this.path_root,
                                           path);
     }
 
@@ -126,7 +126,7 @@
 
         try {
             seek = this.parse_range (msg, item);
-        } catch (StreamerError err) {
+        } catch (HTTPServerError err) {
             warning ("%s", err.message);
             msg.set_status (err.code);
             return;
@@ -278,12 +278,12 @@
      * @length to the requested length (left unchanged if none specified).
      *
      * Both @offset and @length are expected to be initialised to their default
-     * values. Throws a #StreamerError in case of error.
+     * values. Throws a #HTTPServerError in case of error.
      *
      * Returns %true a range header was found, false otherwise. */
     private Seek? parse_range (Soup.Message message,
-                                MediaItem    item)
-                                throws StreamerError {
+                                MediaItem   item)
+                                throws      HTTPServerError {
             string range;
             string[] range_tokens;
             Seek seek = null;
@@ -295,14 +295,14 @@
 
             // We have a Range header. Parse.
             if (!range.has_prefix ("bytes=")) {
-                throw new StreamerError.INVALID_RANGE ("Invalid Range '%s'",
+                throw new HTTPServerError.INVALID_RANGE ("Invalid Range '%s'",
                                                        range);
             }
 
             range_tokens = range.offset (6).split ("-", 2);
 
             if (range_tokens[0] == null || range_tokens[1] == null) {
-                throw new StreamerError.INVALID_RANGE ("Invalid Range '%s'",
+                throw new HTTPServerError.INVALID_RANGE ("Invalid Range '%s'",
                                                        range);
             }
 
@@ -313,7 +313,7 @@
             if (first_byte[0].isdigit ()) {
                 seek.start = first_byte.to_int64 ();
             } else if (first_byte  != "") {
-                throw new StreamerError.INVALID_RANGE ("Invalid Range '%s'",
+                throw new HTTPServerError.INVALID_RANGE ("Invalid Range '%s'",
                                                        range);
             }
 
@@ -322,7 +322,7 @@
             if (last_byte[0].isdigit ()) {
                 seek.stop = last_byte.to_int64 ();
             } else if (last_byte  != "") {
-                throw new StreamerError.INVALID_RANGE ("Invalid Range '%s'",
+                throw new HTTPServerError.INVALID_RANGE ("Invalid Range '%s'",
                                                        range);
             }
 
@@ -330,7 +330,7 @@
                 // shouldn't go beyond actual length of media
                 if (seek.start > item.res.size ||
                     seek.length > item.res.size) {
-                    throw new StreamerError.OUT_OF_RANGE (
+                    throw new HTTPServerError.OUT_OF_RANGE (
                             "Range '%s' not setsifiable", range);
                 }
 
@@ -343,7 +343,7 @@
                 // an error. Just don't seek.
                 return null;
             } else {
-                throw new StreamerError.UNACCEPTABLE (
+                throw new HTTPServerError.UNACCEPTABLE (
                             "Partial download not applicable for item %s",
                             item.id);
             }

Modified: trunk/src/rygel/rygel-media-item.vala
==============================================================================
--- trunk/src/rygel/rygel-media-item.vala	(original)
+++ trunk/src/rygel/rygel-media-item.vala	Sun Jan 18 19:27:11 2009
@@ -47,18 +47,18 @@
 
     public int track_number = -1;
 
-    protected Rygel.Streamer streamer;
+    protected Rygel.HTTPServer http_server;
 
-    public MediaItem (string   id,
-                      string   parent_id,
-                      string   title,
-                      string   upnp_class,
-                      Streamer streamer) {
+    public MediaItem (string     id,
+                      string     parent_id,
+                      string     title,
+                      string     upnp_class,
+                      HTTPServer http_server) {
         this.id = id;
         this.parent_id = parent_id;
         this.title = title;
         this.upnp_class = upnp_class;
-        this.streamer = streamer;
+        this.http_server = http_server;
 
         this.res = DIDLLiteResource ();
         this.res.reset ();
@@ -181,7 +181,7 @@
         DIDLLiteResource res = orig_res;
 
         // Then modify the URI and protocol
-        res.uri = this.streamer.create_http_uri_for_item (this);
+        res.uri = this.http_server.create_http_uri_for_item (this);
         res.protocol = "http-get";
 
         resources.append (res);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]