Skip to content

Conversation

@SimonIT
Copy link
Member

@SimonIT SimonIT commented May 13, 2025

fixes #110
@dasisdormax Do you mind doing a quick review?

@SimonIT SimonIT requested a review from Copilot July 10, 2025 09:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #110 by updating how the SurfaceTexture’s GL texture is created and managed, ensuring that texture IDs are generated on the rendering thread rather than using a plain int array.

  • Replaced the int[] textures array with an IntBuffer for GL texture ID management.
  • Moved glGenTextures and glBindTexture calls into a Gdx.app.postRunnable to run on the GL thread.
  • Updated getTextureExternal and cleanup to use the new textureBuffer.
Comments suppressed due to low confidence (2)

gdx-video-android/src/com/badlogic/gdx/video/VideoPlayerAndroid.java:145

  • Accessing textureBuffer before it’s initialized can lead to a NullPointerException or stale values in getTextureExternal. Consider pre-allocating the buffer or adding a null-check (or synchronization) to guard against race conditions.
				textureBuffer = BufferUtils.newIntBuffer(1);

gdx-video-android/src/com/badlogic/gdx/video/VideoPlayerAndroid.java:149

  • After binding the external OES texture, set appropriate parameters (e.g., GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, and wrap modes) to ensure correct sampling and prevent default settings from impacting resolution or visual quality.
				Gdx.gl.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureID);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

surface texture resolution does not change

2 participants