No need to keep check_pad_compatible static.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sat, 21 Mar 2009 13:56:18 +0000 (13:56 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sat, 21 Mar 2009 13:56:18 +0000 (13:56 +0000)
Just inline it in both classes for now, we'll move it to common
baseclass when we have that.

svn path=/trunk/; revision=713

src/rygel/rygel-mp2ts-transcoder.vala
src/rygel/rygel-mp3-transcoder.vala

index f0e96dc..91e3a5d 100644 (file)
@@ -78,11 +78,11 @@ internal class Rygel.MP2TSTranscoder : Gst.Bin {
 
        // Check which encoder to use
        if (!audio_enc_pad.is_linked () &&
-            MP3Transcoder.pads_compatible (new_pad, audio_enc_pad)) {
+            this.pads_compatible (new_pad, audio_enc_pad)) {
            encoder = this.audio_enc;
            enc_pad = audio_enc_pad;
        } else if (!video_enc_pad.is_linked () &&
-                  MP3Transcoder.pads_compatible (new_pad, video_enc_pad)) {
+                  this.pads_compatible (new_pad, video_enc_pad)) {
            encoder = this.video_enc;
            enc_pad = video_enc_pad;
        } else {
@@ -144,6 +144,12 @@ internal class Rygel.MP2TSTranscoder : Gst.Bin {
        return bin;
    }
 
+   private 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);
index 61c7e08..d0ecdbd 100644 (file)
@@ -66,8 +66,7 @@ internal class Rygel.MP3Transcoder : Gst.Bin {
    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 () ||
-           !MP3Transcoder.pads_compatible (new_pad, enc_pad)) {
+       if (enc_pad.is_linked () || !this.pads_compatible (new_pad, enc_pad)) {
            return;
        }
 
@@ -134,7 +133,7 @@ internal class Rygel.MP3Transcoder : Gst.Bin {
        return bin;
    }
 
-   internal static bool pads_compatible (Pad pad1, Pad pad2) {
+   private bool pads_compatible (Pad pad1, Pad pad2) {
         Caps intersection = pad1.get_caps ().intersect (pad2.get_caps ());
 
         return !intersection.is_empty ();