rygel r370 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r370 - trunk/src/rygel
- Date: Thu, 25 Dec 2008 11:59:53 +0000 (UTC)
Author: zeeshanak
Date: Thu Dec 25 11:59:53 2008
New Revision: 370
URL: http://svn.gnome.org/viewvc/rygel?rev=370&view=rev
Log:
Use ID of MediaItem instead of URI in the proxy URIs.
On getting an HTTP request for an item, Streamer will emit a signal to get
the MediaItem instance requested.
Modified:
trunk/src/rygel/rygel-media-item.vala
trunk/src/rygel/rygel-streamer.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:53 2008
@@ -170,7 +170,7 @@
DIDLLiteResource res = orig_res;
// Then modify the URI and protocol
- string *uri = this.streamer.create_http_uri_for_uri (res.uri);
+ string *uri = this.streamer.create_http_uri_for_item (this);
res.uri = uri;
res.protocol = "http-get";
Modified: trunk/src/rygel/rygel-streamer.vala
==============================================================================
--- trunk/src/rygel/rygel-streamer.vala (original)
+++ trunk/src/rygel/rygel-streamer.vala Thu Dec 25 11:59:53 2008
@@ -34,6 +34,8 @@
public signal void stream_available (Rygel.Stream stream,
string path);
+ public signal void item_requested (string item_id,
+ out MediaItem item);
public Streamer (GUPnP.Context context, string name) {
this.context = context;
@@ -51,9 +53,9 @@
path);
}
- public string create_http_uri_for_uri (string uri) {
- string escaped = Uri.escape_string (uri, "", true);
- string query = "?uri=%s".printf (escaped);
+ public string create_http_uri_for_item (MediaItem item) {
+ string escaped = Uri.escape_string (item.id, "", true);
+ string query = "?itemid=%s".printf (escaped);
return create_uri_for_path (query);
}
@@ -89,20 +91,35 @@
string server_path,
HashTable<string,string>? query,
Soup.ClientContext soup_client) {
- string uri = null;
+ string item_id = null;
if (query != null) {
- uri = query.lookup ("uri");
+ item_id = query.lookup ("itemid");
}
- if (uri != null) {
- this.handle_uri_request (msg, uri);
+ if (item_id != null) {
+ this.handle_item_request (msg, item_id);
} else {
this.handle_path_request (msg, server_path);
}
}
- private void handle_uri_request (Soup.Message msg,
- string uri) {
+ private void handle_item_request (Soup.Message msg,
+ string item_id) {
+ MediaItem item;
+
+ // Signal the requestion for an item
+ this.item_requested (item_id, out item);
+ if (item == null) {
+ warning ("Requested item '%s' not found\n", item_id);
+ return;
+ }
+
+ string uri = item.res.uri;
+ if (uri == null) {
+ warning ("Requested item '%s' didn't provide a URI\n", item_id);
+ return;
+ }
+
// Create to Gst source that can handle the URI
var src = Element.make_from_uri (URIType.SRC, uri, null);
if (src == null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]