Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] ResolveToRenderTexture error if initialized before MediaPlayer #2077

Open
rhduwe opened this issue Nov 19, 2024 · 5 comments
Open
Assignees
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

Comments

@rhduwe
Copy link

rhduwe commented Nov 19, 2024

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

@rhduwe rhduwe added the triage Needs triage label Nov 19, 2024
@Chris-RH
Copy link
Contributor

we've not received anything in the email yet @rhduwe

@Chris-RH Chris-RH added Android Android platform Version 3.x Issue only affects version 3.x of AVPro Video labels Nov 20, 2024
@rhduwe
Copy link
Author

rhduwe commented Nov 20, 2024

Sent it to the correct address. Your issue template has a typo - "unitysupprt" instead of "unitysupport"

@Chris-RH
Copy link
Contributor

thanks, corrected :)

@Ste-RH
Copy link

Ste-RH commented Nov 21, 2024

@rhduwe

Can you make the following change (to the hi-lighted line) in the MediaPlayer.cs script to see if it fixes the issue for you?

image

If so, we will action that change in the next release.

@Ste-RH Ste-RH added Fixed A fix will be in the next release and removed triage Needs triage labels Nov 21, 2024
@Ste-RH Ste-RH assigned Ste-RH and unassigned Chris-RH Nov 21, 2024
@Ste-RH Ste-RH added this to the 0-Next Release milestone Nov 21, 2024
@rhduwe
Copy link
Author

rhduwe commented Nov 21, 2024

Yeah, that works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants