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
Dispatch FrameAvailable event to UI thread #14
Conversation
The android docs says that its undefined what thread will invoke the OnFrameAvailable callback. Need to dispatch it to the UI thread and do the texture upload there
I hope this will fix issues like https://www.fusetools.com/community/forums/bug_reports/camerapanel_crash_on_samsung_trend_plus |
|
||
public void FrameAvailable() | ||
{ | ||
UpdateTexImage(_tex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure this is quite enough. I think we still can risk not having a GL-context active, for instance if the app was kicked to the background before the dispatch took effect. But I'm not 100% sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, needs to be tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi All and thanks a lot for your replies and help,
I tested the following (on my Oppo R9 where the preview works):
- Launch the app: preview ok
- App to background > open other apps > reopen ours : preview resumes ok
- App to background > open the mobile's camera app > close it > reopen ours: preview does not resume, there is no crash, the latest preview frame keeps being displayed, but not updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will complete my answer once we've been able to re-test on the Samsung Trend Plus, where the preview did not work since the app launch. Should be done with the next 24 hours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app still crashes at opening on Samsung Trend Plus.
Hi, Could you help us with this please? We do not have the knowledge to solve it and it will be a Fuse nogo for our app otherwise.. |
The android docs says that its undefined what thread will invoke the OnFrameAvailable
callback. Need to dispatch it to the UI thread and do the texture upload
there