Why is my CvVideoCamera covering the entire view?

I am using CvVideo Camera this way:

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.videoCamera = [[CvVideoCamera alloc] initWithParentView:imageView];
    self.videoCamera.delegate = self;
    self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;
    self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPresetiFrame960x540;
    self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationPortrait;
    self.videoCamera.defaultFPS = 30;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [self.videoCamera start];
}

      

My storyboard looks like this:

enter image description here

When the image is loaded, the panel is displayed briefly, the rest of the view is white. Then when the camera starts to fill the whole screen. Why is he doing this?

+3


source to share


1 answer


Have you tried with a different parent view?



UIView *camView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 400)];
[self.view addSubview:camView];
self.videoCamera = [[CvVideoCamera alloc] initWithParentView:camView];

      

0


source







All Articles