ngoson
ngoson

Reputation: 613

Ways to rotate HDMI screen in Android

I am making a media player app for a TVBox running Android 7.1.2. I want to rotate the HDMI output but the box's rotation is locked to landscape so I cannot rotate the app using setRequestedOrientation. The library I use is VLC Android with SurfaceView. I cannot use TextureView because it is so lag and drop FPS.

To rotate the HDMI output, I have tried the following:

https://android.stackexchange.com/questions/117003/allow-rotate-into-portrait-mode-but-do-not-rotate-external-display

So is there any other way I can try to rotate screen orientation of HDMI output? Is there any chance that we can rotate screen by OpenGl ES or native code?

Thank you.

Upvotes: 0

Views: 1562

Answers (1)

snachmsm
snachmsm

Reputation: 19223

so you are saying that you can't use video-filter=rotate, what about video-filter=transform?

final ArrayList<String> args = new ArrayList<>();
args.add("--video-filter=transform");
args.add("--transform-type=270");

mLibVLC = new LibVLC(context, args);
mMediaPlayer = new MediaPlayer(mLibVLC);
final IVLCVout vlcVout = mMediaPlayer.getVLCVout();
vlcVout.setVideoView(mSurfaceView);
vlcVout.setWindowSize(mSurfaceView.getWidth(), mSurfaceView.getHeight());

Upvotes: 1

Related Questions