setVideoSurface() method exeption
Posted: 01 Aug 2015 15:50
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:
The Javadoc for setVideoSurface method says:
This symbols || need change on this &&
Or another solution?
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;
}
But? I handle this Exeption:* @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.
I am not shure, but think in a metho setSurface in class AWindow: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)
...
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");
...
}
Or another solution?