Closed
Bug 1395497
Opened 7 years ago
Closed 7 years ago
WebGL video textures issues for Firefox 55 in android
Categories
(Firefox for Android Graveyard :: Audio/Video, defect)
Tracking
(firefox55 wontfix, firefox56 wontfix, firefox57 wontfix, firefox58 wontfix, firefox59 fixed)
RESOLVED
FIXED
Firefox 59
People
(Reporter: aelboudali, Assigned: snorp)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(3 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Steps to reproduce:
When visiting :
https://krpano.com/ios/bugs/ios8-webgl-video-performance/
The html5 video was playing normally on Firefox 54. Upon updating to Firefox 55 on android the video no longer works and displays a black screen.
Actual results:
The video WebGL texture seems to no longer be playing on Firefox for Android. The sound is playing well, but the screen remains black.
Expected results:
The video WebGL texture should be able to be seen just.
Updated•7 years ago
|
Component: General → Audio/Video
OS: Unspecified → Android
Hardware: Unspecified → All
Comment 1•7 years ago
|
||
I was able to reproduce this on all branches with Oneplus Two (Android 6.0.1) and Motorola Nexus 6 (Android 7.1.1). Marking as New.
Notes: on Chrome is not reproducible.
Status: UNCONFIRMED → NEW
status-firefox55:
--- → affected
status-firefox56:
--- → affected
status-firefox57:
--- → affected
Ever confirmed: true
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Assignee: nobody → snorp
Assignee | ||
Comment 6•7 years ago
|
||
These patches make the situation better. There are some caveats:
1) We do not attempt to handle the situation where both the compositor and canvas (either WebGL or 2d) are trying to consume a video. We know from past experience that trying to quickly switch between to GL contexts results in problems.
2) This won't work in E10s because we won't be able to access the SurfaceTexture in the content process. To fix that, we could create the SurfaceTexture for the video in the content process, then blit that to another SurfaceTexture that lives in the parent process.
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8912985 [details]
Bug 1395497 - Modify ScopedBindTexture to allow save/restore
https://reviewboard.mozilla.org/r/184346/#review189470
Modify ScopedBindTexture.
::: gfx/gl/ScopedGLHelpers.cpp:477
(Diff revision 1)
> +}
> +
> +void
> +ScopedTextureBindingState::UnwrapImpl()
> +{
> + mGL->fBindTexture(mBinding, mValue);
This doesn't work at all!
LOCAL_GL_TEXTURE_BINDING_2D: 0x8069
LOCAL_GL_TEXTURE_2D: 0x0DE1
Attachment #8912985 -
Flags: review?(jgilbert) → review-
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8912986 [details]
Bug 1395497 - Create SurfaceTexture in detached state, attach on first use
https://reviewboard.mozilla.org/r/184348/#review189476
Attachment #8912986 -
Flags: review?(jgilbert) → review+
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review189474
::: gfx/gl/GLBlitHelper.cpp:75
(Diff revision 1)
> + uniform mat4 uTexTransform; \n\
> + \n\
> + void main(void) \n\
> + { \n\
> + FRAG_COLOR = TEXTURE(uTex0, \n\
> + (uTexTransform * vec4(vTexCoord0, 0.0, 1.0)).xy); \n\
This should be in the vert shader.
We should just be uploading a matrix to the vs instead of the current mess of vec2s, though that does mean dealing with constructing matrices in c++.
I can do this for you.
::: gfx/gl/GLBlitHelper.cpp:687
(Diff revision 1)
> +
> + ScopedTextureBindingState boundTex(mGL, LOCAL_GL_TEXTURE_BINDING_EXTERNAL);
> + surfaceTexture->UpdateTexImage();
> +
> + gfx::Matrix4x4 transform;
> + AndroidSurfaceTexture::GetTransformMatrix(java::sdk::SurfaceTexture::Ref::From(surfaceTexture), transform);
GetTransformMatrix should take a gfx::Matrix4x4*, not gfx::Matrix4x4&.
Attachment #8912987 -
Flags: review?(jgilbert) → review-
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8912985 [details]
Bug 1395497 - Modify ScopedBindTexture to allow save/restore
https://reviewboard.mozilla.org/r/184346/#review189658
Quick drive-by comments about two issues found by our static analysis bot.
::: gfx/gl/ScopedGLHelpers.h:344
(Diff revision 1)
> +protected:
> + GLenum mBinding;
> + GLuint mValue;
> +
> +public:
> + ScopedTextureBindingState(GLContext* aGL, GLenum state = LOCAL_GL_TEXTURE_BINDING_2D);
Our static analysis bot found a problem at this line:
Error: Bad implicit conversion constructor for 'ScopedTextureBindingState' [clang-tidy: mozilla-implicit-constructor]
Note: Consider adding the explicit keyword to the constructor
::: gfx/gl/ScopedGLHelpers.cpp:467
(Diff revision 1)
> }
>
> ////////////////////////////////////////////////////////////////////////
> +// ScopedTextureBindingState
> +
> +ScopedTextureBindingState::ScopedTextureBindingState(GLContext* gl, GLenum binding)
Our static analysis bot found a problem at this line:
Error: Bad implicit conversion constructor for 'ScopedTextureBindingState' [clang-tidy: mozilla-implicit-constructor]
Note: Consider adding the explicit keyword to the constructor
Assignee | ||
Comment 11•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8912985 [details]
Bug 1395497 - Modify ScopedBindTexture to allow save/restore
https://reviewboard.mozilla.org/r/184346/#review189470
Ok, do you have a suggestion on what you would like to see? Maybe another constructor with no texture name for the save/restore case?
> This doesn't work at all!
> LOCAL_GL_TEXTURE_BINDING_2D: 0x8069
> LOCAL_GL_TEXTURE_2D: 0x0DE1
Whoops! You're right, of course. That's what I get for trying to clean up the manual fGetIntegerv/fBindTexture pair I had :)
Assignee | ||
Comment 12•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review189474
> GetTransformMatrix should take a gfx::Matrix4x4*, not gfx::Matrix4x4&.
Any particular reason why? I chose a reference because otherwise we should null check it. We seem to use both quite a bit in gfx code.
Assignee | ||
Comment 13•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review189474
> This should be in the vert shader.
> We should just be uploading a matrix to the vs instead of the current mess of vec2s, though that does mean dealing with constructing matrices in c++.
>
> I can do this for you.
This is the same way we've handled this texture transform in the compositor since forever, and the same way it worked in the previous GLBlitHelper implementation. I guess doing it in the vs could perform better, but that's scope creep for this patch.
Comment 14•7 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #13)
> Comment on attachment 8912987 [details]
> Bug 1395497 - Add SurfaceTexture impl in GLBlitHelper
>
> https://reviewboard.mozilla.org/r/184350/#review189474
>
> > This should be in the vert shader.
> > We should just be uploading a matrix to the vs instead of the current mess of vec2s, though that does mean dealing with constructing matrices in c++.
> >
> > I can do this for you.
>
> This is the same way we've handled this texture transform in the compositor
> since forever, and the same way it worked in the previous GLBlitHelper
> implementation. I guess doing it in the vs could perform better, but that's
> scope creep for this patch.
This is API/architecture creep otherwise. Since we have a bad track record about clean ups, I believe we should fix it immediately.
Comment 15•7 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #12)
> Comment on attachment 8912987 [details]
> Bug 1395497 - Add SurfaceTexture impl in GLBlitHelper
>
> https://reviewboard.mozilla.org/r/184350/#review189474
>
> > GetTransformMatrix should take a gfx::Matrix4x4*, not gfx::Matrix4x4&.
>
> Any particular reason why? I chose a reference because otherwise we should
> null check it. We seem to use both quite a bit in gfx code.
Because it makes it clear at the call site that we're expecting an out-var. A null check isn't needed. I don't even assert on it anymore. (it'll crash all on its own)
Out-vars being contractually non-null is a standard guarantee.
Comment 16•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 21•7 years ago
|
||
mozreview-review |
Comment on attachment 8912985 [details]
Bug 1395497 - Modify ScopedBindTexture to allow save/restore
https://reviewboard.mozilla.org/r/184346/#review190220
::: gfx/gl/ScopedGLHelpers.cpp:202
(Diff revision 2)
> ScopedBindTexture::ScopedBindTexture(GLContext* aGL, GLuint aNewTex, GLenum aTarget)
> : ScopedGLWrapper<ScopedBindTexture>(aGL)
> , mTarget(aTarget)
> , mOldTex(GetBoundTexture(aGL, aTarget))
> {
> + if (aNewTex) {
Use -1. There are potential cases where binding 0 is desirable, so using zero as a sentenel could be surprising.
Attachment #8912985 -
Flags: review?(jgilbert) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Attachment #8912987 -
Flags: review?(dmu)
Comment 28•7 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #27)
> Comment on attachment 8912987 [details]
> Bug XXX - Use mat3s to transform tex coords in GLBlitHelper. -
>
> Review request updated; see interdiff:
> https://reviewboard.mozilla.org/r/184350/diff/2-3/
It seems :jgilbert has done some review work already. We should let him keep follow-up it.
Updated•7 years ago
|
Attachment #8912987 -
Flags: review?(jgilbert)
Assignee | ||
Comment 29•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8912985 [details]
Bug 1395497 - Modify ScopedBindTexture to allow save/restore
https://reviewboard.mozilla.org/r/184346/#review190220
> Use -1. There are potential cases where binding 0 is desirable, so using zero as a sentenel could be surprising.
Textures are GLuint, though, so using negative as a sentinel could also be surprising (and we'd have to change the interface to use GLint, which would be weird). I think I'm just going to drop this patch and bind to either 0 or whatever texture the SurfaceTexture is going to bind to.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8912985 -
Attachment is obsolete: true
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 35•7 years ago
|
||
mozreview-review |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review190648
I think mozreview got screwed up here -- this patch has not been reviewed yet. Jeff wrote it, I'm just uploading it with the rest of the changes for this bug.
Assignee | ||
Comment 36•7 years ago
|
||
mozreview-review |
Comment on attachment 8914008 [details]
Bug 1395497 - Add AndroidSurfaceTexture support to GLBlitHelper. -
https://reviewboard.mozilla.org/r/185270/#review190720
Attachment #8914008 -
Flags: review?(snorp) → review+
Comment 37•7 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #29)
> Comment on attachment 8912985 [details]
> Bug 1395497 - Modify ScopedBindTexture to allow save/restore
>
> https://reviewboard.mozilla.org/r/184346/#review190220
>
> > Use -1. There are potential cases where binding 0 is desirable, so using zero as a sentenel could be surprising.
>
> Textures are GLuint, though, so using negative as a sentinel could also be
> surprising (and we'd have to change the interface to use GLint, which would
> be weird). I think I'm just going to drop this patch and bind to either 0 or
> whatever texture the SurfaceTexture is going to bind to.
Sounds good.
Comment 38•7 years ago
|
||
mozreview-review |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review190872
LGTM. thanks.
::: gfx/gl/GLBlitHelper.cpp:128
(Diff revision 5)
> +Mat<N>::Zero()
> +{
> + Mat<N> ret;
> + for (auto& x : ret.m) {
> + x = 0.0f;
> + }
Why not consider to use memcpy instead of assigning by items.
::: gfx/gl/GLBlitHelper.cpp:1046
(Diff revision 5)
> break;
> default:
> gfxCriticalError() << "Unexpected srcTarget: " << srcTarget;
> return;
> }
> - const auto& prog = GetDrawBlitProg(key);
> + const auto& prog = GetDrawBlitProg({ fragHeader, kFragBody_RGBA});
a redundant space in {} before 'f'.
Attachment #8912987 -
Flags: review?(dmu) → review+
Comment 39•7 years ago
|
||
mozreview-review |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review190222
::: gfx/gl/AndroidSurfaceTexture.cpp:21
(Diff revision 2)
> auto jarray = jni::FloatArray::LocalRef::Adopt(env, env->NewFloatArray(16));
> - aSurfaceTexture->GetTransformMatrix(jarray);
> + surfaceTexture->GetTransformMatrix(jarray);
>
> jfloat* array = env->GetFloatArrayElements(jarray.Get(), nullptr);
>
> - aMatrix._11 = array[0];
> + outMatrix->_11 = array[0];
Oh man, gross.
::: gfx/gl/GLBlitHelper.cpp:366
(Diff revision 2)
> gl->fUniformMatrix4fv(mLoc_uColorMatrix, 1, false, colorMatrix);
> }
>
> + MOZ_ASSERT(bool(argsTexTransform) == (mLoc_uTexTransform != -1));
> + if (argsTexTransform) {
> + gl->fUniformMatrix4fv(mLoc_uTexTransform, 1, false, &argsTexTransform->transform._11);
If this works, use memcpy in GetTransformMatrix.
If that isn't valid, this isn't valid.
Attachment #8912987 -
Flags: review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 46•7 years ago
|
||
mozreview-review |
Comment on attachment 8914008 [details]
Bug 1395497 - Add AndroidSurfaceTexture support to GLBlitHelper. -
https://reviewboard.mozilla.org/r/185270/#review191466
Jeff, I made some changes to the y flip based on local testing. Can you look?
Assignee | ||
Updated•7 years ago
|
Attachment #8914008 -
Flags: review?(jgilbert)
Comment 47•7 years ago
|
||
mozreview-review |
Comment on attachment 8912986 [details]
Bug 1395497 - Create SurfaceTexture in detached state, attach on first use
https://reviewboard.mozilla.org/r/184348/#review191474
C/C++ static analysis didn't find any defects in this patch. Hooray!
Comment 48•7 years ago
|
||
mozreview-review |
Comment on attachment 8912987 [details]
Bug 1395497 - Use mat3s to transform tex coords in GLBlitHelper. -
https://reviewboard.mozilla.org/r/184350/#review191480
C/C++ static analysis didn't find any defects in this patch. Hooray!
Comment 49•7 years ago
|
||
mozreview-review |
Comment on attachment 8914008 [details]
Bug 1395497 - Add AndroidSurfaceTexture support to GLBlitHelper. -
https://reviewboard.mozilla.org/r/185270/#review191484
C/C++ static analysis didn't find any defects in this patch. Hooray!
Comment 50•7 years ago
|
||
mozreview-review |
Comment on attachment 8914008 [details]
Bug 1395497 - Add AndroidSurfaceTexture support to GLBlitHelper. -
https://reviewboard.mozilla.org/r/185270/#review192942
::: gfx/gl/GLBlitHelper.cpp:769
(Diff revision 4)
> + // something wrong.
> + MOZ_ASSERT(transform3.at(0,2) == 0);
> + MOZ_ASSERT(transform3.at(1,2) == 0);
> + MOZ_ASSERT(transform3.at(2,2) == 1);
> +
> + const OriginPos srcOrigin = srcImage->GetOriginPos();
Prefer const auto& in cases like this, particularly since the type is extremely obvious.
Attachment #8914008 -
Flags: review?(jgilbert) → review+
Comment 51•7 years ago
|
||
Sorry, I didn't see this re-request!
Updated•7 years ago
|
See Also: → https://webcompat.com/issues/10407
Comment 52•7 years ago
|
||
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a8503893cc85
Create SurfaceTexture in detached state, attach on first use r=jgilbert
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9fbcd8bd4cb
Regenerate JNI binding r=me
https://hg.mozilla.org/integration/mozilla-inbound/rev/4e3dd1e01908
Use mat3s to transform tex coords in GLBlitHelper. - r=daoshengmu
https://hg.mozilla.org/integration/mozilla-inbound/rev/c99dadd2df7d
Add AndroidSurfaceTexture support to GLBlitHelper. - r=snorp
Comment 53•7 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/1498abcee79d for https://treeherder.mozilla.org/logviewer.html#?job_id=137356665&repo=mozilla-inbound on every flavor of Linux.
Assignee | ||
Comment 54•7 years ago
|
||
Jeff, the bustage in comment #53 is probably related to your mat3 patch, since none of the others should affect Linux. Can you take a look?
Flags: needinfo?(jgilbert)
Updated•7 years ago
|
Comment 55•7 years ago
|
||
Ok, I'm going to land bug 1404536 first. It looks green?
Flags: needinfo?(jgilbert)
Updated•7 years ago
|
Attachment #8912987 -
Attachment is obsolete: true
Comment 56•7 years ago
|
||
Unblocked! Back to you to rebase and land. (I hope!)
Flags: needinfo?(snorp)
Assignee | ||
Comment 57•7 years ago
|
||
Flags: needinfo?(snorp)
Comment 58•7 years ago
|
||
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31cc637a34aa
Create SurfaceTexture in detached state, attach on first use r=jgilbert
https://hg.mozilla.org/integration/mozilla-inbound/rev/4046d781cacd
Regenerate JNI binding r=me
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6aad6761527
Add AndroidSurfaceTexture support to GLBlitHelper. - r=snorp
Comment 59•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/31cc637a34aa
https://hg.mozilla.org/mozilla-central/rev/4046d781cacd
https://hg.mozilla.org/mozilla-central/rev/b6aad6761527
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Comment 60•7 years ago
|
||
bugherder |
Comment 61•7 years ago
|
||
Too late for 57
Comment 62•7 years ago
|
||
Verified as fixed on the latest Beta (58.0b3/build 4) and the latest Nightly (59.0a1 / 2017-11-14)
This issue was tested on a Pixel C (Android 8.0)
Comment 63•7 years ago
|
||
Backed out from beta on request from gchang and RyanVM:
https://hg.mozilla.org/releases/mozilla-beta/rev/b2dca24b1741e6089c7fc1080493e2e230b52cb3
Updated•7 years ago
|
Assignee | ||
Comment 64•7 years ago
|
||
Ryan/gchang, why was this backed out? Was it due to bug 1413500? I would like to reland this in beta, along with bug 1413500 and 1421313.
Flags: needinfo?(ryanvm)
Flags: needinfo?(gchang)
Assignee | ||
Comment 65•7 years ago
|
||
Comment on attachment 8912986 [details]
Bug 1395497 - Create SurfaceTexture in detached state, attach on first use
Approval Request Comment
[Feature/Bug causing the regression]: Unknown
[User impact if declined]: Crashes, this fix is necessary to uplift bug 1421313
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: Yes
[Needs manual test from QE? If yes, steps to reproduce]: No
[List of other uplifts needed for the feature/fix]: Bug 1413500
[Is the change risky?]: No
[Why is the change risky/not risky?]: Been using on Nightly with no problems
[String changes made/needed]: None
Attachment #8912986 -
Flags: approval-mozilla-beta?
Comment 66•7 years ago
|
||
Yes, it was to due to the high crash volume on Beta until a suitable fix for bug 1413500 could be found. Re-landing on Beta is Gerry's call, so leaving his NI set :)
Flags: needinfo?(ryanvm)
Comment 67•7 years ago
|
||
Hi :snorp,
Yes, like Ryan said, it was due to the high crash volume on beta. Given this issue has been there since 55 and we only have 10 days before RC week (1/15) after we are back from time off. Can we let this ride the train on 59?
Flags: needinfo?(gchang) → needinfo?(snorp)
Assignee | ||
Comment 68•7 years ago
|
||
If we're willing to accept the crash rate I guess so...
Flags: needinfo?(snorp)
Comment 69•7 years ago
|
||
Comment on attachment 8912986 [details]
Bug 1395497 - Create SurfaceTexture in detached state, attach on first use
This patch is huge and it's a bit risky to uplift this to 58 (next week is RC). Let's let it ride the train on 59 and won't fix for 58.
Attachment #8912986 -
Flags: approval-mozilla-beta? → approval-mozilla-beta-
Updated•7 years ago
|
status-firefox59:
--- → fixed
Target Milestone: Firefox 58 → Firefox 59
Comment 70•7 years ago
|
||
Hi, I posted this bug from v56 back in September.
It has been moved forward I see to v59.
Has this been fixed in the current v59?
Comment 71•7 years ago
|
||
Yes, it should be fixed in 59.
Updated•7 years ago
|
Keywords: regression
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•