[Android] Supporting cropping in the androidsurface video output

Martin Storsjö martin at martin.st
Mon Jul 29 21:08:35 CEST 2013


Hi,

Since b71c85b3d88b8d in vlc.git, the video output has to be able to handle 
cropping when displaying output from the avcodec video decoder. The 
androidsurface vout didn't support this and thus has shown uncropped 
output since. (This obviously isn't too nice.)

The code in VideoPlayerActivity already has some kind of support for 
cropping, but it's only used to crop off the extra alignment at the right 
hand side of the picture. I've tried to extend this to support arbitrary 
cropping as well. This requires changing the IVideoPlayer interface 
though, which would be a breaking API change for anybody using the java 
libvlc APIs - is this acceptable do you think?

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.

Attached is the two patches that fixes things - please comment, I hate 
watching uncropped video :-)

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-androidsurface-Support-cropping.patch
Type: text/x-diff
Size: 4410 bytes
Desc: 
URL: <http://mailman.videolan.org/private/android/attachments/20130729/37284231/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-cropping-in-the-video-output.patch
Type: text/x-diff
Size: 8773 bytes
Desc: 
URL: <http://mailman.videolan.org/private/android/attachments/20130729/37284231/attachment-0003.patch>


More information about the Android mailing list