rygel r362 - trunk/src/rygel



Author: zeeshanak
Date: Thu Dec 25 11:59:05 2008
New Revision: 362
URL: http://svn.gnome.org/viewvc/rygel?rev=362&view=rev

Log:
MediaItem adds transcoded resources to the DIDL.

ATM it's just the HTTP URI that the new Streamer API creates for us.

Modified:
   trunk/src/rygel/rygel-media-item.vala

Modified: trunk/src/rygel/rygel-media-item.vala
==============================================================================
--- trunk/src/rygel/rygel-media-item.vala	(original)
+++ trunk/src/rygel/rygel-media-item.vala	Thu Dec 25 11:59:05 2008
@@ -144,6 +144,12 @@
 
         didl_writer.add_res (res);
 
+        /* Now get the transcoded/proxy URIs */
+        var res_list = this.get_transcoded_resources (res);
+        foreach (DIDLLiteResource res in res_list) {
+            didl_writer.add_res (res);
+        }
+
         /* End of item */
         didl_writer.end_item ();
     }
@@ -161,4 +167,24 @@
                             ("Failed to probe protocol for URI %s", uri);
         }
     }
+
+    // FIXME: We only proxy URIs through our HTTP server for now
+    private List<DIDLLiteResource?>? get_transcoded_resources
+                                            (DIDLLiteResource orig_res) {
+        if (orig_res.protocol == "http-get")
+            return null;
+
+        List<DIDLLiteResource?> resources = new List<DIDLLiteResource?> ();
+        // Copy the original res first
+        DIDLLiteResource res = orig_res;
+
+        // Then modify the URI and protocol
+        string *uri = this.streamer.create_http_uri_for_uri (res.uri);
+        res.uri = uri;
+        res.protocol = "http-get";
+
+        resources.append (res);
+
+        return resources;
+    }
 }



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