mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix camera image being upside-down sometimes (fixes #829 again)
This commit is contained in:
parent
0058ddd975
commit
bfb6973849
1
CHANGES
1
CHANGES
|
@ -20,6 +20,7 @@ Other fixes:
|
||||||
- GBA Core: Fix memory leak when loading symbols
|
- GBA Core: Fix memory leak when loading symbols
|
||||||
- Qt: Add dummy English translation file (fixes mgba.io/i/1469)
|
- Qt: Add dummy English translation file (fixes mgba.io/i/1469)
|
||||||
- Qt: Fix Battle Chip view not displaying chips on some DPI settings
|
- Qt: Fix Battle Chip view not displaying chips on some DPI settings
|
||||||
|
- Qt: Fix camera image being upside-down sometimes (fixes mgba.io/i/829 again)
|
||||||
- mGUI: Fix closing down a game if an exit is signalled
|
- mGUI: Fix closing down a game if an exit is signalled
|
||||||
- mVL: Fix injecting accidentally draining non-injection buffer
|
- mVL: Fix injecting accidentally draining non-injection buffer
|
||||||
- VFS: Fix directory node listing on some filesystems
|
- VFS: Fix directory node listing on some filesystems
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "VideoDumper.h"
|
#include "VideoDumper.h"
|
||||||
|
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
#include <QVideoSurfaceFormat>
|
||||||
|
|
||||||
using namespace QGBA;
|
using namespace QGBA;
|
||||||
|
|
||||||
|
@ -40,13 +41,11 @@ bool VideoDumper::present(const QVideoFrame& frame) {
|
||||||
QImage image(bits, mappedFrame.width(), mappedFrame.height(), mappedFrame.bytesPerLine(), format);
|
QImage image(bits, mappedFrame.width(), mappedFrame.height(), mappedFrame.bytesPerLine(), format);
|
||||||
if (swap) {
|
if (swap) {
|
||||||
image = image.rgbSwapped();
|
image = image.rgbSwapped();
|
||||||
} else {
|
} else if (surfaceFormat().scanLineDirection() != QVideoSurfaceFormat::BottomToTop) {
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
// Qt's DirectShow plug-in is pretty dang buggy
|
|
||||||
image = image.mirrored();
|
|
||||||
#else
|
|
||||||
image = image.copy(); // Create a deep copy of the bits
|
image = image.copy(); // Create a deep copy of the bits
|
||||||
#endif
|
}
|
||||||
|
if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) {
|
||||||
|
image = image.mirrored();
|
||||||
}
|
}
|
||||||
mappedFrame.unmap();
|
mappedFrame.unmap();
|
||||||
emit imageAvailable(image);
|
emit imageAvailable(image);
|
||||||
|
|
Loading…
Reference in New Issue