From 5a3d87d122bdfec0f06e83bdf232e71bf690ff31 Mon Sep 17 00:00:00 2001 From: Magnus Jedvert Date: Fri, 13 Jul 2018 17:26:32 +0200 Subject: [PATCH] Android: Remove use of deprecated functions related to legacy video codecs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:7925 Change-Id: I6728a0ef931ae93ba095965daeeb97925a31b245 Reviewed-on: https://webrtc-review.googlesource.com/88570 Reviewed-by: Sami Kalliomäki Commit-Queue: Magnus Jedvert Cr-Commit-Position: refs/heads/master@{#23980} --- .../org/appspot/apprtc/PeerConnectionClient.java | 10 +--------- .../apprtc/test/PeerConnectionClientTest.java | 13 ------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java index 6f92c90837..ae1f77b05a 100644 --- a/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java +++ b/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java @@ -331,13 +331,10 @@ public class PeerConnectionClient { final String fieldTrials = getFieldTrials(peerConnectionParameters); executor.execute(() -> { - Log.d(TAG, - "Initialize WebRTC. Field trials: " + fieldTrials + " Enable video HW acceleration: " - + peerConnectionParameters.videoCodecHwAcceleration); + Log.d(TAG, "Initialize WebRTC. Field trials: " + fieldTrials); PeerConnectionFactory.initialize( PeerConnectionFactory.InitializationOptions.builder(appContext) .setFieldTrials(fieldTrials) - .setEnableVideoHwAcceleration(peerConnectionParameters.videoCodecHwAcceleration) .setEnableInternalTracer(true) .createInitializationOptions()); }); @@ -637,11 +634,6 @@ public class PeerConnectionClient { queuedRemoteCandidates = new ArrayList<>(); - if (isVideoCallEnabled()) { - factory.setVideoHwAccelerationOptions( - rootEglBase.getEglBaseContext(), rootEglBase.getEglBaseContext()); - } - PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(signalingParameters.iceServers); // TCP candidates are only useful when connecting to a server that supports diff --git a/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java b/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java index 0ee1d4e7cb..29b59d795b 100644 --- a/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java +++ b/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java @@ -37,7 +37,6 @@ import org.webrtc.Camera2Enumerator; import org.webrtc.CameraEnumerator; import org.webrtc.EglBase; import org.webrtc.IceCandidate; -import org.webrtc.MediaCodecVideoEncoder; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; import org.webrtc.SessionDescription; @@ -528,12 +527,6 @@ public class PeerConnectionClientTest implements PeerConnectionEvents { Log.i(TAG, "Encode to textures is not supported. Requires SDK version 19"); return; } - // TODO(perkj): If we can always capture to textures, there is no need to check if the - // hardware encoder supports to encode from a texture. - if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) { - Log.i(TAG, "VP8 encode to textures is not supported."); - return; - } doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_VP8), createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */); } @@ -545,12 +538,6 @@ public class PeerConnectionClientTest implements PeerConnectionEvents { Log.i(TAG, "Encode to textures is not supported. Requires KITKAT"); return; } - // TODO(perkj): If we can always capture to textures, there is no need to check if the - // hardware encoder supports to encode from a texture. - if (!MediaCodecVideoEncoder.isH264HwSupportedUsingTextures()) { - Log.i(TAG, "H264 encode to textures is not supported."); - return; - } doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_H264), createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */); }