[Android] Supporting cropping in the androidsurface video output

Martin Storsjö martin at martin.st
Tue Jul 30 20:23:06 CEST 2013


On Tue, 30 Jul 2013, XilasZ wrote:

>       This is fixed by two patches, one for vlc.git and one for the
>       vlc-android repo. For the vlc.git one, I'm not sure if the
>       handling of VOUT_DISPLAY_CHANGE_SOURCE_CROP is totally correct -
>       someone who knows the vlc structure better than me can hopefully
>       comment and see if I'm doing it totally wrong or if it's ok.
> 
> 
> I don't know much about the video core, but it's working fine again with
> your patches after adding one missing change :
> 
> @@ -844,7 +844,7 @@ public class VideoPlayerActivity extends Activity
> implements IVideoPlayer {
>                      dw = (int) (dh * ar);
>                  break;
>              case SURFACE_ORIGINAL:
> -                dh = mVideoHeight;
> +                dh = mVideoVisibleHeight;
>                  dw = (int) vw;
>                  break;
>          }

Oh, oops, thanks for catching this. I amended the patch locally to include 
this.

> Now we have to handle this crop in thumbnail.c too :p

Yeah - I tried having a quick 5 minute look at that today but didn't 
succeed. Actually, it seems like thumbnail.c is the least of the issues, 
it's more that it has to be handled in automatically included 
scalers/converters (I'm surprised they don't seem to handle it at all), 
and in the vmem video output.

// Martin


More information about the Android mailing list