summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2017-11-24 07:36:36 (GMT)
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-12-21 10:33:23 (GMT)
commitc8bf0cd37c5f526e3687dfeff9e23d15104328b5 (patch)
tree4548c27c5163eb8f336a977df2996174bf92cb82
parent48e0fc2ca67a4adbc4f051413ea3febdb24a6822 (diff)
downloadqtmultimedia-c8bf0cd37c5f526e3687dfeff9e23d15104328b5.tar.gz
DirectShow: Fix rendering of overlapping MDI subwindows
Media type MEDIASUBTYPE_RGB32 is 32 bytes per pixel (like 0x00RRGGBB). When MDI subwindows are overlapping bottom window with QImage::Format_RGB32 requires 0xffRRGGBB. If "not used byte" is not 0xFF rendering will not be correct (0x00 produces empty image). Changed samples to ARGB32 to provide alpha channel, which is 0xFF in most cases. If alpha channel is not set to 0xFF, the bottom window will still be rendered incorrectly. Task-number: QTBUG-51405 Change-Id: I69f15d3835f901a04bf39b079394c6292b793610 Reviewed-by: Christian Stromme <christian.stromme@qt.io> (cherry picked from commit b69259b65707acc9fc3c0818f6affe53938cebc3)
-rw-r--r--src/plugins/directshow/camera/dscamerasession.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp
index 55ab868..dc0dfc8 100644
--- a/src/plugins/directshow/camera/dscamerasession.cpp
+++ b/src/plugins/directshow/camera/dscamerasession.cpp
@@ -815,8 +815,8 @@ bool DSCameraSession::configurePreviewFormat()
return false;
}
- // Set sample grabber format (always RGB32)
- static const AM_MEDIA_TYPE grabberFormat { MEDIATYPE_Video, MEDIASUBTYPE_RGB32, 0, 0, 0, FORMAT_VideoInfo, nullptr, 0, nullptr};
+ // Set sample grabber format
+ static const AM_MEDIA_TYPE grabberFormat { MEDIATYPE_Video, MEDIASUBTYPE_ARGB32, 0, 0, 0, FORMAT_VideoInfo, nullptr, 0, nullptr};
if (!m_previewSampleGrabber->setMediaType(&grabberFormat))
return false;