-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add support for vr goggle phone holders (Split display rendering of video) #92
base: dev
Are you sure you want to change the base?
Conversation
205aa7c
to
4e5d080
Compare
4e5d080
to
10ad6d8
Compare
Hi @0TheRain0 ! Thanks for your contribution ! Just a few questions on this :
don't worry about translations yet, we will do a translation round before next release :) Thanks a lot ! |
Hey @0TheRain0 Amazing work here! I can't seem to locate you in our Discord server, any chance you could reply with your username (or @ me in the server @d3vl_jack), please, we can discuss more in dev-chat! Thanks! |
@Jack-Rogers @jlucidar I'm not on the discord - i'll try to get on there later today! @jlucidar with regards to your requests - on the topic of including grafika as a dependency instead of putting parts of it's code in the code base - unfortunately it's not a library and can't be used that way. Also, it's not a code base that is being actively developed, so it won't be getting updates. The license and source is cited in the files though, and it's ok to include the sources in your own project from what I know. As far as separating out this code from the videoReaderExoPlayer class, I can look into that. Also I need to make a fix for the aspect of the two images. Will try to get that done soon. |
…ode to sub package "vr". Set two surfaces to correct aspect for video format.
@jlucidar @Jack-Rogers I moved most of the VR code into a new custom view class "VrView" and it along with the gles code to a subpackage "vr". So now most of this is consolidated to that package. I also put in a fix for the aspect - when I had tested this while my buddy was flying it made me feel kind of queezy before and the image looked a little off... but with this fix it looks much better in the goggles. |
Neat! it looks way better! thanks for your efforts. |
Will this be added to the app in an update? This feature will be amazing!! |
surfaceViewLeft.getHolder().addCallback(videoSurfaceCallbackLeft); | ||
surfaceViewRight.getHolder().addCallback(videoSurfaceCallbackRight); | ||
surfaceViewLeft.setVisibility(View.GONE); | ||
surfaceViewRight.setVisibility(View.GONE); | ||
surfaceViewLeft.post(new Runnable() { | ||
@Override | ||
public void run() { | ||
surfaceViewLeft.setVisibility(View.VISIBLE); | ||
surfaceViewRight.setVisibility(View.VISIBLE); | ||
} | ||
}); |
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.
Nice work @0TheRain0 , didn't know about the Grafika
repo, really a hidden gem.
Your VrView
works well, though I don't have a phone holder with lenses to test.
What is the idea behind this code? To retrigger the surfaceCreated
?
If we don't set to GONE
first, could it trigger the callback already before the view is set to GONE?
I'm just registering on view inflation, and expect the surfaceView
to be later ready, while this is a racecondition, in practice it works well for me and it inverts the dependency, so that the VrView
doesn't have to know about the player.
d4rken-org/fpv-dvca@06d7565#diff-c3426db1c549d5574f8210d209aa690c2fda7d05d83b3f98548ea81e7b3fca8b
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.
@d4rken if someone else would like to take ownership of this code change and make the adjustments needed I would appreciate it. I no longer have time to work on it.
Addresses #9
This adds a "VR" mode to support vr goggle phone holders, like Google Cardboard etc. For testing, I used this one: https://www.amazon.com/dp/B08SBM1HMW?psc=1&ref=ppx_yo2_dt_b_product_details
It makes use of code from Google's "Grafika" project (see https://github.com/google/grafika) in order to do OpenGL ES operations and render the video twice with good performance. This code is in the "gles" folder.
A preferences setting was added for "Enable VR Goggle Mode"
I'm not sure how you are translating strings for this project, so my strings are currently in English only. Let me know if there is something I should do to translate them, I could use google translate or something.
vrdemo.mov