Add HD support to Android if we detect a hardware video encoder that can be used. This Change the internal class MediaCodecVideoEncoder to have a one public method for checking if the platform is supported. It also adds &hd=true to the reqest url a hardware encoder is detected.

BUG=3934
R=glaznev@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/30749004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7520 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java
index a2d6168..4c02891 100644
--- a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java
+++ b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java
@@ -43,7 +43,7 @@
 // This class is an implementation detail of the Java PeerConnection API.
 // MediaCodec is thread-hostile so this class must be operated on a single
 // thread.
-class MediaCodecVideoEncoder {
+public class MediaCodecVideoEncoder {
   // This class is constructed, operated, and destroyed by its C++ incarnation,
   // so the class and its methods have non-public visibility.  The API this
   // class exposes aims to mimic the webrtc::VideoEncoder API as closely as
@@ -140,7 +140,7 @@
     return null;  // No HW VP8 encoder.
   }
 
-  private static boolean isPlatformSupported() {
+  public static boolean isPlatformSupported() {
     return findVp8HwEncoder() != null;
   }
 
diff --git a/talk/examples/android/src/org/appspot/apprtc/ConnectActivity.java b/talk/examples/android/src/org/appspot/apprtc/ConnectActivity.java
index e02104e..2df6fcf 100644
--- a/talk/examples/android/src/org/appspot/apprtc/ConnectActivity.java
+++ b/talk/examples/android/src/org/appspot/apprtc/ConnectActivity.java
@@ -43,6 +43,8 @@
 import android.widget.EditText;
 import android.widget.TextView;
 
+import org.webrtc.MediaCodecVideoEncoder;
+
 /**
  * Handles the initial setup where the user selects which room to join.
  */
@@ -98,6 +100,10 @@
         } else {
           url += "/?r=" + roomEditText.getText();
         }
+
+        if (MediaCodecVideoEncoder.isPlatformSupported()) {
+          url += "&hd=true";
+        }
         // TODO(kjellander): Add support for custom parameters to the URL.
         connectToRoom(url);
       }