diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-03-26 03:19:51 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-03-26 03:36:37 (GMT) |
commit | 31461202c1ee2979f88f9642192ab53a2bc7e8cf (patch) | |
tree | fe933e114a4ed850a7e5f2b732e2102a750a64ec | |
parent | ef312b121470ec662ff6c861d02f880026e786b0 (diff) | |
download | Qt-31461202c1ee2979f88f9642192ab53a2bc7e8cf.zip Qt-31461202c1ee2979f88f9642192ab53a2bc7e8cf.tar.gz Qt-31461202c1ee2979f88f9642192ab53a2bc7e8cf.tar.bz2 |
Don't specify a BottomToTop scan line direction for YUV frames.
A positive image height is supposed to indicate BottomToTop scan line
direction, but this would seem to be true for RGB formats.
Reviewed-by: Dmytro Poplavskiy
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp index cf6d45b..f8f519d 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp @@ -130,9 +130,17 @@ QVideoSurfaceFormat DirectShowMediaType::formatFromType(const AM_MEDIA_TYPE &typ if (header->AvgTimePerFrame > 0) format.setFrameRate(10000 /header->AvgTimePerFrame); - format.setScanLineDirection(header->bmiHeader.biHeight < 0 - ? QVideoSurfaceFormat::TopToBottom - : QVideoSurfaceFormat::BottomToTop); + switch (qt_typeLookup[i].pixelFormat) { + case QVideoFrame::Format_RGB32: + case QVideoFrame::Format_BGR24: + case QVideoFrame::Format_RGB565: + case QVideoFrame::Format_RGB555: + if (header->bmiHeader.biHeight >= 0) + format.setScanLineDirection(QVideoSurfaceFormat::BottomToTop); + break; + default: + break; + } return format; } else if (IsEqualGUID(type.formattype, FORMAT_VideoInfo2)) { @@ -145,9 +153,17 @@ QVideoSurfaceFormat DirectShowMediaType::formatFromType(const AM_MEDIA_TYPE &typ if (header->AvgTimePerFrame > 0) format.setFrameRate(10000 / header->AvgTimePerFrame); - format.setScanLineDirection(header->bmiHeader.biHeight < 0 - ? QVideoSurfaceFormat::TopToBottom - : QVideoSurfaceFormat::BottomToTop); + switch (qt_typeLookup[i].pixelFormat) { + case QVideoFrame::Format_RGB32: + case QVideoFrame::Format_BGR24: + case QVideoFrame::Format_RGB565: + case QVideoFrame::Format_RGB555: + if (header->bmiHeader.biHeight >= 0) + format.setScanLineDirection(QVideoSurfaceFormat::BottomToTop); + break; + default: + break; + } return format; } |