File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,14 @@ public void onFrameAvailable(SurfaceTexture surfaceTexture) {
374374 // tell mLayer about it and set the SurfaceTexture to use the
375375 // current view size.
376376 mUpdateSurface = false ;
377+
378+ // Since we are updating the layer, force an update to ensure its
379+ // parameters are correct (width, height, transform, etc.)
380+ synchronized (mLock ) {
381+ mUpdateLayer = true ;
382+ }
383+ mMatrixChanged = true ;
384+
377385 mAttachInfo .mHardwareRenderer .setSurfaceTexture (mLayer , mSurface );
378386 nSetDefaultBufferSize (mSurface , getWidth (), getHeight ());
379387 }
@@ -471,7 +479,7 @@ public Matrix getTransform(Matrix transform) {
471479 }
472480
473481 private void applyTransformMatrix () {
474- if (mMatrixChanged ) {
482+ if (mMatrixChanged && mLayer != null ) {
475483 mLayer .setTransform (mMatrix );
476484 mMatrixChanged = false ;
477485 }
You can’t perform that action at this time.
0 commit comments