diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m
index 392f9ab36..d79e41805 100644
--- a/Classes/IncallViewController.m
+++ b/Classes/IncallViewController.m
@@ -635,20 +635,26 @@ int callCount(LinphoneCore* lc) {
// Call Quality Indicator
UIImageView* callquality = [UIImageView new];
[callquality setFrame:CGRectMake(0, 0, 28, 28)];
- if (linphone_call_get_average_quality(call) >= 4) {
- [callquality setImage: [IncallViewController stat_sys_signal_4]];
- }
- else if (linphone_call_get_average_quality(call) >= 3) {
- [callquality setImage: [IncallViewController stat_sys_signal_3]];
- }
- else if (linphone_call_get_average_quality(call) >= 2) {
- [callquality setImage: [IncallViewController stat_sys_signal_2]];
- }
- else if (linphone_call_get_average_quality(call) >= 1) {
- [callquality setImage: [IncallViewController stat_sys_signal_1]];
+ if (call->state == LinphoneCallStreamsRunning)
+ {
+ if (linphone_call_get_average_quality(call) >= 4) {
+ [callquality setImage: [IncallViewController stat_sys_signal_4]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 3) {
+ [callquality setImage: [IncallViewController stat_sys_signal_3]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 2) {
+ [callquality setImage: [IncallViewController stat_sys_signal_2]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 1) {
+ [callquality setImage: [IncallViewController stat_sys_signal_1]];
+ }
+ else {
+ [callquality setImage: [IncallViewController stat_sys_signal_0]];
+ }
}
else {
- [callquality setImage: [IncallViewController stat_sys_signal_0]];
+ [callquality setImage:nil];
}
if (enc != LinphoneMediaEncryptionNone) {
diff --git a/Classes/VideoViewController.h b/Classes/VideoViewController.h
index 48a728d42..a8958ff9d 100644
--- a/Classes/VideoViewController.h
+++ b/Classes/VideoViewController.h
@@ -51,6 +51,7 @@
@property (nonatomic, retain) IBOutlet UIMuteButton* mMute;
@property (nonatomic, retain) IBOutlet UIHangUpButton* mHangUp;
@property (nonatomic, retain) IBOutlet UICamSwitch* mCamSwitch;
+@property (nonatomic, retain) IBOutlet UIImageView *mCallQuality;
@property (nonatomic, retain) IBOutlet UIView* mLandscapeRight;
@property (nonatomic, retain) IBOutlet UIView* mDisplayLandRight;
@@ -65,4 +66,9 @@
@property (nonatomic, retain) IBOutlet UIMuteButton* mMuteLandLeft;
@property (nonatomic, retain) IBOutlet UIHangUpButton* mHangUpLandLeft;
@property (nonatomic, retain) IBOutlet UICamSwitch* mCamSwitchLandLeft;
+
+- (void) updateCallQualityIndicator;
+
+- (void) waitBeforeUpdatingCallQualityIndicator;
+
@end
\ No newline at end of file
diff --git a/Classes/VideoViewController.m b/Classes/VideoViewController.m
index 56d2476c5..fe4b931a5 100644
--- a/Classes/VideoViewController.m
+++ b/Classes/VideoViewController.m
@@ -28,6 +28,7 @@
@synthesize mMute;
@synthesize mHangUp;
@synthesize mCamSwitch;
+@synthesize mCallQuality;
@synthesize mLandscapeRight;
@synthesize mDisplayLandRight;
@@ -54,6 +55,7 @@
- (void)dealloc
{
+ [mCallQuality release];
[super dealloc];
}
@@ -76,8 +78,38 @@
[mCamSwitch setPreview:mPreview];
[mCamSwitchLandRight setPreview:mPreviewLandRight];
[mCamSwitchLandLeft setPreview:mPreviewLandLeft];
+
+ [self performSelector:@selector(waitBeforeUpdatingCallQualityIndicator) withObject:nil afterDelay:1];
isFirst=TRUE;
}
+
+- (void) waitBeforeUpdatingCallQualityIndicator
+{
+ [self performSelectorOnMainThread:@selector(updateCallQualityIndicator) withObject:nil waitUntilDone:YES];
+
+ [self performSelector:@selector(waitBeforeUpdatingCallQualityIndicator) withObject:nil afterDelay:1];
+}
+
+- (void) updateCallQualityIndicator
+{
+ LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
+
+ if (linphone_call_get_average_quality(call) >= 4) {
+ [mCallQuality setImage: [[UIImage imageNamed:@"stat_sys_signal_4.png"] retain]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 3) {
+ [mCallQuality setImage: [[UIImage imageNamed:@"stat_sys_signal_3.png"] retain]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 2) {
+ [mCallQuality setImage: [[UIImage imageNamed:@"stat_sys_signal_2.png"] retain]];
+ }
+ else if (linphone_call_get_average_quality(call) >= 1) {
+ [mCallQuality setImage: [[UIImage imageNamed:@"stat_sys_signal_1.png"] retain]];
+ }
+ else {
+ [mCallQuality setImage: [[UIImage imageNamed:@"stat_sys_signal_0.png"] retain]];
+ }
+}
-(void) configureOrientation:(UIInterfaceOrientation) oritentation {
@@ -113,6 +145,8 @@
- (void)viewDidUnload
{
+ [mCallQuality release];
+ mCallQuality = nil;
[super viewDidUnload];
// Release any retained subviews of the main view.
diff --git a/Classes/VideoViewController.xib b/Classes/VideoViewController.xib
index f754d3f1a..0ba0cefe2 100644
--- a/Classes/VideoViewController.xib
+++ b/Classes/VideoViewController.xib
@@ -36,11 +36,9 @@
IBCocoaTouchFramework
-
-
- YES
-
- UICamSwitch
- UIButton
-
- preview
- UIView
-
-
- preview
-
- preview
- UIView
-
-
-
- IBProjectSource
- ./Classes/UICamSwitch.h
-
-
-
- UIHangUpButton
- UIButton
-
- IBProjectSource
- ./Classes/UIHangUpButton.h
-
-
-
- UIMuteButton
- UIToggleButton
-
- IBProjectSource
- ./Classes/UIMuteButton.h
-
-
-
- UIToggleButton
- UIButton
-
- IBProjectSource
- ./Classes/UIToggleButton.h
-
-
-
- VideoViewController
- UIViewController
-
- YES
-
- YES
- mCamSwitch
- mCamSwitchLandLeft
- mCamSwitchLandRight
- mDisplay
- mDisplayLandLeft
- mDisplayLandRight
- mHangUp
- mHangUpLandLeft
- mHangUpLandRight
- mLandscapeLeft
- mLandscapeRight
- mMute
- mMuteLandLeft
- mMuteLandRight
- mPortrait
- mPreview
- mPreviewLandLeft
- mPreviewLandRight
-
-
- YES
- UICamSwitch
- UICamSwitch
- UICamSwitch
- UIView
- UIView
- UIView
- UIHangUpButton
- UIHangUpButton
- UIHangUpButton
- UIView
- UIView
- UIMuteButton
- UIMuteButton
- UIMuteButton
- UIView
- UIView
- UIView
- UIView
-
-
-
- YES
-
- YES
- mCamSwitch
- mCamSwitchLandLeft
- mCamSwitchLandRight
- mDisplay
- mDisplayLandLeft
- mDisplayLandRight
- mHangUp
- mHangUpLandLeft
- mHangUpLandRight
- mLandscapeLeft
- mLandscapeRight
- mMute
- mMuteLandLeft
- mMuteLandRight
- mPortrait
- mPreview
- mPreviewLandLeft
- mPreviewLandRight
-
-
- YES
-
- mCamSwitch
- UICamSwitch
-
-
- mCamSwitchLandLeft
- UICamSwitch
-
-
- mCamSwitchLandRight
- UICamSwitch
-
-
- mDisplay
- UIView
-
-
- mDisplayLandLeft
- UIView
-
-
- mDisplayLandRight
- UIView
-
-
- mHangUp
- UIHangUpButton
-
-
- mHangUpLandLeft
- UIHangUpButton
-
-
- mHangUpLandRight
- UIHangUpButton
-
-
- mLandscapeLeft
- UIView
-
-
- mLandscapeRight
- UIView
-
-
- mMute
- UIMuteButton
-
-
- mMuteLandLeft
- UIMuteButton
-
-
- mMuteLandRight
- UIMuteButton
-
-
- mPortrait
- UIView
-
-
- mPreview
- UIView
-
-
- mPreviewLandLeft
- UIView
-
-
- mPreviewLandRight
- UIView
-
-
-
-
- IBProjectSource
- ./Classes/VideoViewController.h
-
-
-
+ 54
+
0
IBCocoaTouchFramework