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
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
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 \
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 \
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 \
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);
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;
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,
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;
}
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);
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;
} 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);
}