mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-11 18:36:17 +00:00
Added command line option to control omx rotation
This commit is contained in:
@@ -143,10 +143,22 @@ static int decoder_renderer_setup(int videoFormat, int width, int height, int re
|
||||
}
|
||||
|
||||
OMX_CONFIG_ROTATIONTYPE rotationType;
|
||||
memset(&rotationType, 0, sizeof(OMX_CONFIG_ROTATIONTYPE));
|
||||
rotationType.nSize = sizeof(OMX_CONFIG_ROTATIONTYPE);
|
||||
rotationType.nVersion.nVersion = OMX_VERSION;
|
||||
rotationType.nPortIndex = 90;
|
||||
rotationType.nRotation = 90;
|
||||
int displayRotation = drFlags & DISPLAY_ROTATE_MASK;
|
||||
switch (displayRotation) {
|
||||
case DISPLAY_ROTATE_90:
|
||||
rotationType.nRotation = 90;
|
||||
break;
|
||||
case DISPLAY_ROTATE_180:
|
||||
rotationType.nRotation = 180;
|
||||
break;
|
||||
case DISPLAY_ROTATE_270:
|
||||
rotationType.nRotation = 270;
|
||||
break;
|
||||
}
|
||||
|
||||
if(OMX_SetParameter(ILC_GET_HANDLE(video_render), OMX_IndexConfigCommonRotate, &rotationType) != OMX_ErrorNone) {
|
||||
fprintf(stderr, "Failed to set video rotation\n");
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
#define DISPLAY_FULLSCREEN 1
|
||||
#define ENABLE_HARDWARE_ACCELERATION_1 2
|
||||
#define ENABLE_HARDWARE_ACCELERATION_2 4
|
||||
#define DISPLAY_ROTATE_MASK 24
|
||||
#define DISPLAY_ROTATE_90 8
|
||||
#define DISPLAY_ROTATE_180 16
|
||||
#define DISPLAY_ROTATE_270 24
|
||||
|
||||
#define INIT_EGL 1
|
||||
#define INIT_VDPAU 2
|
||||
|
||||
Reference in New Issue
Block a user