[vlc-devel] Severe A/V asynchronous with hardware acceleration on android

Martin Storsjö martin at martin.st
Mon May 7 11:37:25 CEST 2012

On Mon, 7 May 2012, ScottLin wrote:

> Does samsung galaxy s2 smoothly play 1080p file?
> How about samsung galaxy tab 2?
> Are there special performance hacks for samsung cpu?

I doubt they do via VLC. The problem is, even if we get hw accelerated 
decoding using iomx, there's still a lot of data copying going on, which 
is hard to avoid. (The hw decoder is only available within the mediaserver 
process, and VLC needs the decoded data, so it is copied between the 
processes, giving more overhead than the platform's native video players 
that do everything within the media server.) So it might give a 
performance boost, but it will unfortunately always have more overhead 
than what the native player does.

> Please reference to the attachment.

Thanks, this does explain things a bit.

If you reverted the commit you mentioned, did you have extra garbage at 
the bottom of the video? Since if you had reverted the change, you 
probably got 704 pixels high output even if the video itself only was 688 

Anyway, I think the issue might be solved for you with the following 

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 80d327e..9ac4875 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -460,6 +460,8 @@ static OMX_ERRORTYPE GetPortDefinition(decoder_t 
*p_dec, OmxPort *p_port,
          omx_error = OMX_GetConfig(p_port->omx_handle, 
OMX_IndexConfigCommonOutputCrop, &crop_rect);
          if (omx_error == OMX_ErrorNone)
+            if (!def->format.video.nSliceHeight)
+                def->format.video.nSliceHeight = def->format.video.nFrameHeight;
              p_fmt->video.i_width = crop_rect.nWidth;
              p_fmt->video.i_visible_width = crop_rect.nWidth;
              p_fmt->video.i_height = crop_rect.nHeight;

Please try that - if it works, I'll try to see if it works regression free 
on the other devices I've got access to.

// Martin

More information about the vlc-devel mailing list