cine-io / cineio-broadcast-android

The cine.io Android Broadcast SDK
https://www.cine.io/products/broadcast
MIT License
52 stars 32 forks source link

When I rotate the phone to Portrait Orientation_180, the interface stays as Orientation_0 #12

Open lgorse opened 9 years ago

lgorse commented 9 years ago

When I rotate the phone the UI shifts to match the orientation except for when I reorient to Portrait Orientation_180. Then the UI stays at Orientation_0. This happens on locked and non-locked mode.

This has an effect on the UI (unlike when I shift to landscape, the record button doesn't shift back to the bottom for instance).

I actually started worrying about this more because of frame capture. Bitmaps generated from openGL need to be flipped because OpenGL canvas coordinates don't match bitmap coordinates (starting point in openGL is bottom left, it is top left for bitmap).

But in the case of Orientation_180, the video is right-side up (even though the UI is upside down) but the frame gets rendered upside down. That means that the video is being captured upside down and then corrected by the preview - so when the frame is transfered from openGL to bitmap, it is already right side up => and then upside down because of my reorientation.

I wonder if there's a way for me to access the preview orientation, so that the frame orientation matches the preview orientation rather than the camera.