Closed Bug 1544642 Opened 6 years ago Closed 5 years ago

Using the video frames as a texture on WebGL does not work

Categories

(Core :: Graphics: WebRender, defect)

Unspecified
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: sotaro, Assigned: sotaro)

References

Details

(Whiteboard: [wr-amvp][wr-q2][wr-april])

Attachments

(1 file)

The following WebGL does not work on android, since GeckoSurfaceTexture could bind to only one GL context at once. With WebRender, GeckoSurfaceTexture is soon bounded to sharedGL. It prevent from usage by WebGL.

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Animating_textures_in_WebGL

Assignee: nobody → sotaro.ikeda.g

I saw the following error log.

04-16 12:19:42.819 29455 29747 E GLConsumer: [SurfaceTexture-0-29455-44] attachToContext: GLConsumer is already attached to a context
04-16 12:19:42.819 29455 29747 W System.err: java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
04-16 12:19:42.819 29455 29747 W System.err: at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:290)
04-16 12:19:42.819 29455 29747 W System.err: at org.mozilla.gecko.gfx.GeckoSurfaceTexture.attachToGLContext(GeckoSurfaceTexture.java:90)
04-16 12:19:42.819 29455 29747 W System.err: at org.mozilla.gecko.gfx.GeckoSurfaceTexture$NativeGLBlitHelper.blit(Native Method)
04-16 12:19:42.819 29455 29747 W System.err: at org.mozilla.gecko.gfx.GeckoSurfaceTexture.takeSnapshot(GeckoSurfaceTexture.java:304)
04-16 12:19:42.819 29455 29747 W System.err: at org.mozilla.gecko.gfx.SurfaceAllocatorService$1.sync(SurfaceAllocatorService.java:54)
04-16 12:19:42.819 29455 29747 W System.err: at org.mozilla.gecko.gfx.ISurfaceAllocator$Stub.onTransact(ISurfaceAllocator.java:93)
04-16 12:19:42.819 29455 29747 W System.err: at android.os.Binder.execTransact(Binder.java:565)

CompositorOGL does not cause the problem in this case, but CompositorOGL also does not handle well about contention between CompositorOGL and WebGL. For now, this bug is going to handle the problem same level as to CompositorOGL.

Whiteboard: [wr-amvp][wr-q2][wr-april]
Depends on: 1544703

The contention happens when SurfaceTextureImage is blit by GLBlitHelper::BlitImageToFramebuffer(). SurfaceTextureImage is created only for SurfaceTexture of RemoteDataDecoder. Then the contention happen only for SurfaceTexture of video for now.

https://searchfox.org/mozilla-central/source/gfx/gl/GLBlitHelper.cpp#679

No longer depends on: 1544703

The following diagram shows how video's SurfaceTexture is consumed in content process.
https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_SurfaceAllocatorService_68.pdf

Blocks: 152531, 1544703
No longer blocks: wr-android-mvp
Blocks: wr-android-mvp
No longer blocks: 152531
Blocks: 1546852
Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1620e8962cab
Do not bind SurfaceTexture of video to gl context if it is used by WebGL r=nical
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: