title: Rendering VLC Video output on Android OpenGL
body: <p>I am trying for weeks to render a vlc streaming to OpenGL on Android.
  I guess I am missing something. Here is what I have so far.</p>
  
  <p>This is my custom class:</p>
  
  <p>public class VLCVideoView extends SurfaceView implements SurfaceHolder.Callback, IVideoPlayer, GLSurfaceView.Renderer</p>
  
  <p>My initialization on VLC:</p>
  
  <pre><code>try {
      // Create a new media player
      libvlc = LibVLC.getInstance();
      libvlc.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL);
      libvlc.eventVideoPlayerActivityCreated(true);
      libvlc.setSubtitlesEncoding("");
      libvlc.setAout(LibVLC.AOUT_OPENSLES);
      libvlc.setVout(LibVLC.VOUT_OPEGLES2);
      //libvlc.setVout(LibVLC.VOUT_ANDROID_SURFACE);
      libvlc.setTimeStretching(true);
      libvlc.setChroma("RV32");
      libvlc.setVerboseMode(true);
      LibVLC.restart(context);
      holder.setFormat(PixelFormat.RGBA_8888);
  
      mSurface = holder.getSurface();
      libvlc.attachSurface(mSurface, this);
  </code></pre>
  
  <p>Implemented the entire GLSurfaceView.Renderer methods:</p>
  
  <pre><code>@Override
  public void onSurfaceCreated(GL10 gl, EGLConfig config)
  
  @Override
  public void onSurfaceChanged(GL10 gl, int width, int height)
  
  @Override
  public void onDrawFrame(GL10 gl)
  </code></pre>
  
  <p>As well, as:</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) for the VLCVideoView
  {
      if (mSurface!= null)
      {
          try {
              Canvas surfaceCanvas = mSurface.lockCanvas(null); 
              if(surfaceCanvas != null)
              {
                  super.onDraw(surfaceCanvas);
                  mSurface.unlockCanvasAndPost(surfaceCanvas);
              }
          } catch (Surface.OutOfResourcesException excp) {
              excp.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I have a rotating cube being draw, but instead of having the streaming frames as textures, it simple appears streaming on a flat surface.</p>
  
  <p>Any clue?</p>