[rygel/wip/media-engine: 6/9] server: Re-enable transcoders
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/wip/media-engine: 6/9] server: Re-enable transcoders
- Date: Fri, 21 Sep 2012 14:08:08 +0000 (UTC)
commit bf1002c49f6d69815cf88d6d0622c7c52dc288c1
Author: Jens Georg <jensg openismus org>
Date: Tue Sep 11 13:34:42 2012 +0200
server: Re-enable transcoders
src/librygel-server/rygel-gst-data-source.vala | 2 +-
src/librygel-server/rygel-gst-transcoder.vala | 15 ++++++++++-----
.../rygel-http-transcode-handler.vala | 5 ++---
src/librygel-server/rygel-transcoder.vala | 5 ++---
4 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/librygel-server/rygel-gst-data-source.vala b/src/librygel-server/rygel-gst-data-source.vala
index 53a944f..90d8fc2 100644
--- a/src/librygel-server/rygel-gst-data-source.vala
+++ b/src/librygel-server/rygel-gst-data-source.vala
@@ -23,7 +23,7 @@
using Gst;
public class Rygel.GstDataSource : Rygel.DataSource, GLib.Object {
- private dynamic Element src;
+ internal dynamic Element src;
private Pipeline pipeline;
private HTTPSeek seek = null;
private GstSink sink;
diff --git a/src/librygel-server/rygel-gst-transcoder.vala b/src/librygel-server/rygel-gst-transcoder.vala
index af6f6c6..73e68b5 100644
--- a/src/librygel-server/rygel-gst-transcoder.vala
+++ b/src/librygel-server/rygel-gst-transcoder.vala
@@ -62,8 +62,13 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
*
* @return the new transcoding source
*/
- public override Element create_source (MediaItem item,
- Element src) throws Error {
+ public override DataSource create_source (MediaItem item,
+ DataSource src) throws Error {
+ // We can only link GStreamer data sources together
+ assert (src is GstDataSource);
+
+ var orig_source = src as GstDataSource;
+
this.decoder = GstUtils.create_element (DECODE_BIN,
DECODE_BIN);
this.encoder = GstUtils.create_element (ENCODE_BIN,
@@ -75,9 +80,9 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
GstUtils.dump_encoding_profile (encoder.profile);
var bin = new Bin ("transcoder-source");
- bin.add_many (src, decoder, encoder);
+ bin.add_many (orig_source.src, decoder, encoder);
- src.link (decoder);
+ orig_source.src.link (decoder);
decoder.pad_added.connect (this.on_decoder_pad_added);
decoder.autoplug_continue.connect (this.on_autoplug_continue);
@@ -87,7 +92,7 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
var ghost = new GhostPad (null, pad);
bin.add_pad (ghost);
- return bin;
+ return new GstDataSource.from_element (bin);
}
/**
diff --git a/src/librygel-server/rygel-http-transcode-handler.vala b/src/librygel-server/rygel-http-transcode-handler.vala
index f4bbc53..665692b 100644
--- a/src/librygel-server/rygel-http-transcode-handler.vala
+++ b/src/librygel-server/rygel-http-transcode-handler.vala
@@ -59,14 +59,13 @@ internal class Rygel.HTTPTranscodeHandler : HTTPGetHandler {
throw new HTTPRequestError.NOT_FOUND (_("Not found"));
}
-/* try {
+ try {
src = this.transcoder.create_source (item, src);
return new HTTPResponse (request, this, src);
} catch (GLib.Error err) {
throw new HTTPRequestError.NOT_FOUND (err.message);
- }*/
- throw new HTTPRequestError.NOT_FOUND ("Transcoding temporarily disabled");
+ }
}
protected override DIDLLiteResource add_resource (DIDLLiteItem didl_item,
diff --git a/src/librygel-server/rygel-transcoder.vala b/src/librygel-server/rygel-transcoder.vala
index cc0e2fd..6427694 100644
--- a/src/librygel-server/rygel-transcoder.vala
+++ b/src/librygel-server/rygel-transcoder.vala
@@ -24,7 +24,6 @@
*/
using GUPnP;
-using Gst;
/**
* The base Transcoder class. Each implementation derives from it and must
@@ -43,8 +42,8 @@ public abstract class Rygel.Transcoder : GLib.Object {
*
* @return the new transcoding source
*/
- public abstract Element create_source (MediaItem item,
- Element src) throws Error;
+ public abstract DataSource create_source (MediaItem item,
+ DataSource src) throws Error;
public virtual DIDLLiteResource? add_resource (DIDLLiteItem didl_item,
MediaItem item,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]