title: onPreviewFrame returning wrong byte[] length
body: <p>I've trying to get byte-array and copy from there to another array some rows of picture previewing whith <code>onPreviewFrame()</code>. So I prepare Camera and new byte-array</p>
  
  <pre><code>        try {
          if (cam != null) {
  
              Camera.Parameters parameters = cam.getParameters();
              parameters.setPreviewFrameRate(25);
              parameters.setPictureFormat(ImageFormat.JPEG);
              cam.setParameters(parameters);
              cam.setPreviewDisplay(holder);
              cam.startPreview();
  
              arr = new byte[(parameters.getPreviewSize().height)
                      * (parameters.getPreviewSize().width)];
  
              Log.i("" + parameters.getPictureSize().height, "   "
                      + parameters.getPictureSize().width);
  
  
          }
      } catch (IOException e) {
          Log.d("CAMERA", e.getMessage());
      }
  </code></pre>
  
  <p>And Log tell's me :</p>
  
  <p><code>480   640</code></p>
  
  <p>So <code>arr.length = 307200</code></p>
  
  <p>But:</p>
  
  <pre><code>public void onPreviewFrame(byte[] data, Camera camera) {    
      Log.i(arr.length+" ",data.length+"");
  }
  </code></pre>
  
  <p><code>arr.length = 307200</code>
  (which of course means Frame Size = 640*480)</p>
  
  <p>but 
    <code>data.length = 460800</code>
  (and it means Frame Size = 800*576)</p>
  
  <p>And when I try to copy Data to Arr with <code>System.arraycopy(data, 0, arr, 0, arr.length);</code> and then export picture:</p>
  
  <pre><code>FileOutputStream outStream = null;
      try {
          outStream = new FileOutputStream("/sdcard/new.jpg");
  
          Camera.Parameters parameters = cam.getParameters();
          Size size = parameters.getPreviewSize();
  
          YuvImage image = new YuvImage(arr, parameters.getPreviewFormat(),
                  size.width, size.height, null);
          image.compressToJpeg(
                  new Rect(0, 0, image.getWidth(), image.getHeight()), 90,
                  outStream);
  
          outStream.flush();
          outStream.close();
      } catch (FileNotFoundException e) {
          Log.d("CAMERA", e.getMessage());
      } catch (IOException e) {
          Log.d("CAMERA", e.getMessage());
      }
  </code></pre>
  
  <p>Picture become green:</p>
  
  <p><img src="https://i.stack.imgur.com/XpXUq.jpg" alt="enter image description here"></p>
  
  <p>So what I need to do to make data-array become 640*480? Or maybe you know another way to get single row from (for example) Bitmap and add it to another Bitmap?</p>