[Android] ResolveToRenderTexture error if initialized before MediaPlayer #2077
Labels
Android
Android platform
Fixed
A fix will be in the next release
Version 3.x
Issue only affects version 3.x of AVPro Video
Milestone
Unity version
6000.0.25f1
Unity editor platform
Windows
AVPro Video edition
Ultra
AVPro Video version
3.1.2
Device hardware
Oculus Quest 3, Poco M5
Which Android OS version are you using?
14
Unity Graphics API
OpenGLES 3, Vulkan
Video API
media3/ExoPlayer
Texture format
BGRA
Audio output
System Direct
Any other Media Player component configuration required to reproduce the issue.
No response
Which output component(s) are you using?
Resolve to RenderTexture
Any other component configuration required to reproduce the issue.
No response
The issue
In some scenarios, ResolveToRenderTexture doesn't work. This seems to happen whenever ResolveToRenderTexture initializes before the MediaPlayer component. If both components are activating on the same frame, it gives inconsistent results due to Unity's varying activation order.
This does not happen in editor or on windows build or with AVPro 2.
I've set up the test project and sent it to your email.
Errors:
First this one at initialization:
NullReferenceException: Object reference not set to an instance of an object at RenderHeads.Media.AVProVideo.MediaPlayer.IsUsingAndroidOESPath () at RenderHeads.Media.AVProVideo.ResolveToRenderTexture.Start ()
and then this one each frame:
NullReferenceException: Object reference not set to an instance of an object. RenderHeads.Media.AVProVideo.VideoRender.SetupVerticalFlipMaterial (UnityEngine.Material material, System.Boolean flip) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterial (UnityEngine.Material material, System.Boolean flipVertically, System.Boolean playerSupportsLinear, UnityEngine.Matrix4x4 ycbcrTransform, UnityEngine.Texture ycbcrTexture, UnityEngine.Matrix4x4 textureTransform, RenderHeads.Media.AVProVideo.VideoMapping mapping, RenderHeads.Media.AVProVideo.StereoPacking stereoPacking, RenderHeads.Media.AVProVideo.AlphaPacking alphaPacking) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterialForMedia (UnityEngine.Material material, RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer, System.Int32 texturePropId, UnityEngine.Texture fallbackTexture, System.Boolean forceFallbackTexture)
Media information
No response
Logcat output
No response
The text was updated successfully, but these errors were encountered: