I want to use Android_4.1 MediaCodec API to encode video data which captured from Camera,then decode the video data and show the video on TextureView. Now everything is OK,but the TextureView could not show the decoded video in correct oritentation. Please look at these two pictures.
1.Figure1
![enter image description here](https://i.stack.imgur.com/CVqoK.png)
2.Figure2
![enter image description here](https://i.stack.imgur.com/IQHcf.png)
TextureView in figure1 shows What I want orientation.This TextureView called setRotation(90).But it does not alwalys work.If I set this TextureView "match_parent/fill_parent/full_screen",and also setRotation(90),it does not work.
Here is my Camera's parameters:
mCamera.setDisplayOrientation(90);
Parameters parameters = mCamera.getParameters();
parameters.setPreviewFormat(ImageFormat.NV21);
parameters.setPreviewSize(640, 480);
mCamera.setParameters(parameters);
getSupportedCameraParams();
I have tried to set the TextureView's width = screenHeight and height = screenWidth, also I have tried to set parameters.setPreviewSize(480, 640) ,but they do not work.
My question is how I should do to make the fullscreen TextureView to show the video in correct orientation ?
I'm not good at English,I hope you can understand me.
Any help would be appreciated.Thank you!