2015-03-17 9 views
6

में __copy_helper_block_ क्रैश मेरे वीडियो प्रोसेसिंग ऐप में मुझे एक अजीब दुर्घटना है। यह फ़िल्टरिंग के लिए वीडियो & ऑडियो और GPUImage के साथ काम करने के लिए AVFoundation का उपयोग करता है। मैंने कभी भी इस मुद्दे का सामना नहीं किया है, लेकिन इसे ऐप स्टोर में रिलीज़ करने के बाद यह अक्सर क्रैशलिटिक्स में दिखाई दिया।AVFoundation

Thread : Crashed: AVPlayerItemOutput queue 
0 libobjc.A.dylib    0x00000001986f80b4 objc_retain + 20 
1 libsystem_blocks.dylib   0x0000000198d79bf8 _Block_object_assign + 320 
2 AVFoundation     0x0000000186895a34 __copy_helper_block_171 + 36 
3 libsystem_blocks.dylib   0x0000000198d79738 _Block_copy_internal + 384 
4 libdispatch.dylib    0x0000000198d252fc _dispatch_Block_copy + 36 
5 libdispatch.dylib    0x0000000198d2685c dispatch_async + 68 
6 AVFoundation     0x00000001868959ac -[AVPlayerItemVideoOutput _dispatchOutputSequenceWasFlushed] + 112 
7 libdispatch.dylib    0x0000000198d2536c _dispatch_client_callout + 16 
8 libdispatch.dylib    0x0000000198d2e6e8 _dispatch_barrier_sync_f_invoke + 76 
9 AVFoundation     0x00000001868940a8 AVPlayerItemVideoOutput_figVCSequentialAvailable + 196 
10 MediaToolbox     0x000000018a3c16f8 FigVisualContextImageAvailableSequential + 108 
11 MediaToolbox     0x000000018a348ce8 itemremote_postNotificationWithPayload + 3996 
12 MediaToolbox     0x000000018a342d60 FigPlayerRemoteCallbacksServer_SendNotifyPing + 924 
13 MediaToolbox     0x000000018a342998 _XSendNotifyPing + 60 
14 MediaToolbox     0x000000018a33f0d4 figmoviecallbacks_server + 112 
15 MediaToolbox     0x000000018a33f018 fpr_ClientPortCallBack + 208 
16 CoreFoundation     0x0000000187f44ce0 __CFMachPortPerform + 180 
17 CoreFoundation     0x0000000187f598fc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 
18 CoreFoundation     0x0000000187f5985c __CFRunLoopDoSource1 + 436 
19 CoreFoundation     0x0000000187f577dc __CFRunLoopRun + 1640 
20 CoreFoundation     0x0000000187e851f4 CFRunLoopRunSpecific + 396 
21 GraphicsServices    0x00000001910135a4 GSEventRunModal + 168 
22 UIKit       0x000000018c7b6784 UIApplicationMain + 1488 
23 MerryVideoEditor    0x000000010024b804 main (main.m:16) 
24 libdyld.dylib     0x0000000198d4ea08 start + 4 

यह मैं कैसे AVFoundationGPUImage से कनेक्ट है:: यहाँ दुर्घटना के लॉग है

class ProjectEditorViewController: UIViewController { 
    private var videoPlayerView = VideoPlayerView() 
    private var movieFile: GPUImageMovie! 
    private var currentComposition: AVComposition! 
    //...and other properties 
} 

// MARK: - Filtering & Playback 
extension ProjectEditorViewController{ 
    func updatePlayer() { 

     currentFilter.removeAllTargets() 
     movieFile?.removeAllTargets() 
     movieFile?.endProcessing() 

     let time = self.videoPlayerView.player?.currentItem.currentTime() ?? kCMTimeZero 

     let (composition, audioMix) = compositionBuilder.buildCompositionFromTimeLine(timeLine) 
     videoPlayerView.setAsset(composition) 
     videoPlayerView.playerItem.audioMix = audioMix 

     movieFile = GPUImageMovie(playerItem: videoPlayerView.player.currentItem) 
     currentFilter.applyFromOutput(movieFile, toInput: gpuPlayerView) 
     movieFile.startProcessing() 

     addSyncLayerIfNeededForComposition(composition) 

     videoPlayerView.player.seekToTime(time, toleranceBefore: kPlayerToleranceSeekTime, toleranceAfter: kPlayerToleranceSeekTime) 
     currentComposition = composition 

    } 

    func updatePlayerFilter(){   
     if movieFile != nil{ 
     movieFile.removeAllTargets() 
     currentFilter.applyFromOutput(movieFile, toInput: gpuPlayerView) 
     if(!videoPlayerView.isPlaying) { movieFile.startProcessing() } 
     addSyncLayerIfNeededForComposition(currentComposition) 
     }else{ 
     updatePlayer() 
     } 
    }  
} 
कोई भी विचार क्या मेरी कोड के साथ गलत है

? किसी भी प्रश्न, टिप्पणियां, संकेत और उत्तरों की अत्यधिक सराहना की जाती है।

+0

हम अभी हमारे ऐप में एक ही क्रैश में आए हैं जो वीडियो प्रोसेसिंग के लिए GPUImage का उपयोग करता है - बस सोच रहा है कि क्या आपको कोई फिक्स ढूंढने का कोई भाग्य है? – Greg

उत्तर

6

यह GPUImageMovie में एक मुद्दा है अनदेखी। बाद में, इसका परिणाम deallocated ऑब्जेक्ट (outputSequenceWasFlushed:) से एक विधि कॉल में होता है और आपको क्रैश मिलता है। यह NSZombie डिटेक्टर की मदद से मिला था और मैं GPUImageMovie dealloc विधि में इस जोड़कर तय: [playerItemOutput setDelegate:nil queue:nil];

गुड लक, निकिता;)

0

जंगली अनुमान: कुछ smartass 8.x किसी तरह मैं बात यह "बस काम" हो सकता है 7.x में में AVFoundation में कुछ तोड़ दिया मेरी सिद्धांत बाहर धूपदान अगर bugreporter इस (वे शुरू कर देंगे से निपटने के लिए दा तरीका है जब GPUImageMovie उदाहरण deallocating है [playerItemOutput setDelegate:self queue:videoProcessingQueue], playerItemOutput अपने प्रतिनिधि जारी नहीं करता है: जब उदाहरण AVPlayerItemVideoOutput प्रतिनिधि के रूप में खुद को कहते हैं - नए बग रिपोर्ट तुरंत)

0

मैं इगोर से सहमत हैं, लेकिन playerItemOutput सेट करते समय 'nil को रों प्रतिनिधि नहीं था' टी मेरी मदद करो। तो मैं displayLink अमान्य के बाद endProcessing विधि में

runSynchronouslyOnVideoProcessingQueue(^{ 

    [playerItemOutput setDelegate: nil 
          queue: nil]; 
    [_playerItem removeOutput: playerItemOutput]; 
    playerItemOutput = nil; 
    }); 

गयी।

उम्मीद है कि मदद करता है।

संबंधित मुद्दे