title: Android media recorder prepare failed
body: <pre><code>sock = new Socket();
  sock.connect(new InetSocketAddress(addr, port), 2000);
  if(!sock.isConnected()) return false;
  
  file = ParcelFileDescriptor.fromSocket(sock);
  
  camera = Camera.open();
  if(camera == null) return false;
  camera.unlock();
  
  recorder = new MediaRecorder();
  recorder.setCamera(camera);
  recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
  recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
  recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
  recorder.setOutputFile(file.getFileDescriptor());
  recorder.setPreviewDisplay(preview.getHolder().getSurface());// SurfaceView preview
  
  recorder.prepare();
  </code></pre>
  
  <hr>
  
  <p>Manifest:</p>
  
  <pre><code>uses-permission android:name="android.permission.INTERNET"
  uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
  uses-permission android:name="android.permission.CAMERA"
  uses-permission android:name="android.permission.RECORD_AUDIO"
  uses-feature android:name="android.hardware.camera"
  </code></pre>
  
  <p>I always get error <code>prepare failed: -1</code>.</p>
  
  <p>This code is for android > 2.2, tested on Samsung Galaxy S2</p>