diff --git a/src/main.c b/src/main.c index 0471cab..ca2c718 100644 --- a/src/main.c +++ b/src/main.c @@ -191,7 +191,7 @@ static void help() { printf("\t-4k\t\t\tUse 3840x2160 resolution\n"); printf("\t-width \t\tHorizontal resolution (default 1280)\n"); printf("\t-height \tVertical resolution (default 720)\n"); - #if defined(HAVE_PI) + #if defined(HAVE_PI) | defined(HAVE_MMAL) printf("\t-rotate \tRotate display: 0/90/180/270 (default 0)\n"); #endif printf("\t-fps \t\tSpecify the fps to use (default -1)\n"); diff --git a/src/video/mmal.c b/src/video/mmal.c index 890368c..232b053 100644 --- a/src/video/mmal.c +++ b/src/video/mmal.c @@ -158,6 +158,18 @@ static int decoder_renderer_setup(int videoFormat, int width, int height, int re param.layer = 128; param.display_num = 0; 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) { fprintf(stderr, "Can't set parameters\n");