title: ViewPager swiping lags when fragment contains camera preview
body: <p>I have a 3-tab setup using a ViewPager and 3 fragments. One of the fragments implements a QR Code Scanner (ZBarScanner), which populates the entire fragment with a live view of the devices camera.</p>
  
  <p>I've found that this camera view causes the user interface to lag heavily. The animations for swiping between tabs are much slower and the apps CPU usage has increased heavily. Running a traceview shows that the 'onPreviewFrame' method of the scanner library is taking up the majority of processor time.</p>
  
  <p>I've tried playing with the offscreenPageLimit - I find that this needs to be set to 2 to keep the camera view alive, otherwise there is incredibly heavy lag when swiping due to repeatedly starting and closing the camera view.</p>
  
  <p>What can I do to reduce the lag this camera preview is creating in my application?</p>
  
  <p>I can post code if it helps, but it is all fairly simplistic.</p>