CallStats: display encryption properly

This commit is contained in:
Gautier Pelloux-Prayer 2016-02-10 17:01:19 +01:00
parent 68d21e6cbd
commit 14b2c92346
3 changed files with 19 additions and 5 deletions

View file

@ -68,6 +68,20 @@
}
}
+ (NSString *)mediaEncryptionToString:(LinphoneMediaEncryption)enc {
switch (enc) {
case LinphoneMediaEncryptionDTLS:
return @"DTLS";
case LinphoneMediaEncryptionSRTP:
return @"SRTP";
case LinphoneMediaEncryptionZRTP:
return @"ZRTP";
case LinphoneMediaEncryptionNone:
break;
}
return NSLocalizedString(@"None", nil);
}
- (NSString *)updateStatsForCall:(LinphoneCall *)call stream:(LinphoneStreamType)stream {
NSMutableString *result = [[NSMutableString alloc] init];
const PayloadType *payload = NULL;
@ -161,7 +175,7 @@
LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
if (enc != LinphoneMediaEncryptionNone) {
[stats appendString:[NSString
stringWithFormat:@"Call encrypted using %s", linphone_media_encryption_to_string(enc)]];
stringWithFormat:@"Call encrypted using %@", [self.class mediaEncryptionToString:enc]]];
}
[stats appendString:[self updateStatsForCall:call stream:LinphoneStreamTypeAudio]];

View file

@ -20,9 +20,9 @@
<rect key="frame" x="0.0" y="42" width="375" height="625"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" alpha="0.69999999999999973" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="100" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="ZYY-EM-M2s" userLabel="statsLabel">
<label opaque="NO" userInteractionEnabled="NO" alpha="0.69999999999999973" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="100" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" id="ZYY-EM-M2s" userLabel="statsLabel">
<rect key="frame" x="0.0" y="0.0" width="300" height="625"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<string key="text">Audio: upr
Video: down</string>

View file

@ -575,9 +575,9 @@
statusBarFrame.origin.y = origin - statusBarFrame.size.height;
}
// 2. side menu - fixed size, always starting below status bar (hack: gexcept in fullscreen)
// 2. side menu - fixed size, always starting below status bar (hack: except in fullscreen)
CGRect sideMenuFrame = viewFrame;
sideMenuFrame.origin.y = origin + (fullscreen ? statusBarFrame.size.height : 0);
sideMenuFrame.origin.y = origin + (currentViewDescription.fullscreen ? 0 : statusBarFrame.size.height);
sideMenuFrame.size.height -= sideMenuFrame.origin.y;
if (!currentViewDescription.sideMenuEnabled) {
// really hide; -width won't be enough since some animations may use this...