[rygel] core: Re-mux only if transcoding is not needed
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Re-mux only if transcoding is not needed
- Date: Sat, 8 May 2010 18:56:23 +0000 (UTC)
commit b8ff6c8a79239394321de58b098f33aad0a92b55
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sat May 8 21:37:04 2010 +0300
core: Re-mux only if transcoding is not needed
MPEG2TS and WMV transcoders now bypass encoders if the stream is already
encoded in the needed codec. However, this also implies skipping the raw
audio and video tansformations and that in turn implies we are not exactly
being honest about the advertized DLNA profile name of the remuxed stream.
In most cases that shouldn't be a problem and this change should only make
users happy (hopefully).
src/rygel/rygel-mp2ts-transcoder-bin.vala | 16 +++++++++++++++-
src/rygel/rygel-wmv-transcoder-bin.vala | 16 +++++++++++++++-
2 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel/rygel-mp2ts-transcoder-bin.vala b/src/rygel/rygel-mp2ts-transcoder-bin.vala
index dc6059f..e4e4706 100644
--- a/src/rygel/rygel-mp2ts-transcoder-bin.vala
+++ b/src/rygel/rygel-mp2ts-transcoder-bin.vala
@@ -42,7 +42,8 @@ internal class Rygel.MP2TSTranscoderBin : Gst.Bin {
Element src,
MP2TSTranscoder transcoder)
throws Error {
- Element decodebin = GstUtils.create_element (DECODEBIN, DECODEBIN);
+ dynamic Element decodebin = GstUtils.create_element (DECODEBIN,
+ DECODEBIN);
var mp3_transcoder = new MP3Transcoder (MP3Layer.TWO);
this.audio_enc = mp3_transcoder.create_encoder (item,
null,
@@ -62,6 +63,19 @@ internal class Rygel.MP2TSTranscoderBin : Gst.Bin {
this.add_pad (ghost);
decodebin.pad_added += this.decodebin_pad_added;
+ decodebin.autoplug_continue += this.autoplug_continue;
+ }
+
+ private bool autoplug_continue (Element decodebin,
+ Pad new_pad,
+ Caps caps) {
+ var muxer_pad = this.muxer.get_compatible_pad (new_pad, null);
+
+ if (muxer_pad == null) {
+ return true;
+ } else {
+ return new_pad.link (muxer_pad) != PadLinkReturn.OK;
+ }
}
private void decodebin_pad_added (Element decodebin, Pad new_pad) {
diff --git a/src/rygel/rygel-wmv-transcoder-bin.vala b/src/rygel/rygel-wmv-transcoder-bin.vala
index 435d924..1ee5efe 100644
--- a/src/rygel/rygel-wmv-transcoder-bin.vala
+++ b/src/rygel/rygel-wmv-transcoder-bin.vala
@@ -40,7 +40,8 @@ internal class Rygel.WMVTranscoderBin : Gst.Bin {
Element src,
WMVTranscoder transcoder)
throws Error {
- Element decodebin = GstUtils.create_element (DECODEBIN, DECODEBIN);
+ dynamic Element decodebin = GstUtils.create_element (DECODEBIN,
+ DECODEBIN);
var wma_transcoder = new WMATranscoder ();
this.audio_enc = wma_transcoder.create_encoder (item,
null,
@@ -60,6 +61,19 @@ internal class Rygel.WMVTranscoderBin : Gst.Bin {
this.add_pad (ghost);
decodebin.pad_added += this.decodebin_pad_added;
+ decodebin.autoplug_continue += this.autoplug_continue;
+ }
+
+ private bool autoplug_continue (Element decodebin,
+ Pad new_pad,
+ Caps caps) {
+ var muxer_pad = this.muxer.get_compatible_pad (new_pad, null);
+
+ if (muxer_pad == null) {
+ return true;
+ } else {
+ return new_pad.link (muxer_pad) != PadLinkReturn.OK;
+ }
}
private void decodebin_pad_added (Element decodebin, Pad new_pad) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]