[rygel] core: Always pass src element to GstResponse
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Always pass src element to GstResponse
- Date: Thu, 7 Apr 2011 23:22:24 +0000 (UTC)
commit fe163993d9b32f6332f2fffe7c8560bf46138442
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Apr 4 22:37:54 2011 +0300
core: Always pass src element to GstResponse
Now its always the user (instantiator) of GstResponse that creates the
gstreamer source element for it.
src/rygel/rygel-http-gst-response.vala | 10 +---------
src/rygel/rygel-http-identity-handler.vala | 9 ++++++++-
tests/rygel-http-gst-response-test.vala | 3 ++-
3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/rygel/rygel-http-gst-response.vala b/src/rygel/rygel-http-gst-response.vala
index 0fa810c..e75a8cd 100644
--- a/src/rygel/rygel-http-gst-response.vala
+++ b/src/rygel/rygel-http-gst-response.vala
@@ -32,16 +32,8 @@ internal class Rygel.HTTPGstResponse : Rygel.HTTPResponse {
public HTTPGstResponse (HTTPGet request,
HTTPGetHandler request_handler,
- Element? gst_src = null) throws Error {
+ Element src) throws Error {
base (request, request_handler, false);
- var src = gst_src;
- if (src == null) {
- src = request.item.create_stream_source ();
-
- if (src == null) {
- throw new HTTPRequestError.NOT_FOUND (_("Not found"));
- }
- }
this.seek = request.seek;
this.prepare_pipeline ("RygelHTTPGstResponse", src);
diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala
index 00dee0b..fbe4cf3 100644
--- a/src/rygel/rygel-http-identity-handler.vala
+++ b/src/rygel/rygel-http-identity-handler.vala
@@ -22,6 +22,7 @@
*/
using GUPnP;
+using Gst;
// An HTTP request handler that passes the item content through as is.
internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
@@ -78,7 +79,13 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
!(request.item.is_live_stream ())) {
return new HTTPSeekableResponse (request, this);
} else {
- return new HTTPGstResponse (request, this);
+ var src = request.item.create_stream_source ();
+
+ if (src == null) {
+ throw new HTTPRequestError.NOT_FOUND (_("Not found"));
+ }
+
+ return new HTTPGstResponse (request, this, src);
}
}
}
diff --git a/tests/rygel-http-gst-response-test.vala b/tests/rygel-http-gst-response-test.vala
index 8032ed2..f7834d2 100644
--- a/tests/rygel-http-gst-response-test.vala
+++ b/tests/rygel-http-gst-response-test.vala
@@ -76,8 +76,9 @@ public class Rygel.HTTPGstResponseTest : Rygel.HTTPResponseTest {
seek,
this.cancellable);
var handler = new HTTPGetHandler (this.cancellable);
+ var src = this.item.create_stream_source ();
- return new HTTPGstResponse (request, handler);
+ return new HTTPGstResponse (request, handler, src);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]