video: add test case for video view switching

Define TEST_VIDEO_VIEW_CHANGE + add a view to xib file
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2012-05-09 10:06:56 +02:00
parent 55d2116b58
commit 413e3f824f
2 changed files with 23 additions and 0 deletions

View file

@ -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;

View file

@ -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];
}