From b9290ac3e250b055e3f591abc309a513ff409e91 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Tue, 16 Mar 2010 16:24:59 +0200 Subject: [PATCH] core: LiveResponseError -> GstError Rename LiveResponseError to GstError and move it to GstUtils module. --- src/rygel/rygel-gst-utils.vala | 10 +++++++--- src/rygel/rygel-l16-transcoder-bin.vala | 8 ++++---- src/rygel/rygel-live-response.vala | 15 +++++---------- src/rygel/rygel-mp2ts-transcoder-bin.vala | 8 ++++---- src/rygel/rygel-mp3-transcoder-bin.vala | 8 ++++---- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/rygel/rygel-gst-utils.vala b/src/rygel/rygel-gst-utils.vala index e649e3b..ea4b48e 100644 --- a/src/rygel/rygel-gst-utils.vala +++ b/src/rygel/rygel-gst-utils.vala @@ -23,15 +23,19 @@ 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; diff --git a/src/rygel/rygel-l16-transcoder-bin.vala b/src/rygel/rygel-l16-transcoder-bin.vala index dc62743..cfbbbf3 100644 --- a/src/rygel/rygel-l16-transcoder-bin.vala +++ b/src/rygel/rygel-l16-transcoder-bin.vala @@ -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; } } diff --git a/src/rygel/rygel-live-response.vala b/src/rygel/rygel-live-response.vala index 1680e88..c331656 100644 --- a/src/rygel/rygel-live-response.vala +++ b/src/rygel/rygel-live-response.vala @@ -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); } } diff --git a/src/rygel/rygel-mp2ts-transcoder-bin.vala b/src/rygel/rygel-mp2ts-transcoder-bin.vala index b7742fd..0dbf351 100644 --- a/src/rygel/rygel-mp2ts-transcoder-bin.vala +++ b/src/rygel/rygel-mp2ts-transcoder-bin.vala @@ -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; } } diff --git a/src/rygel/rygel-mp3-transcoder-bin.vala b/src/rygel/rygel-mp3-transcoder-bin.vala index c291f59..9483ead 100644 --- a/src/rygel/rygel-mp3-transcoder-bin.vala +++ b/src/rygel/rygel-mp3-transcoder-bin.vala @@ -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; } } -- 2.7.4