Rename GstStream to StreamingResponse.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 18 Jan 2009 19:27:22 +0000 (19:27 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 18 Jan 2009 19:27:22 +0000 (19:27 +0000)
svn path=/trunk/; revision=444

src/plugins/test/rygel-test-audio-item.vala
src/plugins/test/rygel-test-video-item.vala
src/rygel/Makefile.am
src/rygel/rygel-http-server.vala
src/rygel/rygel-streaming-response.vala [moved from src/rygel/rygel-gst-stream.vala with 93% similarity]

index b62184e..b6ca2bc 100644 (file)
@@ -54,7 +54,8 @@ public class Rygel.TestAudioItem : Rygel.TestItem {
         Element encoder = ElementFactory.make ("wavenc", null);
 
         if (src == null || encoder == null) {
-            throw new GstStreamError.MISSING_PLUGIN ("Required plugin missing");
+            throw new StreamingResponseError.MISSING_PLUGIN (
+                                    "Required plugin missing");
         }
 
         // Tell the source to behave like a live source
index 7dc2412..e0522a9 100644 (file)
@@ -55,7 +55,8 @@ public class Rygel.TestVideoItem : Rygel.TestItem {
         Element muxer = ElementFactory.make ("mpegtsmux", null);
 
         if (src == null || muxer == null || encoder == null) {
-            throw new GstStreamError.MISSING_PLUGIN ("Required plugin missing");
+            throw new StreamingResponseError.MISSING_PLUGIN (
+                                "Required plugin missing");
         }
 
         // Tell the source to behave like a live source
index 46da7db..d671770 100644 (file)
@@ -39,8 +39,8 @@ BUILT_SOURCES = rygel-1.0.vapi \
                 rygel-http-server.h \
                 rygel-http-response.c \
                 rygel-http-response.h \
-                rygel-gst-stream.c \
-                rygel-gst-stream.h \
+                rygel-streaming-response.c \
+                rygel-streaming-response.h \
                rygel-resource-info.h \
                rygel-resource-info.c \
                rygel-icon-info.h \
@@ -79,8 +79,8 @@ rygel_SOURCES = rygel-1.0.vapi \
                rygel-http-server.h \
                rygel-http-response.c \
                rygel-http-response.h \
-               rygel-gst-stream.c \
-               rygel-gst-stream.h \
+               rygel-streaming-response.c \
+               rygel-streaming-response.h \
                rygel-resource-info.h \
                rygel-resource-info.c \
                rygel-icon-info.h \
@@ -120,7 +120,7 @@ rygel-1.0.vapi: rygel-content-directory.vala \
                rygel-media-receiver-registrar.vala \
                rygel-http-server.vala \
                rygel-http-response.vala \
-               rygel-gst-stream.vala \
+               rygel-streaming-response.vala \
                rygel-resource-info.vala \
                rygel-icon-info.vala \
                rygel-plugin.vala \
index 779d885..832ddec 100644 (file)
@@ -39,7 +39,7 @@ public class Rygel.HTTPServer : GLib.Object {
     private string path_root;
 
     private GUPnP.Context context;
-    private List<GstStream> streams;
+    private List<StreamingResponse> responses;
 
     public signal void need_stream_source (MediaItem   item,
                                            out Element src);
@@ -48,7 +48,7 @@ public class Rygel.HTTPServer : GLib.Object {
 
     public HTTPServer (GUPnP.Context context, string name) {
         this.context = context;
-        this.streams = new List<GstStream> ();
+        this.responses = new List<StreamingResponse> ();
 
         this.path_root = SERVER_PATH_PREFIX + "/" + name;
 
@@ -71,19 +71,20 @@ public class Rygel.HTTPServer : GLib.Object {
 
     private void stream_from_gst_source (Element#     src,
                                          Soup.Message msg) throws Error {
-        GstStream stream = new GstStream (this.context.server,
-                                          msg,
-                                          "RygelGstStream",
-                                          src);
-        stream.start ();
-        stream.eos += on_eos;
-
-        this.streams.append (stream);
+        StreamingResponse response = new StreamingResponse (
+                                                this.context.server,
+                                                msg,
+                                                "RygelStreamingResponse",
+                                                src);
+        response.start ();
+        response.eos += on_eos;
+
+        this.responses.append (response);
     }
 
-    private void on_eos (GstStream stream) {
-        /* Remove the stream from our list. */
-        this.streams.remove (stream);
+    private void on_eos (StreamingResponse response) {
+        /* Remove the response from our list. */
+        this.responses.remove (response);
     }
 
     private void server_handler (Soup.Server               server,
@@ -136,7 +137,7 @@ public class Rygel.HTTPServer : GLib.Object {
         this.add_item_headers (msg, item, seek);
 
         if (msg.method == "HEAD") {
-            // Only headers requested, no need to stream contents
+            // Only headers requested, no need to send contents
             msg.set_status (Soup.KnownStatusCode.OK);
             return;
         }
similarity index 93%
rename from src/rygel/rygel-gst-stream.vala
rename to src/rygel/rygel-streaming-response.vala
index 322a436..4345218 100644 (file)
@@ -29,22 +29,22 @@ using GUPnP;
 using Gee;
 using Gst;
 
-public errordomain Rygel.GstStreamError {
+public errordomain Rygel.StreamingResponseError {
     MISSING_PLUGIN,
     LINK
 }
 
-public class Rygel.GstStream : Rygel.HTTPResponse {
+public class Rygel.StreamingResponse : Rygel.HTTPResponse {
     private const string SINK_NAME = "fakesink";
 
     private Pipeline pipeline;
 
     private AsyncQueue<Buffer> buffers;
 
-    public GstStream (Soup.Server  server,
-                      Soup.Message msg,
-                      string       name,
-                      Element      src) throws Error {
+    public StreamingResponse (Soup.Server  server,
+                              Soup.Message msg,
+                              string       name,
+                              Element      src) throws Error {
         base (server, msg, false);
 
         this.msg.response_headers.set_encoding (Soup.Encoding.CHUNKED);
@@ -80,8 +80,8 @@ public class Rygel.GstStream : Rygel.HTTPResponse {
         dynamic Element sink = ElementFactory.make ("fakesink", SINK_NAME);
 
         if (sink == null) {
-            throw new GstStreamError.MISSING_PLUGIN ("Required plugin " +
-                                                     "'appsink' missing");
+            throw new StreamingResponseError.MISSING_PLUGIN (
+                                    "Required plugin 'fakesink' missing");
         }
 
         sink.signal_handoffs = true;
@@ -98,7 +98,8 @@ public class Rygel.GstStream : Rygel.HTTPResponse {
         } else {
             // static pads? easy!
             if (!src.link (sink)) {
-                throw new GstStreamError.LINK ("Failed to link %s to %s",
+                throw new StreamingResponseError.LINK (
+                                               "Failed to link %s to %s",
                                                src.name,
                                                sink.name);
             }