fpvout / DigiView-Android

Live video out from your DJI FPV Goggles via USB.
https://fpvout.com
MIT License
283 stars 60 forks source link

Video aspect-fit to native ratio, toggle with double tap/pinch #40

Closed fichek closed 3 years ago

fichek commented 3 years ago

https://user-images.githubusercontent.com/956646/118441419-79153400-b6e9-11eb-8d65-36f74b8fe687.mov

Resolves #5. Video will start in fullscreen by default as before. Double tap anywhere to switch to its native aspect ratio (unless your device screen and video feed happen to be the same ratio, then there will be no visual effect) with black bars on the edge, double-tap again to return to fullscreen with cropping. I've also enabled auto-animations in the layout, but they look a bit wonky on my Pixel sometimes, I guess resizing SurfaceView while it's playing causes this - any ideas how to avoid it?

Edit: now you can pinch to zoom in/out as well thanks to @omouren ❤️

Switching camera ratio while plugged in will freeze the video and require to plug the USB cable out and back in, tracked under #33.

I'm thinking about enabling full sensor rotation (#20) but disabling fullscreen mode while in portrait since it would look ridiculous, how do you guys feel about that?

omouren commented 3 years ago

Is it possible to use a "pinch to zoom" gesture to do this? Like on youtube for example? Double tap might conflict with the single tap for the watermark.

fichek commented 3 years ago

Is it possible to use a "pinch to zoom" gesture to do this? Like on youtube for example? Double tap might conflict with the single tap for the watermark.

I'll look into adding pinch, I like that idea, but it's not conflicting, I'm using onSingleTapConfirmed from the gesture recognizer now instead of onTouchEvent.

omouren commented 3 years ago

@fichek Check my branch https://github.com/fpvout/DigiView-Android/tree/feature/5-video-scaling-pinch-to-zoom, I added pinch to zoom gesture (and a fix when editing sharedpreferences without goggles plugged). I don't know if I should make a PR to your branch, tell me.

fichek commented 3 years ago

Thanks @omouren. merged your commit to this branch 👍 good catch with the shared pref init too.