Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to release camera? #3

Open
sergiot opened this issue Jul 23, 2014 · 2 comments
Open

How to release camera? #3

sergiot opened this issue Jul 23, 2014 · 2 comments

Comments

@sergiot
Copy link

sergiot commented Jul 23, 2014

If you open a new window and instantiate the camera, take a picture and then close that window, when opening again always throws an error like this

line = 2;
[ERROR] : message = "<_UIBackdropViewSettingsDark : 0x16dc5ac0>\n averageHue: 0.00\n averageSaturation: 0.00\n averageBrightness: 0.00\n contrast: 0.00\n grayscaleTintLevel: 0.11\n grayscaleTintAlpha: 0.73\n colorTint: (null)\n colorTintAlpha: 1.00\n: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled.\nKey path: adjustingExposure\nObserved object: <AVCaptureFigVideoDevice: 0x16def0b0 [Back Camera][com.apple.avfoundation.avcapturedevice.built-in_video:0]>\nChange: {\n kind = 1;\n new = 0;\n}\nContext: 0x0";
[ERROR] : sourceId = 47308256;

@sergiot
Copy link
Author

sergiot commented Jul 23, 2014

Btw, I was able to fix the issue.

breaks when the context is nil, comment this from BeK0sukeTicameraView.m and recompile.

I can provide a binary file is anyone needs it. Cheers.

/*
[captureDevice addObserver:self
forKeyPath:@"adjustingExposure"
options:NSKeyValueObservingOptionNew
context:nil];
*/

@k0sukey
Copy link
Owner

k0sukey commented Jul 23, 2014

Or, put this code in dealloc section.

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
[device removeObserver:self forKeyPath:@"adjustingExposure"];

k0sukey added a commit that referenced this issue Jul 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants