server: Add skeleton playlist handler
authorJens Georg <jensg@openismus.com>
Thu, 22 Nov 2012 10:32:37 +0000 (11:32 +0100)
committerJens Georg <jensg@openismus.com>
Thu, 22 Nov 2012 20:16:42 +0000 (21:16 +0100)
src/librygel-server/filelist.am
src/librygel-server/rygel-http-get.vala
src/librygel-server/rygel-http-playlist-handler.vala [new file with mode: 0644]
tests/rygel-http-get-test.vala

index 2080398..ce9158f 100644 (file)
@@ -40,6 +40,7 @@ LIBRYGEL_SERVER_NONVAPI_SOURCE_FILES = \
        rygel-http-get-handler.vala \
        rygel-http-get.vala \
        rygel-http-identity-handler.vala \
+       rygel-http-playlist-handler.vala \
        rygel-http-item-uri.vala \
        rygel-http-post.vala \
        rygel-http-request.vala \
index 00a6a2a..4a8feb1 100644 (file)
@@ -66,6 +66,10 @@ internal class Rygel.HTTPGet : HTTPRequest {
                                                      this.cancellable);
         }
 
+        if (uri.playlist_format != null) {
+            this.handler = new HTTPPlaylistHandler (this.cancellable);
+        }
+
         if (this.handler == null) {
             this.handler = new HTTPIdentityHandler (this.cancellable);
         }
diff --git a/src/librygel-server/rygel-http-playlist-handler.vala b/src/librygel-server/rygel-http-playlist-handler.vala
new file mode 100644 (file)
index 0000000..915d143
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * Author: Jens Georg <jensg@openismus.com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+using GUPnP;
+
+internal class Rygel.HTTPPlaylistHandler : Rygel.HTTPGetHandler {
+    public HTTPPlaylistHandler (Cancellable? cancellable) {
+        this.cancellable = cancellable;
+    }
+
+    public override HTTPResponse render_body (HTTPGet request)
+                                              throws HTTPRequestError {
+        throw new HTTPRequestError.NOT_FOUND ("Not implemented yet");
+    }
+
+    protected override DIDLLiteResource add_resource (DIDLLiteItem didl_item,
+                                                      HTTPGet      request) {
+        // TODO: Implement
+        return null as DIDLLiteResource;
+    }
+}
index 3c93ceb..3eb9cda 100644 (file)
@@ -373,6 +373,10 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
     public HTTPIdentityHandler (Cancellable cancellable) {}
 }
 
+internal class Rygel.HTTPPlaylistHandler : Rygel.HTTPGetHandler {
+    public HTTPPlaylistHandler (Cancellable cancellable) {}
+}
+
 public abstract class Rygel.MediaItem : Rygel.MediaObject {
     public long size = 1024;
     public ArrayList<Subtitle> subtitles = new ArrayList<Subtitle> ();