Ways to rotate HDMI screen in Android

1.3k Views Asked by At

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:

  • Modify the build.prop file but no luck.
  • Install a bunch of screen rotating app but it didnt work either.
  • I have tried this and some relate tutorial but it didnt work :

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

  • I try to used MediaRouter but the box recognized the HDMI as main screen and not external.
  • I tried using VLC filter :video-filter=rotate, :video-filter=transform but it will only be available in 4.0.
  • I also modified VLC source code but saddly it only rotate picture, not video.

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.

1

There are 1 best solutions below

8
On

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());