File tree 2 files changed +15
-2
lines changed
android/src/main/java/com/cloudwebrtc/webrtc
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,7 @@ public void onStop() {
495
495
info .width = wm .getDefaultDisplay ().getWidth ();
496
496
info .height = wm .getDefaultDisplay ().getHeight ();
497
497
info .fps = DEFAULT_FPS ;
498
+ info .isScreenCapture = true ;
498
499
info .capturer = videoCapturer ;
499
500
500
501
videoCapturer .startCapture (info .width , info .height , info .fps );
@@ -1024,7 +1025,7 @@ private class NoSuchFieldWithNameException extends NoSuchFieldException {
1024
1025
1025
1026
public void reStartCamera (IsCameraEnabled getCameraId ) {
1026
1027
for (Map .Entry <String , VideoCapturerInfo > item : mVideoCapturers .entrySet ()) {
1027
- if (getCameraId .isEnabled (item .getKey ())) {
1028
+ if (! item . getValue (). isScreenCapture && getCameraId .isEnabled (item .getKey ())) {
1028
1029
item .getValue ().capturer .startCapture (
1029
1030
item .getValue ().width ,
1030
1031
item .getValue ().height ,
@@ -1043,5 +1044,6 @@ public class VideoCapturerInfo {
1043
1044
int width ;
1044
1045
int height ;
1045
1046
int fps ;
1047
+ boolean isScreenCapture = false ;
1046
1048
}
1047
1049
}
Original file line number Diff line number Diff line change 20
20
import com .cloudwebrtc .webrtc .utils .ObjectType ;
21
21
22
22
import org .webrtc .AudioTrack ;
23
+ import org .webrtc .CryptoOptions ;
23
24
import org .webrtc .DefaultVideoDecoderFactory ;
24
25
import org .webrtc .DefaultVideoEncoderFactory ;
25
26
import org .webrtc .DtmfSender ;
@@ -924,7 +925,17 @@ private RTCConfiguration parseRTCConfiguration(ConstraintsMap map) {
924
925
final boolean v = map .getBoolean ("presumeWritableWhenFullyRelayed" );
925
926
conf .presumeWritableWhenFullyRelayed = v ;
926
927
}
927
-
928
+ // cryptoOptions
929
+ if (map .hasKey ("cryptoOptions" )
930
+ && map .getType ("cryptoOptions" ) == ObjectType .Map ) {
931
+ final ConstraintsMap cryptoOptions = map .getMap ("cryptoOptions" );
932
+ conf .cryptoOptions = CryptoOptions .builder ()
933
+ .setEnableGcmCryptoSuites (cryptoOptions .hasKey ("enableGcmCryptoSuites" ) && cryptoOptions .getBoolean ("enableGcmCryptoSuites" ))
934
+ .setRequireFrameEncryption (cryptoOptions .hasKey ("requireFrameEncryption" ) && cryptoOptions .getBoolean ("requireFrameEncryption" ))
935
+ .setEnableEncryptedRtpHeaderExtensions (cryptoOptions .hasKey ("enableEncryptedRtpHeaderExtensions" ) && cryptoOptions .getBoolean ("enableEncryptedRtpHeaderExtensions" ))
936
+ .setEnableAes128Sha1_32CryptoCipher (cryptoOptions .hasKey ("enableAes128Sha1_32CryptoCipher" ) && cryptoOptions .getBoolean ("enableAes128Sha1_32CryptoCipher" ))
937
+ .createCryptoOptions ();
938
+ }
928
939
return conf ;
929
940
}
930
941
You can’t perform that action at this time.
0 commit comments