rygel r709 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r709 - trunk/src/rygel
- Date: Sat, 21 Mar 2009 13:56:00 +0000 (UTC)
Author: zeeshanak
Date: Sat Mar 21 13:56:00 2009
New Revision: 709
URL: http://svn.gnome.org/viewvc/rygel?rev=709&view=rev
Log:
Intersect the caps of the pads to check their compatibility.
Modified:
trunk/src/rygel/rygel-mp2ts-transcoder.vala
trunk/src/rygel/rygel-mp3-transcoder.vala
Modified: trunk/src/rygel/rygel-mp2ts-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp2ts-transcoder.vala (original)
+++ trunk/src/rygel/rygel-mp2ts-transcoder.vala Sat Mar 21 13:56:00 2009
@@ -79,11 +79,12 @@
var video_enc_pad = this.video_enc.get_pad (VIDEO_ENC_SINK);
// Check which encoder to use
- if (!audio_enc_pad.is_linked () && new_pad.can_link (audio_enc_pad)) {
+ if (!audio_enc_pad.is_linked () &&
+ MP3Transcoder.pads_compatible (new_pad, audio_enc_pad)) {
encoder = this.audio_enc;
enc_pad = audio_enc_pad;
} else if (!video_enc_pad.is_linked () &&
- new_pad.can_link (video_enc_pad)) {
+ MP3Transcoder.pads_compatible (new_pad, video_enc_pad)) {
encoder = this.video_enc;
enc_pad = video_enc_pad;
} else {
Modified: trunk/src/rygel/rygel-mp3-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp3-transcoder.vala (original)
+++ trunk/src/rygel/rygel-mp3-transcoder.vala Sat Mar 21 13:56:00 2009
@@ -66,7 +66,8 @@
private void decodebin_pad_added (Element decodebin,
Pad new_pad) {
Pad enc_pad = this.audio_enc.get_pad (AUDIO_SINK_PAD);
- if (enc_pad.is_linked () || !new_pad.can_link (enc_pad)) {
+ if (enc_pad.is_linked () ||
+ !MP3Transcoder.pads_compatible (new_pad, enc_pad)) {
return;
}
@@ -133,6 +134,12 @@
return bin;
}
+ internal static bool pads_compatible (Pad pad1, Pad pad2) {
+ Caps intersection = pad1.get_caps ().intersect (pad2.get_caps ());
+
+ return !intersection.is_empty ();
+ }
+
private void post_error (Error error) {
Message msg = new Message.error (this, error, error.message);
this.post_message (msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]