Page 1 of 1

setVideoSurface() method exeption

Posted: 01 Aug 2015 15:50
by Steiner
Hi, I try to use LibVLC as part of appliction for Android TV (UDP stream player for Tv Input framework-TIF).
TIF provide me Surface and I try setup it in LibVLC based player:

Code: Select all

@Override public boolean onSetSurface(Surface surface) { if (mPlayer != null) { final IVLCVout vlcVout = mPlayer.getVLCVout(); vlcVout.setVideoSurface(surface, null); vlcVout.attachViews(); return vlcVout.areViewsAttached(); } mSurface = surface; return true; }
The Javadoc for setVideoSurface method says:
* @param videoSurface if surfaceHolder is null, this surface must be valid and attached.
* @param surfaceHolder optional, used to configure buffers geometry before Android ICS
* and to get notified when surface is destroyed.
But? I handle this Exeption:
java.lang.IllegalStateException: surface is not attached and holder is null
at org.videolan.libvlc.AWindow.setSurface(AWindow.java:248)
at org.videolan.libvlc.AWindow.setVideoSurface(AWindow.java:270)
...
I am not shure, but think in a metho setSurface in class AWindow:

Code: Select all

private void setSurface(int id, Surface surface, SurfaceHolder surfaceHolder) { ... if (!surface.isValid() || surfaceHolder == null) throw new IllegalStateException("surface is not attached and holder is null"); ... }
This symbols || need change on this &&
Or another solution?

Re: setVideoSurface() method exeption

Posted: 30 Oct 2015 19:36
by Jean-Baptiste Kempf
This fix seems correct.

Re: setVideoSurface() method exeption

Posted: 02 Nov 2015 10:19
by Jean-Baptiste Kempf