Rename LiveResponseError to GstError and move it to GstUtils module.
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;
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;
}
}
using Gee;
using Gst;
-internal errordomain Rygel.LiveResponseError {
- MISSING_PLUGIN,
- LINK
-}
-
internal class Rygel.LiveResponse : Rygel.HTTPResponse {
private const string SINK_NAME = "fakesink";
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;
} 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);
}
}
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;
}
}
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;
}
}