title: Can't set video quality for media recorder
body: <p>In my code i can't set camcoder profile</p>
  
  <pre><code>private void initRecoreder() {
      File dir = new File(Environment.getExternalStorageDirectory().getPath()
              + "/Registrator/Video/");
  
      recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
      recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      recorder.setMaxDuration(900000);// 15 min
      if (!dir.exists()) {
          dir.mkdirs();
      }
      recorder.setOutputFile(dir.getAbsolutePath() + "video.3gp");
  }
  
  private void prepareRecorder() {
      recorder.setPreviewDisplay(holder.getSurface());
      try {
          recorder.prepare();
      } catch (IllegalStateException e) {
          e.printStackTrace();
          finish();
      } catch (IOException e) {
          e.printStackTrace();
          finish();
      }
  }
  
  @Override
  public void surfaceChanged(SurfaceHolder holder, int format, int width,
          int height) {
  
  }
  
  @Override
  public void surfaceCreated(SurfaceHolder holder) {
      prepareRecorder();
      initRecoreder();
  }
  
  @Override
  public void surfaceDestroyed(SurfaceHolder holder) {
      if (recording) {
          recorder.stop();
          recording = false;
      }
      recorder.release();
      finish();
  }
  </code></pre>
  
  <p>This is my logcat</p>
  
  <pre><code>03-21 11:16:38.660: E/AndroidRuntime(4584): FATAL EXCEPTION: main
  03-21 11:16:38.660: E/AndroidRuntime(4584): java.lang.RuntimeException: Unable to start activity ComponentInfo{mobi.esys.videoregistrator/mobi.esys.videoregistrator.RegistatratorActivity}: java.lang.IllegalStateException
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1968)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread.access$600(ActivityThread.java:127)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.os.Looper.loop(Looper.java:137)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread.main(ActivityThread.java:4507)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at java.lang.reflect.Method.invoke(Method.java:511)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:978)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at dalvik.system.NativeStart.main(Native Method)
  03-21 11:16:38.660: E/AndroidRuntime(4584): Caused by: java.lang.IllegalStateException
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.media.MediaRecorder.setOutputFormat(Native Method)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at mobi.esys.videoregistrator.RegistatratorActivity.initRecoreder(RegistatratorActivity.java:52)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at mobi.esys.videoregistrator.RegistatratorActivity.onCreate(RegistatratorActivity.java:34)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.Activity.performCreate(Activity.java:4469)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
  03-21 11:16:38.660: E/AndroidRuntime(4584):     ... 11 more
  03-21 11:17:02.930: E/MediaRecorder(4671): setOutputFile called in an invalid state(1)
  </code></pre>