{"id":5773,"date":"2014-04-06T20:18:16","date_gmt":"2014-04-06T20:18:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/06\/how-to-immediately-stop-decoding-in-gpuimage-collection-of-common-programming-errors\/"},"modified":"2014-04-06T20:18:16","modified_gmt":"2014-04-06T20:18:16","slug":"how-to-immediately-stop-decoding-in-gpuimage-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/06\/how-to-immediately-stop-decoding-in-gpuimage-collection-of-common-programming-errors\/","title":{"rendered":"How to immediately stop decoding in GPUImage?-Collection of common programming errors"},"content":{"rendered":"<p>You should listen for UIApplicationWillResignActiveNotification and UIApplicationWillEnterForegroundNotification in the view controller where you are processing the movie:<\/p>\n<pre><code>\/\/ handles the user pressing the home or power button while the camera is onscreen\n[[NSNotificationCenter defaultCenter] addObserver:self\n                                         selector:@selector(didResignActive:)\n                                             name: UIApplicationWillResignActiveNotification\n                                           object:nil];\n\n[[NSNotificationCenter defaultCenter] addObserver:self\n                                         selector:@selector(willEnterForeground:)\n                                             name:UIApplicationWillEnterForegroundNotification\n                                           object:nil];\n<\/code><\/pre>\n<p>Then you should add the appropriate methods to respond to the notifications:<\/p>\n<pre><code>-(void) didResignActive: (NSString *) notification {\n    \/\/stop processing the movie\n}\n\n-(void) willEnterForeground: (NSString *) notification {\n    \/\/ start processing the movie\n}\n<\/code><\/pre>\n<p>I&#8217;m pretty sure you can start processing by calling <code>[movie startProcessing];<\/code> and stop processing with <code>[movie endProcessing];<\/code> but I&#8217;m not positive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You should listen for UIApplicationWillResignActiveNotification and UIApplicationWillEnterForegroundNotification in the view controller where you are processing the movie: \/\/ handles the user pressing the home or power button while the camera is onscreen [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didResignActive:) name: UIApplicationWillResignActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; Then you should add the appropriate methods to respond to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5773","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5773"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5773\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}