Android: Deprecate peerconnection constraints.

C++ API allows passing all configuration through RTCConfiguration
object. This adds all values previously passed through PC constraints
to Java RTCConfiguration object and deprecates API that takes PC
contraints.

Using the deprecated API overrides the values in RTCConfigration
object.

Bug: webrtc:8663, webrtc:8662
Change-Id: I128432c3caba74403513fb1347ff58830c643885
Reviewed-on: https://webrtc-review.googlesource.com/33460
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21357}
This commit is contained in:
Sami Kalliomäki
2017-12-19 12:51:53 +01:00
committed by Commit Bot
parent ecb5e2a4b9
commit e8b26cd86b
8 changed files with 138 additions and 50 deletions

View File

@ -132,7 +132,6 @@ public class PeerConnectionClient {
private VideoSink localRender;
private List<VideoRenderer.Callbacks> remoteRenders;
private SignalingParameters signalingParameters;
private MediaConstraints pcConstraints;
private int videoWidth;
private int videoHeight;
private int videoFps;
@ -541,17 +540,6 @@ public class PeerConnectionClient {
}
private void createMediaConstraintsInternal() {
// Create peer connection constraints.
pcConstraints = new MediaConstraints();
// Enable DTLS for normal calls and disable for loopback calls.
if (peerConnectionParameters.loopback) {
pcConstraints.optional.add(
new MediaConstraints.KeyValuePair(DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT, "false"));
} else {
pcConstraints.optional.add(
new MediaConstraints.KeyValuePair(DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT, "true"));
}
// Check if there is a camera on device and disable video call if not.
if (videoCapturer == null) {
Log.w(TAG, "No camera on device. Switch to audio only call.");
@ -615,7 +603,6 @@ public class PeerConnectionClient {
}
Log.d(TAG, "Create peer connection.");
Log.d(TAG, "PCConstraints: " + pcConstraints.toString());
queuedRemoteCandidates = new ArrayList<>();
if (videoCallEnabled) {
@ -633,8 +620,10 @@ public class PeerConnectionClient {
rtcConfig.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY;
// Use ECDSA encryption.
rtcConfig.keyType = PeerConnection.KeyType.ECDSA;
// Enable DTLS for normal calls and disable for loopback calls.
rtcConfig.enableDtlsSrtp = !peerConnectionParameters.loopback;
peerConnection = factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
peerConnection = factory.createPeerConnection(rtcConfig, pcObserver);
if (dataChannelEnabled) {
DataChannel.Init init = new DataChannel.Init();