Merge pull request #650 from pjft/fix-rotation-omx

Fix rotation for OMX Player
This commit is contained in:
Jools Wills 2020-04-08 15:39:41 +01:00 committed by GitHub
commit 9f7284a409
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,7 +118,7 @@ void VideoPlayerComponent::startVideo()
case 1: case 1:
{ {
const int x1 = (int)(Renderer::getScreenWidth() - Renderer::getScreenOffsetY() - y - mSize.y()); const int x1 = (int)(Renderer::getWindowWidth() - Renderer::getScreenOffsetY() - y - mSize.y());
const int y1 = (int)(Renderer::getScreenOffsetX() + x); const int y1 = (int)(Renderer::getScreenOffsetX() + x);
const int x2 = (int)(x1 + mSize.y()); const int x2 = (int)(x1 + mSize.y());
const int y2 = (int)(y1 + mSize.x()); const int y2 = (int)(y1 + mSize.x());
@ -128,8 +128,8 @@ void VideoPlayerComponent::startVideo()
case 2: case 2:
{ {
const int x1 = (int)(Renderer::getScreenWidth() - Renderer::getScreenOffsetX() - x - mSize.x()); const int x1 = (int)(Renderer::getWindowWidth() - Renderer::getScreenOffsetX() - x - mSize.x());
const int y1 = (int)(Renderer::getScreenHeight() - Renderer::getScreenOffsetY() - y - mSize.y()); const int y1 = (int)(Renderer::getWindowHeight() - Renderer::getScreenOffsetY() - y - mSize.y());
const int x2 = (int)(x1 + mSize.x()); const int x2 = (int)(x1 + mSize.x());
const int y2 = (int)(y1 + mSize.y()); const int y2 = (int)(y1 + mSize.y());
sprintf(buf1, "%d,%d,%d,%d", x1, y1, x2, y2); sprintf(buf1, "%d,%d,%d,%d", x1, y1, x2, y2);
@ -139,7 +139,7 @@ void VideoPlayerComponent::startVideo()
case 3: case 3:
{ {
const int x1 = (int)(Renderer::getScreenOffsetY() + y); const int x1 = (int)(Renderer::getScreenOffsetY() + y);
const int y1 = (int)(Renderer::getScreenHeight() - Renderer::getScreenOffsetX() - x - mSize.x()); const int y1 = (int)(Renderer::getWindowHeight() - Renderer::getScreenOffsetX() - x - mSize.x());
const int x2 = (int)(x1 + mSize.y()); const int x2 = (int)(x1 + mSize.y());
const int y2 = (int)(y1 + mSize.x()); const int y2 = (int)(y1 + mSize.x());
sprintf(buf1, "%d,%d,%d,%d", x1, y1, x2, y2); sprintf(buf1, "%d,%d,%d,%d", x1, y1, x2, y2);