[rygel] core: Minor non-functional fixes
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Minor non-functional fixes
- Date: Wed, 26 Aug 2009 22:10:54 +0000 (UTC)
commit 7127cf3732a7599c50e3c3127a28867b348e9585
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Aug 26 23:01:07 2009 +0300
core: Minor non-functional fixes
Minor fixes related mostly to coding-style
src/rygel/rygel-identity-request-handler.vala | 11 ++++++-----
src/rygel/rygel-media-item.vala | 16 +++++++++-------
src/rygel/rygel-transcoder.vala | 10 +++++-----
3 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/src/rygel/rygel-identity-request-handler.vala b/src/rygel/rygel-identity-request-handler.vala
index acd62bb..1963248 100644
--- a/src/rygel/rygel-identity-request-handler.vala
+++ b/src/rygel/rygel-identity-request-handler.vala
@@ -28,8 +28,8 @@ internal class Rygel.IdentityRequestHandler : GLib.Object,
public IdentityRequestHandler () {}
public virtual void add_response_headers (HTTPRequest request)
- throws HTTPRequestError {
- weak MediaItem item = request.item;
+ throws HTTPRequestError {
+ var item = request.item;
request.msg.response_headers.append ("Content-Type", item.mime_type);
if (item.size >= 0) {
@@ -48,15 +48,15 @@ internal class Rygel.IdentityRequestHandler : GLib.Object,
}
public virtual HTTPResponse render_body (HTTPRequest request)
- throws HTTPRequestError {
- weak MediaItem item = request.item;
+ throws HTTPRequestError {
+ var item = request.item;
if (item.should_stream ()) {
Gst.Element src = item.create_stream_source ();
-
if (src == null) {
throw new HTTPRequestError.NOT_FOUND ("Not found");
}
+
return new LiveResponse (request.server,
request.msg,
"RygelLiveResponse",
@@ -68,6 +68,7 @@ internal class Rygel.IdentityRequestHandler : GLib.Object,
"Requested item '%s' didn't provide a URI\n",
item.id);
}
+
return new SeekableResponse (request.server,
request.msg,
item.uris.get (0),
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index f179d16..15db4d6 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -22,6 +22,7 @@
using GUPnP;
using Gee;
+using Gst;
private errordomain Rygel.MediaItemError {
BAD_URI
@@ -73,23 +74,24 @@ public class Rygel.MediaItem : MediaObject {
}
// Live media items need to provide a nice working implementation of this
- // method if they can/do no provide a valid URI
- public virtual Gst.Element? create_stream_source () {
- dynamic Gst.Element src = null;
+ // method if they can/do not provide a valid URI
+ public virtual Element? create_stream_source () {
+ dynamic Element src = null;
if (this.uris.size != 0) {
- src = Gst.Element.make_from_uri (
- Gst.URIType.SRC, this.uris.get(0),null);
+ src = Element.make_from_uri (URIType.SRC, this.uris.get (0), null);
}
+
if (src != null) {
- weak ObjectClass cls = (ObjectClass) src.get_type().class_peek();
+ var object_class = (ObjectClass) src.get_type ().class_peek ();
// For rtspsrc since some RTSP sources takes a while to start
// transmitting
- if (cls.find_property ("tcp-timeout") != null) {
+ if (object_class.find_property ("tcp-timeout") != null) {
src.tcp_timeout = (int64) 60000000;
}
}
+
return src;
}
diff --git a/src/rygel/rygel-transcoder.vala b/src/rygel/rygel-transcoder.vala
index ed9451e..593e9bd 100644
--- a/src/rygel/rygel-transcoder.vala
+++ b/src/rygel/rygel-transcoder.vala
@@ -105,7 +105,7 @@ internal abstract class Rygel.Transcoder : GLib.Object, HTTPRequestHandler {
}
public virtual void add_response_headers (HTTPRequest request)
- throws HTTPRequestError {
+ throws HTTPRequestError {
request.msg.response_headers.append ("Content-Type", this.mime_type);
if (request.time_range != null) {
request.time_range.add_response_header(request.msg);
@@ -113,15 +113,15 @@ internal abstract class Rygel.Transcoder : GLib.Object, HTTPRequestHandler {
}
public virtual HTTPResponse render_body (HTTPRequest request)
- throws HTTPRequestError {
- weak MediaItem item = request.item;
- Element src = item.create_stream_source ();
-
+ throws HTTPRequestError {
+ var item = request.item;
+ var src = item.create_stream_source ();
if (src == null) {
throw new HTTPRequestError.NOT_FOUND ("Not found");
}
src = this.create_source (item, src);
+
return new LiveResponse (request.server,
request.msg,
"RygelLiveResponse",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]