core: LiveResponseError -> GstError
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 16 Mar 2010 14:24:59 +0000 (16:24 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 16 Mar 2010 14:24:59 +0000 (16:24 +0200)
Rename LiveResponseError to GstError and move it to GstUtils module.

src/rygel/rygel-gst-utils.vala
src/rygel/rygel-l16-transcoder-bin.vala
src/rygel/rygel-live-response.vala
src/rygel/rygel-mp2ts-transcoder-bin.vala
src/rygel/rygel-mp3-transcoder-bin.vala

index e649e3b..ea4b48e 100644 (file)
 
 using Gst;
 
+internal errordomain Rygel.GstError {
+    MISSING_PLUGIN,
+    LINK
+}
+
 internal abstract class Rygel.GstUtils {
     public static Element create_element (string factoryname,
                                              string? name)
                                              throws Error {
         Element element = ElementFactory.make (factoryname, name);
         if (element == null) {
-            throw new LiveResponseError.MISSING_PLUGIN (
-                                "Required element factory '%s' missing",
-                                factoryname);
+            throw new GstError.MISSING_PLUGIN ("Required element factory " +
+                                               factoryname + " missing");
         }
 
         return element;
index dc62743..cfbbbf3 100644 (file)
@@ -62,10 +62,10 @@ internal class Rygel.L16TranscoderBin : Gst.Bin {
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
             GstUtils.post_error (this,
-                                 new LiveResponseError.LINK (
-                                                "Failed to link pad %s to %s",
-                                                new_pad.name,
-                                                enc_pad.name));
+                                 new GstError.LINK ("Failed to link pad " +
+                                                    new_pad.name +
+                                                    " to " +
+                                                    enc_pad.name));
             return;
         }
     }
index 1680e88..c331656 100644 (file)
@@ -26,11 +26,6 @@ using GUPnP;
 using Gee;
 using Gst;
 
-internal errordomain Rygel.LiveResponseError {
-    MISSING_PLUGIN,
-    LINK
-}
-
 internal class Rygel.LiveResponse : Rygel.HTTPResponse {
     private const string SINK_NAME = "fakesink";
 
@@ -90,8 +85,8 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse {
         dynamic Element sink = ElementFactory.make ("fakesink", SINK_NAME);
 
         if (sink == null) {
-            throw new LiveResponseError.MISSING_PLUGIN (
-                                    "Required plugin 'fakesink' missing");
+            throw new GstError.MISSING_PLUGIN ("Required plugin " +
+                                               "'fakesink' missing");
         }
 
         sink.signal_handoffs = true;
@@ -108,9 +103,9 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse {
         } else {
             // static pads? easy!
             if (!src.link (sink)) {
-                throw new LiveResponseError.LINK ("Failed to link %s to %s",
-                                                  src.name,
-                                                  sink.name);
+                throw new GstError.LINK ("Failed to link " +
+                                         src.name + " to " +
+                                         sink.name);
             }
         }
 
index b7742fd..0dbf351 100644 (file)
@@ -86,10 +86,10 @@ internal class Rygel.MP2TSTranscoderBin : Gst.Bin {
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
             GstUtils.post_error (this,
-                                 new LiveResponseError.LINK (
-                                                "Failed to link pad %s to %s",
-                                                new_pad.name,
-                                                enc_pad.name));
+                                 new GstError.LINK ("Failed to link pad " +
+                                                    new_pad.name +
+                                                    " to " +
+                                                    enc_pad.name));
             return;
         }
     }
index c291f59..9483ead 100644 (file)
@@ -67,10 +67,10 @@ internal class Rygel.MP3TranscoderBin : Gst.Bin {
 
         if (new_pad.link (enc_pad) != PadLinkReturn.OK) {
             GstUtils.post_error (this,
-                                 new LiveResponseError.LINK (
-                                                "Failed to link pad %s to %s",
-                                                new_pad.name,
-                                                enc_pad.name));
+                                 new GstError.LINK ("Failed to link pad " +
+                                                    new_pad.name +
+                                                    " to " +
+                                                    enc_pad.name));
             return;
         }
     }