Skip to content
Snippets Groups Projects
Commit bd704a18 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

LibVLC: AWindow: create the Surface earlier

On VLC 4.0, the Surface need to be created (from any threads) before being
attached.
parent f2718497
No related branches found
No related tags found
No related merge requests found
Pipeline #11827 passed with stage
in 22 minutes and 22 seconds
......@@ -582,7 +582,7 @@ public class AWindow implements IVLCVout {
private SurfaceTextureThread() {
}
private synchronized boolean attachToGLContext(int texName) {
private synchronized boolean createSurface() {
/* Try to re-use the same SurfaceTexture until views are detached. By reusing the same
* SurfaceTexture, we don't have to reconfigure MediaCodec when it signals a video size
* change (and when a new VLC vout is created) */
......@@ -599,6 +599,12 @@ public class AWindow implements IVLCVout {
}
mSurface = new Surface(mSurfaceTexture);
}
return true;
}
private synchronized boolean attachToGLContext(int texName) {
if (!createSurface())
return false;
mSurfaceTexture.attachToGLContext(texName);
mFrameAvailable = false;
mIsAttached = true;
......@@ -677,6 +683,8 @@ public class AWindow implements IVLCVout {
}
private synchronized Surface getSurface() {
if (!createSurface())
return null;
return mSurface;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment