Promotoing webrtc::CryptoOptions to RTCConfiguration.

With the expanding use cases for webrtc::CryptoOptions it makes more sense for
it to be be available per peer connection instead of only as a factory option.

To support backwards compatability for now this code will support the factory
method of setting crypto options by default. However it will completely
overwrite these settings if an RTCConfiguration.crypto_options is provided.

Got LGTM offline from Sami, adding him to TBR if he has any further comments.

TBR=sakal@webrtc.org

Bug: webrtc:9891
Change-Id: I86914cab69284ad82afd7285fd84ec5f4f2c4986
Reviewed-on: https://webrtc-review.googlesource.com/c/107029
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25375}
This commit is contained in:
Benjamin Wright
2018-10-25 10:16:44 -07:00
committed by Commit Bot
parent 78410ad413
commit 8c27ccac75
21 changed files with 581 additions and 10 deletions

View File

@ -468,6 +468,13 @@ public class PeerConnection {
*/
public boolean useMediaTransport;
/**
* Defines advanced optional cryptographic settings related to SRTP and
* frame encryption for native WebRTC. Setting this will overwrite any
* options set through the PeerConnectionFactory (which is deprecated).
*/
@Nullable public CryptoOptions cryptoOptions;
// TODO(deadbeef): Instead of duplicating the defaults here, we should do
// something to pick up the defaults from C++. The Objective-C equivalent
// of RTCConfiguration does that.
@ -508,6 +515,7 @@ public class PeerConnection {
sdpSemantics = SdpSemantics.PLAN_B;
activeResetSrtpParams = false;
useMediaTransport = false;
cryptoOptions = null;
}
@CalledByNative("RTCConfiguration")
@ -711,6 +719,12 @@ public class PeerConnection {
boolean getUseMediaTransport() {
return useMediaTransport;
}
@Nullable
@CalledByNative("RTCConfiguration")
CryptoOptions getCryptoOptions() {
return cryptoOptions;
}
};
private final List<MediaStream> localStreams = new ArrayList<>();