From 29f010a10645607c671e61a55690bb245ff4e0cc Mon Sep 17 00:00:00 2001
From: Boris Grozev <boris@jitsi.org>
Date: Wed, 26 Sep 2012 09:29:34 +0000
Subject: [PATCH] Makes the "toggle video" button in the call window active
 only if we're ready to send video, and shows an appropriate tooltip
 otherwise. Same for the desktop sharing button.

---
 .../neomedia/codec/EncodingConfiguration.java       | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/org/jitsi/service/neomedia/codec/EncodingConfiguration.java b/src/org/jitsi/service/neomedia/codec/EncodingConfiguration.java
index d2c1a40b..0948b01c 100644
--- a/src/org/jitsi/service/neomedia/codec/EncodingConfiguration.java
+++ b/src/org/jitsi/service/neomedia/codec/EncodingConfiguration.java
@@ -501,4 +501,17 @@ public void loadEncodingConfiguration(
         encodingConfiguration.storeProperties(properties);
         loadProperties(properties);
     }
+
+    /**
+     * Returns <tt>true</tt> if there is at least one enabled format for media
+     * type <tt>type</tt>.
+     *
+     * @param mediaType The media type, MediaType.AUDIO or MediaType.VIDEO
+     * @return <tt>true</tt> if there is at least one enabled format for media
+     * type <tt>type</tt>.
+     */
+    public boolean hasEnabledFormat(MediaType mediaType)
+    {
+        return (getEnabledEncodings(mediaType).length > 0);
+    }
 }
-- 
GitLab