mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
Merge pull request #7571 from panxiaochun:CvVideoCamera_stop
This commit is contained in:
commit
6c12533160
@ -203,11 +203,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self.captureSession stopRunning];
|
[self.captureSession stopRunning];
|
||||||
self.captureSession = nil;
|
[captureSession release];
|
||||||
}
|
}
|
||||||
|
|
||||||
self.captureVideoPreviewLayer = nil;
|
[captureVideoPreviewLayer release];
|
||||||
self.videoCaptureConnection = nil;
|
[videoCaptureConnection release];
|
||||||
captureSessionLoaded = NO;
|
captureSessionLoaded = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,31 +129,33 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
|
|||||||
|
|
||||||
- (void)stop;
|
- (void)stop;
|
||||||
{
|
{
|
||||||
[super stop];
|
if (self.running == YES) {
|
||||||
|
[super stop];
|
||||||
|
|
||||||
self.videoDataOutput = nil;
|
[videoDataOutput release];
|
||||||
if (videoDataOutputQueue) {
|
if (videoDataOutputQueue) {
|
||||||
dispatch_release(videoDataOutputQueue);
|
dispatch_release(videoDataOutputQueue);
|
||||||
}
|
|
||||||
|
|
||||||
if (self.recordVideo == YES) {
|
|
||||||
if (self.recordAssetWriter) {
|
|
||||||
if (self.recordAssetWriter.status == AVAssetWriterStatusWriting) {
|
|
||||||
[self.recordAssetWriter finishWriting];
|
|
||||||
NSLog(@"[Camera] recording stopped");
|
|
||||||
} else {
|
|
||||||
NSLog(@"[Camera] Recording Error: asset writer status is not writing");
|
|
||||||
}
|
|
||||||
self.recordAssetWriter = nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.recordAssetWriterInput = nil;
|
if (self.recordVideo == YES) {
|
||||||
self.recordPixelBufferAdaptor = nil;
|
if (self.recordAssetWriter) {
|
||||||
}
|
if (self.recordAssetWriter.status == AVAssetWriterStatusWriting) {
|
||||||
|
[self.recordAssetWriter finishWriting];
|
||||||
|
NSLog(@"[Camera] recording stopped");
|
||||||
|
} else {
|
||||||
|
NSLog(@"[Camera] Recording Error: asset writer status is not writing");
|
||||||
|
}
|
||||||
|
[recordAssetWriter release];
|
||||||
|
}
|
||||||
|
|
||||||
if (self.customPreviewLayer) {
|
[recordAssetWriterInput release];
|
||||||
[self.customPreviewLayer removeFromSuperlayer];
|
[recordPixelBufferAdaptor release];
|
||||||
self.customPreviewLayer = nil;
|
}
|
||||||
|
|
||||||
|
if (self.customPreviewLayer) {
|
||||||
|
[self.customPreviewLayer removeFromSuperlayer];
|
||||||
|
self.customPreviewLayer = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user