Skip to content

Decouple aspect ratio from scale

Description

For some reason this bindings lib is not only opinionated about what aspect ratios should be supported, but it also mishandles the scaling by assuming the scaling strategy is bound to the a/r, causing all sorts of issues in VLC Android when you need to control the aspect ratio of your video (i.e. hsbs & htab 3d videos). In reality these should be two separate configurations. Aspect Ratio should apply first. Then, using the resulting dimensions, and the dimensions of the player video container, you apply a scale technique.

Expected behavior

  • I propose these Aspect Ratio behaviors:
    1. Auto (taken from the video dimensions)
    2. Custom (set from user input)
    3. Any number of standard sizes you want to support (unnecessary, IMO, but matches your current support set)
  • Possible toggle for 3D content. Either HSBS (2W:H) or HTAB (W:2H) (optional, solved by supporting custom aspect ratios)
  • I propose these Scale behaviors (Always centered):
    1. Fit (aka contain) - No cropping, scale video uniformly so that one dimension matches the dimension of the container and the other dimension is shorter. No cropping, creates a letterbox / pillarbox.
    2. Fill (aka cover) - Scale video uniformly to fill the entire container, so that one dimension matches the dimension of the container and the other dimension is larger. Crops excess content.
    3. Stretch - Match the container size exactly, scaling nonuniformly (optional, but easy to implement and useful for some applications)
    4. Actual size - Use the raw pixel output after aspect ratio is applied (optional, could be useful for some applications)

App mode

Smartphone

TV

Auto

Edited by Conlan Craft