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

Bugs of ResolveToRenderTexture.cs #1363

Closed
KeeleyYu opened this issue Nov 7, 2022 · 8 comments
Closed

Bugs of ResolveToRenderTexture.cs #1363

KeeleyYu opened this issue Nov 7, 2022 · 8 comments
Labels
Bug 🐛 Something isn't working Fixed A fix will be in the next release

Comments

@KeeleyYu
Copy link

KeeleyYu commented Nov 7, 2022

Hi,
I'm using the newest version(v2.6.5) of AVPro and just found that, there is a bug in this ResolveToRenderTexture.cs script.
In Line30, the variant _mediaPlayer should be replaced by 'value'.
public MediaPlayer MediaPlayer { get { return _mediaPlayer; } set { ChangeMediaPlayer(_mediaPlayer); } }

However, after i correct the code in my project and I found that another error comes:

NullReferenceException: Object reference not set to an instance of an object
RenderHeads.Media.AVProVideo.VideoRender.SetupVerticalFlipMaterial (UnityEngine.Material material, System.Boolean flip) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:317)
RenderHeads.Media.AVProVideo.VideoRender.SetupMaterial (UnityEngine.Material material, System.Boolean flipVertically, System.Boolean playerSupportsLinear, UnityEngine.Matrix4x4 ycbcrTransform, UnityEngine.Texture ycbcrTexture, System.Single[] textureTransform, RenderHeads.Media.AVProVideo.VideoMapping mapping, RenderHeads.Media.AVProVideo.StereoPacking stereoPacking, RenderHeads.Media.AVProVideo.AlphaPacking alphaPacking) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:383)
RenderHeads.Media.AVProVideo.VideoRender.SetupMaterialForMedia (UnityEngine.Material material, RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer, System.Int32 texturePropId, UnityEngine.Texture fallbackTexture, System.Boolean forceFallbackTexture) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:360)
RenderHeads.Media.AVProVideo.ResolveToRenderTexture.Resolve () (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:99)
RenderHeads.Media.AVProVideo.ResolveToRenderTexture.ChangeMediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:67)
RenderHeads.Media.AVProVideo.ResolveToRenderTexture.set_MediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer value) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:30)

In my project, i want to link the output texture of AVPro to another new RenderTexture. So it would be much apperaicate if one of the developers can help~

@Ste-RH
Copy link
Collaborator

Ste-RH commented Nov 9, 2022

Thanks for reporting this. We should have a fix in place in the next release.

@Ste-RH Ste-RH added this to the 0-Next Release milestone Nov 9, 2022
@Ste-RH Ste-RH added the Fixed A fix will be in the next release label Nov 9, 2022
@Chris-RH
Copy link
Collaborator

Version 2.6.6 is now out. Please let us know if this has not resolved your issue.

@KeeleyYu
Copy link
Author

@Chris-RH
Thanks for fast version iteration! Yet, there are still bugs with this script as the same as my early problem.

It looks like when the MediaPlayer is changed by setter, the material also need to be re-created, that I haven't look deep into the reason why the material has been set to null at some time. And I try to fix it by myself in the way that, I have copied these three lines in Start(), which setup a new material for media, into ChangeMediaPlayer(), right before Resolve(). It seems works and doesn't come up other bugs so far.

If there is anything wrong, please let me know :)

Hi, I'm using the newest version(v2.6.5) of AVPro and just found that, there is a bug in this ResolveToRenderTexture.cs script. In Line30, the variant _mediaPlayer should be replaced by 'value'. public MediaPlayer MediaPlayer { get { return _mediaPlayer; } set { ChangeMediaPlayer(_mediaPlayer); } }

However, after i correct the code in my project and I found that another error comes:

NullReferenceException: Object reference not set to an instance of an object RenderHeads.Media.AVProVideo.VideoRender.SetupVerticalFlipMaterial (UnityEngine.Material material, System.Boolean flip) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:317) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterial (UnityEngine.Material material, System.Boolean flipVertically, System.Boolean playerSupportsLinear, UnityEngine.Matrix4x4 ycbcrTransform, UnityEngine.Texture ycbcrTexture, System.Single[] textureTransform, RenderHeads.Media.AVProVideo.VideoMapping mapping, RenderHeads.Media.AVProVideo.StereoPacking stereoPacking, RenderHeads.Media.AVProVideo.AlphaPacking alphaPacking) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:383) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterialForMedia (UnityEngine.Material material, RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer, System.Int32 texturePropId, UnityEngine.Texture fallbackTexture, System.Boolean forceFallbackTexture) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:360) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.Resolve () (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:99) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.ChangeMediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:67) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.set_MediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer value) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:30)

In my project, i want to link the output texture of AVPro to another new RenderTexture. So it would be much apperaicate if one of the developers can help~

@KeeleyYu
Copy link
Author

@Chris-RH Thanks for fast version iteration! Yet, there are still bugs with this script as the same as my early problem.

It looks like when the MediaPlayer is changed by setter, the material also need to be re-created, that I haven't look deep into the reason why the material has been set to null at some time. And I try to fix it by myself in the way that, I have copied these three lines in Start(), which setup a new material for media, into ChangeMediaPlayer(), right before Resolve(). It seems works and doesn't come up other bugs so far.

If there is anything wrong, please let me know :)

Hi, I'm using the newest version(v2.6.5) of AVPro and just found that, there is a bug in this ResolveToRenderTexture.cs script. In Line30, the variant _mediaPlayer should be replaced by 'value'. public MediaPlayer MediaPlayer { get { return _mediaPlayer; } set { ChangeMediaPlayer(_mediaPlayer); } }
However, after i correct the code in my project and I found that another error comes:
NullReferenceException: Object reference not set to an instance of an object RenderHeads.Media.AVProVideo.VideoRender.SetupVerticalFlipMaterial (UnityEngine.Material material, System.Boolean flip) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:317) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterial (UnityEngine.Material material, System.Boolean flipVertically, System.Boolean playerSupportsLinear, UnityEngine.Matrix4x4 ycbcrTransform, UnityEngine.Texture ycbcrTexture, System.Single[] textureTransform, RenderHeads.Media.AVProVideo.VideoMapping mapping, RenderHeads.Media.AVProVideo.StereoPacking stereoPacking, RenderHeads.Media.AVProVideo.AlphaPacking alphaPacking) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:383) RenderHeads.Media.AVProVideo.VideoRender.SetupMaterialForMedia (UnityEngine.Material material, RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer, System.Int32 texturePropId, UnityEngine.Texture fallbackTexture, System.Boolean forceFallbackTexture) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Internal/Utils/VideoRender.cs:360) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.Resolve () (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:99) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.ChangeMediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:67) RenderHeads.Media.AVProVideo.ResolveToRenderTexture.set_MediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer value) (at Assets/BasicAbilities/Framework/AVProVideo/Runtime/Scripts/Components/ResolveToRenderTexture.cs:30)
In my project, i want to link the output texture of AVPro to another new RenderTexture. So it would be much apperaicate if one of the developers can help~

Also need to add some Null check.

@MorrisRH MorrisRH removed the Fixed A fix will be in the next release label Nov 15, 2022
@MorrisRH MorrisRH modified the milestones: 2.6.6, 0-Next Release Nov 15, 2022
@MorrisRH MorrisRH modified the milestones: 2.6.7, 1-Near Future Dec 8, 2022
@stale
Copy link

stale bot commented Dec 26, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale label Dec 26, 2022
@Chris-RH Chris-RH removed the stale Stale label Dec 28, 2022
@stale
Copy link

stale bot commented Jan 7, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale label Jan 7, 2023
@Chris-RH Chris-RH removed the stale Stale label Jan 9, 2023
@stale
Copy link

stale bot commented Jan 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale label Jan 21, 2023
@Chris-RH Chris-RH added pinned Prevent from being removed by stale-bot and removed stale Stale labels Jan 23, 2023
@MorrisRH MorrisRH added Bug 🐛 Something isn't working Fixed A fix will be in the next release and removed pinned Prevent from being removed by stale-bot labels Oct 31, 2023
@MorrisRH MorrisRH removed this from the 1-Near Future milestone Oct 31, 2023
@MorrisRH
Copy link
Collaborator

Closing this issue as it appears to have been fixed some time ago. Please create a new issue if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working Fixed A fix will be in the next release
Projects
None yet
Development

No branches or pull requests

4 participants