title: Issue with video recorder
body: <p>i am doing a application to record video.I got many samples that are working but issue is while recording camera is not opening in portrait mode, it is opening another mode
  This is the sample i have used including xml file:</p>
  
  <pre><code>package com.example.RecordVideo;
  
      import java.io.File;
  
      import android.app.Activity;
      import android.graphics.Camera;
      import android.media.MediaRecorder;
      import android.os.Bundle;
      import android.util.Log;
      import android.view.Surface;
      import android.view.SurfaceHolder;
      import android.view.View;
      import android.view.View.OnClickListener;
      import android.widget.Button;
      import android.widget.MediaController;
      import android.widget.VideoView;
      public class MainActivity extends Activity implements SurfaceHolder.Callback, OnClickListener {
      private MediaRecorder recorder = null;
      private static final String OUTPUT_FILE = "/sdcard/videooutput.mp4";
      private static final String TAG = "RecordVideo";
      private VideoView videoView = null;
      private Button startBtn = null;
      Button endBtn;
      Button playRecordingBtn;
      Button stpPlayingRecordingBtn;
      SurfaceHolder mholder;
      File outFile ;
      Camera camera;
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.recordvideo);
  
      startBtn = (Button) findViewById(R.id.bgnBtn);
      startBtn.setOnClickListener(this);
      endBtn = (Button) findViewById(R.id.stpBtn);
      endBtn.setOnClickListener(this);
      endBtn.setEnabled(false);
      playRecordingBtn = (Button) findViewById(R.id.playRecordingBtn);
      playRecordingBtn.setOnClickListener(this);
      stpPlayingRecordingBtn =(Button) findViewById(R.id.stpPlayingRecordingBtn);
      stpPlayingRecordingBtn.setOnClickListener(this);
      videoView = (VideoView)this.findViewById(R.id.videoView);
      playRecordingBtn.setEnabled(false);
      stpPlayingRecordingBtn.setEnabled(false);
      mholder = videoView.getHolder();
      mholder.addCallback(this);
      mholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
          }
      //  @Override
          public void surfaceCreated(SurfaceHolder holder) {
          //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);    
          startBtn.setEnabled(true);
          }
      //  @Override
          public void surfaceDestroyed(SurfaceHolder holder) {
          }
      //  @Override
          public void surfaceChanged(SurfaceHolder holder, int format, int width,
          int height) {
          Log.v(TAG, "Width x Height = " + width + "x" + height);
          }
          private void playRecording() {
          MediaController mc = new MediaController(this);
          videoView.setMediaController(mc);
          videoView.setVideoPath(OUTPUT_FILE);
          videoView.start();
          }
          private void stopPlayingRecording() {
          videoView.stopPlayback();
          }
          private void stopRecording() throws Exception {
          if (recorder != null) {
          recorder.stop();
          }
          }
          @Override
          protected void onDestroy() {
          super.onDestroy();
          if (recorder != null) {
          recorder.release();
          }
          }
          private void beginRecording(SurfaceHolder holder) throws Exception {
          if(recorder!=null)
          {
          recorder.stop();
          recorder.release();
  
          }
          outFile = new File(OUTPUT_FILE);
          if(outFile.exists())
          {
          outFile.delete();
          }
          try {
  
          recorder = new MediaRecorder();
          recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
          recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
          recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
          recorder.setVideoSize(480, 580);
          recorder.setVideoFrameRate(15);
  
          recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
          recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
          recorder.setMaxDuration(60000*10); // limit to 10 minutes
          recorder.setPreviewDisplay(mholder.getSurface());
          recorder.setOutputFile(OUTPUT_FILE);
          recorder.prepare();
          recorder.start();
          }
          catch(Exception e) {
          Log.e(TAG, e.toString());     
          e.printStackTrace();
          }
          }
          public Surface getSurface()
          {
              return mholder.getSurface();
          }
          public void onClick(View v) {
              // TODO Auto-generated method stub
              if(v.equals(startBtn))
              {
                  try {
                      endBtn.setEnabled(true);
                      startBtn.setEnabled(false);
                      playRecordingBtn.setEnabled(false);
                      stpPlayingRecordingBtn.setEnabled(false);
                      beginRecording(mholder);
                      } catch (Exception e) {
                      Log.e(TAG, e.toString());
                      e.printStackTrace();
                      }
              }
              if(v.equals(endBtn))
              {
                  try {
                      startBtn.setEnabled(false);
                      endBtn.setEnabled(false);
                      playRecordingBtn.setEnabled(true);
                      stpPlayingRecordingBtn.setEnabled(false);
                  stopRecording();
                  } catch (Exception e) {
                  Log.e(TAG, e.toString());
                  e.printStackTrace();
                  }
              }
              if(v.equals(playRecordingBtn))
              {
                  try {
                      startBtn.setEnabled(false);
                      endBtn.setEnabled(false);
                      playRecordingBtn.setEnabled(false);
                      stpPlayingRecordingBtn.setEnabled(true);
                  playRecording();
                  } catch (Exception e) {
                  Log.e(TAG, e.toString());
                  e.printStackTrace();
                  }
              }
              if(v.equals(stpPlayingRecordingBtn))
              {
                  try {
                      startBtn.setEnabled(false);
                      endBtn.setEnabled(false);
                      playRecordingBtn.setEnabled(true);
                      stpPlayingRecordingBtn.setEnabled(false);
                  stopPlayingRecording();
                  } catch (Exception e) {
                  Log.e(TAG, e.toString());
                  e.printStackTrace();
                  }
              }
          }
      }
  </code></pre>
  
  <p>XML file is:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   &gt;
   &lt;VideoView
          android:id="@+id/videoView"
          android:layout_width="480px"
          android:layout_height="580px"
          android:keepScreenOn="true" 
          /&gt;
          &lt;LinearLayout 
   android:orientation="horizontal"
   android:layout_width="fill_parent"
   android:layout_height="80px"
   &gt;
          &lt;Button
   android:id="@+id/bgnBtn"
   android:layout_width="150px"
   android:layout_marginLeft="80px"
   android:layout_height="wrap_content"
   android:text="Start"
   /&gt;
  &lt;Button
   android:id="@+id/stpBtn"
   android:layout_width="150px"
    android:layout_marginLeft="40px"
   android:layout_height="wrap_content"
   android:text="Cancel"
   /&gt;
   &lt;/LinearLayout&gt;
   &lt;LinearLayout 
   android:orientation="horizontal"
   android:layout_width="fill_parent"
   android:layout_height="80px"
   &gt;
          &lt;Button
   android:id="@+id/playRecordingBtn"
   android:layout_width="150px"
   android:layout_marginLeft="80px"
   android:layout_height="wrap_content"
   android:text="Play"
   /&gt;
  &lt;Button
   android:id="@+id/stpPlayingRecordingBtn"
   android:layout_width="150px"
    android:layout_marginLeft="40px"
   android:layout_height="wrap_content"
   android:text="Stop"
   /&gt;
   &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>i add permissions also,
   What i want is
        1. video recording should be opened in PORTRAIT mode 
         2. is video cropping possible in android</p>
  
  <p>Please Help me. Thanks in advance</p>