What is the process involved in calculating the resolution of image to be displayed when the screen of my phone(android) is rotated? My screen resolution is 1920x1080. It displays some videos only in the center while top and bottom of the video are blacked(when phone is held vertical), where as full screen video is shown when phone is held in horizontal position.

  • 1
    $\begingroup$ I don't quite understand. What's the problem, or what are you trying to achieve? $\endgroup$ – Dan Hulme Feb 9 '18 at 8:29
  • $\begingroup$ when I am using phone to watch a video it plays in full screen (1920x1080), but when I tilt it(rotate) the video will be played only in part of the screen, the rest of the areas of screen is black. I wanted to know whether the resolution of image(video) is changed to achieve this! If so how does this happen. Think in terms of aspect ratio or some thing like that $\endgroup$ – Charan K Feb 9 '18 at 16:08

Usually the resolution of the video is changed on-the-fly to match the size being displayed. So if you have video that has a 16:9 aspect ratio and 1920 x 1080 pixels and you turn your phone into the vertical position, you'll now have a width of 1080 pixels instead of height. So the width changed from 1920 to 1080. Now you have to figure out how to change the height by the same ratio:

newHeight = 1080 * (1080 / 1920)

Or, using the aspect ratio of the footage:

newHeight = 1080 * (9 / 16)

So the new height would be 607.5, but it probably gets rounded up to 608 since that's an even number. So now, when each frame is displayed, it first gets scaled down (probably using the GPU since it's very fast at that) from 1920 x 1080 to 1080 x 608.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.