mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-04 00:36:01 +00:00
Added display rotation support to mmal decoder
This commit is contained in:
parent
4bfeee690a
commit
ceacef6329
@ -191,7 +191,7 @@ static void help() {
|
|||||||
printf("\t-4k\t\t\tUse 3840x2160 resolution\n");
|
printf("\t-4k\t\t\tUse 3840x2160 resolution\n");
|
||||||
printf("\t-width <width>\t\tHorizontal resolution (default 1280)\n");
|
printf("\t-width <width>\t\tHorizontal resolution (default 1280)\n");
|
||||||
printf("\t-height <height>\tVertical resolution (default 720)\n");
|
printf("\t-height <height>\tVertical resolution (default 720)\n");
|
||||||
#if defined(HAVE_PI)
|
#if defined(HAVE_PI) | defined(HAVE_MMAL)
|
||||||
printf("\t-rotate <height>\tRotate display: 0/90/180/270 (default 0)\n");
|
printf("\t-rotate <height>\tRotate display: 0/90/180/270 (default 0)\n");
|
||||||
#endif
|
#endif
|
||||||
printf("\t-fps <fps>\t\tSpecify the fps to use (default -1)\n");
|
printf("\t-fps <fps>\t\tSpecify the fps to use (default -1)\n");
|
||||||
|
@ -158,6 +158,18 @@ static int decoder_renderer_setup(int videoFormat, int width, int height, int re
|
|||||||
param.layer = 128;
|
param.layer = 128;
|
||||||
param.display_num = 0;
|
param.display_num = 0;
|
||||||
param.fullscreen = true;
|
param.fullscreen = true;
|
||||||
|
int displayRotation = drFlags & DISPLAY_ROTATE_MASK;
|
||||||
|
switch (displayRotation) {
|
||||||
|
case DISPLAY_ROTATE_90:
|
||||||
|
param.transform = MMAL_DISPLAY_ROT90;
|
||||||
|
break;
|
||||||
|
case DISPLAY_ROTATE_180:
|
||||||
|
param.transform = MMAL_DISPLAY_ROT180;
|
||||||
|
break;
|
||||||
|
case DISPLAY_ROTATE_270:
|
||||||
|
param.transform = MMAL_DISPLAY_ROT270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (mmal_port_parameter_set(renderer->input[0], ¶m.hdr) != MMAL_SUCCESS) {
|
if (mmal_port_parameter_set(renderer->input[0], ¶m.hdr) != MMAL_SUCCESS) {
|
||||||
fprintf(stderr, "Can't set parameters\n");
|
fprintf(stderr, "Can't set parameters\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user