diff --git a/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java index 9d6822b12e..a9b71e6446 100644 --- a/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java +++ b/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java @@ -36,6 +36,8 @@ import org.webrtc.AudioTrack; import org.webrtc.CameraVideoCapturer; import org.webrtc.DataChannel; import org.webrtc.EglBase; +import org.webrtc.HardwareVideoDecoderFactory; +import org.webrtc.HardwareVideoEncoderFactory; import org.webrtc.IceCandidate; import org.webrtc.Logging; import org.webrtc.MediaConstraints; @@ -339,6 +341,7 @@ public class PeerConnectionClient { createPeerConnection( localRender, Collections.singletonList(remoteRender), videoCapturer, signalingParameters); } + public void createPeerConnection(final VideoSink localRender, final List remoteRenders, final VideoCapturer videoCapturer, final SignalingParameters signalingParameters) { @@ -512,7 +515,12 @@ public class PeerConnectionClient { if (options != null) { Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMask); } - factory = new PeerConnectionFactory(options); + final boolean enableH264HighProfile = + peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_H264_HIGH); + factory = new PeerConnectionFactory(options, + new HardwareVideoEncoderFactory(rootEglBase.getEglBaseContext(), + true /* enableIntelVp8Encoder */, enableH264HighProfile), + new HardwareVideoDecoderFactory(rootEglBase.getEglBaseContext())); Log.d(TAG, "Peer connection factory created."); }