rygel r444 - in trunk/src: plugins/test rygel



Author: zeeshanak
Date: Sun Jan 18 19:27:22 2009
New Revision: 444
URL: http://svn.gnome.org/viewvc/rygel?rev=444&view=rev

Log:
Rename GstStream to StreamingResponse.

Added:
   trunk/src/rygel/rygel-streaming-response.vala
      - copied, changed from r443, /trunk/src/rygel/rygel-gst-stream.vala
Removed:
   trunk/src/rygel/rygel-gst-stream.vala
Modified:
   trunk/src/plugins/test/rygel-test-audio-item.vala
   trunk/src/plugins/test/rygel-test-video-item.vala
   trunk/src/rygel/Makefile.am
   trunk/src/rygel/rygel-http-server.vala

Modified: trunk/src/plugins/test/rygel-test-audio-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-audio-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-audio-item.vala	Sun Jan 18 19:27:22 2009
@@ -54,7 +54,8 @@
         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

Modified: trunk/src/plugins/test/rygel-test-video-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-video-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-video-item.vala	Sun Jan 18 19:27:22 2009
@@ -55,7 +55,8 @@
         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

Modified: trunk/src/rygel/Makefile.am
==============================================================================
--- trunk/src/rygel/Makefile.am	(original)
+++ trunk/src/rygel/Makefile.am	Sun Jan 18 19:27:22 2009
@@ -39,8 +39,8 @@
                 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-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-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 \

Modified: trunk/src/rygel/rygel-http-server.vala
==============================================================================
--- trunk/src/rygel/rygel-http-server.vala	(original)
+++ trunk/src/rygel/rygel-http-server.vala	Sun Jan 18 19:27:22 2009
@@ -39,7 +39,7 @@
     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 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 @@
 
     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 @@
         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;
         }

Copied: trunk/src/rygel/rygel-streaming-response.vala (from r443, /trunk/src/rygel/rygel-gst-stream.vala)
==============================================================================
--- /trunk/src/rygel/rygel-gst-stream.vala	(original)
+++ trunk/src/rygel/rygel-streaming-response.vala	Sun Jan 18 19:27:22 2009
@@ -29,22 +29,22 @@
 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 @@
         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 @@
         } 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);
             }



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