title: Rotate an YUV byte array on Android
body: <p>I'm looking to rotate a YUV frame preview recieved from a Preview Callblack, so far I've founded this post which cointains an algorithm to rotate the frame preview but is messing the preview image 
  <a href="https://stackoverflow.com/questions/6853401/camera-pixels-rotated">camera pixels rotated</a></p>
  
  <p>another way to rotate the image will be creating a jpg out of the YUV image, create a bitmap, rotate a bitmap and obtaining the byte array of the bitmap, but I really need the format in YUV (NV21).</p>
  
  <p>FYI. the reason I'm asking this is because I have a camera app that supports rotation, but the frame previews are coming back in landscape mode only.</p>