title: Use camera in landscape when my app is in portrait
body: <p>I've tried every way to accomplish my desired behaviour but nothing seems to work.</p>
  
  <p>My app is <strong>locked in portrait</strong> mode (I don't want a landscape UI) but I want to be able to switch the camera  display to show a <strong>camera preview in portrait and landscape</strong> mode alternatively.</p>
  
  <p><strong>I'm not interested in capturing images.</strong></p>
  
  <p>To show the preview in portrait I simply do:</p>
  
  <pre><code>camera.setDisplayOrientation(90);
  </code></pre>
  
  <p>and my preview works fine, but, when I try to show the camera preview in landscape mode, I do:</p>
  
  <pre><code>camera.setDisplayOrientation(0);
  </code></pre>
  
  <p>and the preview actually rotates, but the image from camera is not rotated, and the final result is just a portrait image rotated to landscape.</p>
  
  <p>I've tried every way:</p>
  
  <p>1) rotate the camera with <code>parameters.setRotation()</code> but this affects only the final image saved and has nothing to do with the preview;</p>
  
  <p>2) set <code>parameters.set("orientation", "landscape")</code> but this seems to have no effect (maybe an old and not yet supported command?);</p>
  
  <p>3) set every combination of the methods below, but nothing, the only way to effectively rotate the image originate from camera seems to be physically rotate my device…</p>
  
  <p>This is a practical demonstration of what I mean:</p>
  
  <p><a href="https://i.stack.imgur.com/jdyGQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jdyGQ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/M55SY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M55SY.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Zm7PZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zm7PZ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/AGYTe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AGYTe.png" alt="enter image description here"></a></p>
  
  <p>As you can see, <code>parameters.setRotation()</code> do <strong>not have effect</strong> on the preview, that is correct when is in portrait, but is simply rotate in landscape 'cause the camera don't rotate itself, but just place the portrait image rotated.</p>
  
  <p>So, is there a way to show a camera preview in landscape when the app is in portrait?</p>
  
  <p>Thanks.</p>