喂,我在iOS開發的新手,我已經endountered一些問題AVAssetWriter東西泄漏
我喜歡的對象AVAssetWriter的一些設置(我用它來寫pixelmaps 作爲幀視頻 - 和它的作品確定)
self.assetWriter = [[AVAssetWriter alloc] initWithURL:outputPath fileType:AVFileTypeQuickTimeMovie error:&error];
NSMutableDictionary *dic=[[NSMutableDictionary alloc] init];
[dic setValue: AVVideoCodecH264 forKey: AVVideoCodecKey];
[dic setValue:[NSNumber numberWithInt:640] forKey:AVVideoWidthKey];
[dic setValue:[NSNumber numberWithInt:480] forKey:AVVideoHeightKey];
self.assetWriterInput = [[AVAssetWriterInput alloc] initWithMediaType:AVMediaTypeVideo outputSettings:dic];
[dic release];
assetWriterInputPixelBufferAdaptor =[[AVAssetWriterInputPixelBufferAdaptor alloc] initWithAssetWriterInput:assetWriterInput sourcePixelBufferAttributes:nil];
self.assetWriterInput.expectsMediaDataInRealTime=YES;
[self.assetWriter addInput:assetWriterInput];
[self.assetWriter startWriting];
[self.assetWriter startSessionAtSourceTime:recordStartTime];
那麼之後我保存的視頻,然後後,我釋放實例
[self.assetWriterInput markAsFinished];
[self.assetWriter endSessionAtSourceTime:recordStartTime];
[self.assetWriter finishWriting];
CVPixelBufferPoolRelease(assetWriterInputPixelBufferAdaptor.pixelBufferPool);
[self.assetWriter release];
[self.assetWriterInput release];
[self.assetWriterInputPixelBufferAdaptor release];
麻煩的是,儀器告訴我,當泄漏我使用上面的對幾次來創建和發佈實例來保存一些視頻
幫助!
儀器中的泄漏痕跡是否表明泄漏與您的代碼有關?你有沒有對你的代碼進行靜態分析? – 2011-05-29 05:44:49