Kickflip / kickflip-android-sdk

Kickflip Android SDK - Live Video Streaming to the Cloud
https://kickflip.io
Apache License 2.0
660 stars 212 forks source link

Record in portrait mode #29

Closed gouravd closed 9 years ago

gouravd commented 9 years ago

I wish to make relevant changes to allow portrait mode. First steps would be to allow BroadcastFragment to load in portrait mode. But once that happens, the camera preview is rotated -90.

I believe the rotation makes sense when the fragment opens in Landscape mode. Could you suggest where is actual rotation taking place?

OnlyInAmerica commented 9 years ago

Did you mean to close the issue? Any luck?

gouravd commented 9 years ago

Yeah, actually right after posting this question the idea stuck to my mind and I was able to achieve it with relevant changes.

nachogutierrez commented 9 years ago

Would you mind telling us how you achieved this? I'm trying to do the same.

gouravd commented 9 years ago

I do not remeber exactly as it was about a month ago, but 1) Changes in Manifest/Programatically to load the required Activity (BroadcastActivity or CameraActivty etc..) Portrait Mode 2) In GLCameraView, under function SetupCamera() mCamera.setDisplayOrientation(90);

3) I changed it to a square portrait camera and had to make significant changes to function adjustForVerticalVideo() in FullFrameRect.java. So much that I replaced this function with our own called fixAspectRatio. But you would have to make changes to this function as well to handle Vertical to Horizontal orientation change and appropriate scaling.

4) You will also have to make changes to onSensorChanged() function in BroadcastFragment.java to handle portrait mode