From 413e3f824f4d9524a34925bd502b4c1a3135552a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 9 May 2012 10:06:56 +0200 Subject: [PATCH] video: add test case for video view switching Define TEST_VIDEO_VIEW_CHANGE + add a view to xib file --- Classes/IncallViewController.h | 6 ++++++ Classes/IncallViewController.m | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h index 0d7340568..5edb0f409 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -63,6 +63,9 @@ UIView* videoGroup; UIView* videoView; UIView* videoPreview; +#ifdef TEST_VIDEO_VIEW_CHANGE + UIView* testVideoView; +#endif UIImageView* videoCallQuality; UICamSwitch* videoCameraSwitch; UIActivityIndicatorView* videoUpdateIndicator; @@ -136,6 +139,9 @@ @property (nonatomic, retain) IBOutlet UIView* videoGroup; @property (nonatomic, retain) IBOutlet UIView* videoView; +#ifdef TEST_VIDEO_VIEW_CHANGE +@property (nonatomic, retain) IBOutlet UIView* testVideoView; +#endif @property (nonatomic, retain) IBOutlet UIView* videoPreview; @property (nonatomic, retain) IBOutlet UIImageView* videoCallQuality; @property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch; diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index 3adaf99de..5d3e2901a 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -75,6 +75,7 @@ const NSInteger SECURE_BUTTON_TAG=5; @synthesize videoCameraSwitch; @synthesize videoUpdateIndicator; @synthesize videoWaitingForFirstImage; +@synthesize testVideoView; @synthesize addVideo; @@ -239,6 +240,19 @@ void addAnimationFadeTransition(UIView* view, float duration) { } } +#ifdef TEST_VIDEO_VIEW_CHANGE +// Define TEST_VIDEO_VIEW_CHANGE in IncallViewController.h to enable video view switching testing +-(void) _debugChangeVideoView { + static bool normalView = false; + if (normalView) { + linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView); + } else { + linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)testVideoView); + } + normalView = !normalView; +} +#endif + -(void) enableVideoDisplay { [self orientationChanged:nil]; @@ -270,6 +284,9 @@ void addAnimationFadeTransition(UIView* view, float duration) { done = true; } +#ifdef TEST_VIDEO_VIEW_CHANGE + [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(_debugChangeVideoView) userInfo:nil repeats:YES]; +#endif [self batteryLevelChanged:nil]; }