I did a lot of googling about hardware scaling, here's what i learned :<br><br>In android, a SurfaceView(java) use a SurfaceComposerClient(native) to manage the low level surface (the input buffer), and this SurfaceComposerClient communicate with the SurfaceFlinger Service, which display/scale using hardware if available.<br>
<br>Right now vlc-android native code has only the input buffer, with the same size as the SurfaceView.<br><br>So we need the SurfaceComposerClient to do something. I though we don't have it, but i was wrong. it is in fact the SurfaceHolder in java.<br>
<br>From there, it's easy : holder.setFixedSize(320, 176) in java code will fix the input buffer size. When the time comes for android to display it, SurfaceComposerClient/SurfaceFlingerService, seeing that the buffer size don't match the SurfaceView size, decide to do what he can => hardware scaling.<br>
<br>TODO:<br>- send the SurfaceComposerClient hidden inside SurfaceHolder into our native code (similar to the Surface)<br>- set the buffer size to the video size<br>- remove pixman and all scaling stuff<br>- handle AR stuff in java, by setting the SurfaceView size<br>
<br>I'll work on it soon.<br><br><div class="gmail_quote">On Thu, May 19, 2011 at 11:34 AM, XilasZ <span dir="ltr"><<a href="mailto:xilasz@gmail.com">xilasz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
True, it can be handle on java side if libvlc can provide the original video size.<br><br>I already wrote a piece of code for my own player which compute the correct surface size, based on video size and screen size/orientation. it works like a charm.<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Thu, May 19, 2011 at 11:20 AM, Ludovic Fauvet <span dir="ltr"><<a href="mailto:etix@l0cal.com" target="_blank">etix@l0cal.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Thu, May 19, 2011 at 11:09 AM, XilasZ <<a href="mailto:xilasz@gmail.com" target="_blank">xilasz@gmail.com</a>> wrote:<br>
> There's a sample on android source code which does just that :<br>
> <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/surfaceflinger/tests/resize/resize.cpp" target="_blank">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/surfaceflinger/tests/resize/resize.cpp</a><br>
<br>
</div>Interesting, but you will probably lose the aspect ratio then.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div>Ludovic Fauvet (etix)<br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>