setVideoSurface() method exeption

VLC for Android and Chrome OS specific usage questions
Steiner
New Cone
New Cone
Posts: 6
Joined: 01 Aug 2015 15:28

setVideoSurface() method exeption

Postby Steiner » 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:

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?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: setVideoSurface() method exeption

Postby Jean-Baptiste Kempf » 30 Oct 2015 19:36

This fix seems correct.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: setVideoSurface() method exeption

Postby Jean-Baptiste Kempf » 02 Nov 2015 10:19

Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 19 guests