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
This commit is contained in:
perkj@webrtc.org
2014-10-24 11:38:19 +00:00
parent 39b1743116
commit 470988742a
2 changed files with 8 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ import java.nio.ByteBuffer;
// This class is an implementation detail of the Java PeerConnection API. // This class is an implementation detail of the Java PeerConnection API.
// MediaCodec is thread-hostile so this class must be operated on a single // MediaCodec is thread-hostile so this class must be operated on a single
// thread. // thread.
class MediaCodecVideoEncoder { public class MediaCodecVideoEncoder {
// This class is constructed, operated, and destroyed by its C++ incarnation, // This class is constructed, operated, and destroyed by its C++ incarnation,
// so the class and its methods have non-public visibility. The API this // 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 // class exposes aims to mimic the webrtc::VideoEncoder API as closely as
@@ -140,7 +140,7 @@ class MediaCodecVideoEncoder {
return null; // No HW VP8 encoder. return null; // No HW VP8 encoder.
} }
private static boolean isPlatformSupported() { public static boolean isPlatformSupported() {
return findVp8HwEncoder() != null; return findVp8HwEncoder() != null;
} }

View File

@@ -43,6 +43,8 @@ import android.widget.CheckBox;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import org.webrtc.MediaCodecVideoEncoder;
/** /**
* Handles the initial setup where the user selects which room to join. * Handles the initial setup where the user selects which room to join.
*/ */
@@ -98,6 +100,10 @@ public class ConnectActivity extends Activity {
} else { } else {
url += "/?r=" + roomEditText.getText(); url += "/?r=" + roomEditText.getText();
} }
if (MediaCodecVideoEncoder.isPlatformSupported()) {
url += "&hd=true";
}
// TODO(kjellander): Add support for custom parameters to the URL. // TODO(kjellander): Add support for custom parameters to the URL.
connectToRoom(url); connectToRoom(url);
} }