|
|
|
@ -129,31 +129,33 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} |
|
|
|
|
|
|
|
|
|
- (void)stop; |
|
|
|
|
{ |
|
|
|
|
[super stop]; |
|
|
|
|
if (self.running == YES) { |
|
|
|
|
[super stop]; |
|
|
|
|
|
|
|
|
|
[videoDataOutput release]; |
|
|
|
|
if (videoDataOutputQueue) { |
|
|
|
|
dispatch_release(videoDataOutputQueue); |
|
|
|
|
} |
|
|
|
|
[videoDataOutput release]; |
|
|
|
|
if (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"); |
|
|
|
|
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"); |
|
|
|
|
} |
|
|
|
|
[recordAssetWriter release]; |
|
|
|
|
} |
|
|
|
|
[recordAssetWriter release]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[recordAssetWriterInput release]; |
|
|
|
|
[recordPixelBufferAdaptor release]; |
|
|
|
|
} |
|
|
|
|
[recordAssetWriterInput release]; |
|
|
|
|
[recordPixelBufferAdaptor release]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (self.customPreviewLayer) { |
|
|
|
|
[self.customPreviewLayer removeFromSuperlayer]; |
|
|
|
|
self.customPreviewLayer = nil; |
|
|
|
|
if (self.customPreviewLayer) { |
|
|
|
|
[self.customPreviewLayer removeFromSuperlayer]; |
|
|
|
|
self.customPreviewLayer = nil; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|