title: How to make android TextureView to show video in correct orientation
body: <p>I want to use Android_4.1 MediaCodec API to encode video data which captured from Camera,then decode the video data  and show the video on TextureView. Now everything is OK,but the TextureView could not show the decoded video in correct oritentation. Please look at these two pictures.</p>
  
  <p>1.Figure1</p>
  
  <p><img src="https://i.stack.imgur.com/CVqoK.png" alt="enter image description here"></p>
  
  <p>2.Figure2</p>
  
  <p><img src="https://i.stack.imgur.com/IQHcf.png" alt="enter image description here"></p>
  
  <p>TextureView in figure1 shows What I want orientation.This TextureView called <strong>setRotation(90)</strong>.But it does not alwalys work.If I set this TextureView "match_parent/fill_parent/full_screen",and also <strong>setRotation(90)</strong>,it does not work.</p>
  
  <p>Here is my Camera's parameters:</p>
  
  <pre><code>    mCamera.setDisplayOrientation(90);
      Parameters parameters = mCamera.getParameters();
      parameters.setPreviewFormat(ImageFormat.NV21);
      parameters.setPreviewSize(640, 480);
      mCamera.setParameters(parameters);
      getSupportedCameraParams();
  </code></pre>
  
  <p>I have tried to set the <strong>TextureView's width = screenHeight and height = screenWidth</strong>, also I have tried to set <strong>parameters.setPreviewSize(480, 640)</strong> ,but they do not work.</p>
  
  <p>My question is <strong>how I should do to make the fullscreen TextureView to show the video in correct orientation</strong> ?</p>
  
  <p>I'm not good at English,I hope you can understand me.</p>
  
  <p>Any help would be appreciated.Thank you!</p>