rygel r727 - trunk/src/rygel



Author: zeeshanak
Date: Sat Mar 21 13:57:30 2009
New Revision: 727
URL: http://svn.gnome.org/viewvc/rygel?rev=727&view=rev

Log:
Just use Pad.can_link to check pad compatibility.

Modified:
   trunk/src/rygel/rygel-l16-transcoder.vala
   trunk/src/rygel/rygel-mp2ts-transcoder.vala
   trunk/src/rygel/rygel-mp3-transcoder.vala
   trunk/src/rygel/rygel-transcoder.vala

Modified: trunk/src/rygel/rygel-l16-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-l16-transcoder.vala	(original)
+++ trunk/src/rygel/rygel-l16-transcoder.vala	Sat Mar 21 13:57:30 2009
@@ -61,7 +61,7 @@
 
     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 () || !this.pads_compatible (new_pad, enc_pad)) {
+        if (!new_pad.can_link (enc_pad)) {
             return;
         }
 

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:57:30 2009
@@ -67,12 +67,10 @@
         var video_enc_pad = this.video_enc.get_pad (VIDEO_ENC_SINK);
 
         // Check which encoder to use
-        if (!audio_enc_pad.is_linked () &&
-            this.pads_compatible (new_pad, audio_enc_pad)) {
+        if (new_pad.can_link (audio_enc_pad)) {
             encoder = this.audio_enc;
             enc_pad = audio_enc_pad;
-        } else if (!video_enc_pad.is_linked () &&
-                   this.pads_compatible (new_pad, video_enc_pad)) {
+        } else if (new_pad.can_link (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:57:30 2009
@@ -65,7 +65,7 @@
 
     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 () || !this.pads_compatible (new_pad, enc_pad)) {
+        if (!new_pad.can_link (enc_pad)) {
             return;
         }
 

Modified: trunk/src/rygel/rygel-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-transcoder.vala	(original)
+++ trunk/src/rygel/rygel-transcoder.vala	Sat Mar 21 13:57:30 2009
@@ -24,14 +24,6 @@
 using Gst;
 
 internal abstract class Rygel.Transcoder : Gst.Bin {
-    // FIXME: This method must be replaced by Gst.Pad.is_compatible once
-    //        it's there (i-e bug#575682 and 575685 are fixed).
-    protected bool pads_compatible (Pad pad1, Pad pad2) {
-        Caps intersection = pad1.get_caps ().intersect (pad2.get_caps ());
-
-        return !intersection.is_empty ();
-    }
-
     protected static Element create_element (string factoryname,
                                              string? name)
                                              throws Error {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]