diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-04-07 15:39:46 +0200 |
---|---|---|
committer | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-04-08 12:12:58 +0200 |
commit | 0721c05771e89364023309fa252d70bdfafab2b4 (patch) | |
tree | 67011a8e6c57a4f061ba51a65c0dd4f78358439c | |
parent | c39f90e01e51c9fbc8074993a38e7f9b16338dbb (diff) | |
download | qtmultimedia-0721c05771e89364023309fa252d70bdfafab2b4.tar.gz |
DirectShow: Use MEDIASUBTYPE_Y800 as QVideoFrame::Format_Y8
Added MEDIASUBTYPE_Y800 with GUID: {30303859-0000-0010-8000-00AA00389B71}
Fixes: QTBUG-83071
Change-Id: I2e51ae1d2ae62d4d4cd7f68eecc0605bdc8c7f3a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/plugins/directshow/camera/dscamerasession.cpp | 9 | ||||
-rw-r--r-- | src/plugins/directshow/common/directshowmediatype.cpp | 8 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp index a0c120816..042052421 100644 --- a/src/plugins/directshow/camera/dscamerasession.cpp +++ b/src/plugins/directshow/camera/dscamerasession.cpp @@ -1147,9 +1147,14 @@ void DSCameraSession::updateSourceCapabilities() m_supportedViewfinderSettings.append(settings); m_supportedFormats.append(DirectShowMediaType(*pmt)); } - - + } else { + OLECHAR *guidString = nullptr; + StringFromCLSID(pmt->subtype, &guidString); + if (guidString) + qWarning() << "Unsupported media type:" << QString::fromWCharArray(guidString); + ::CoTaskMemFree(guidString); } + DirectShowMediaType::deleteType(pmt); } } diff --git a/src/plugins/directshow/common/directshowmediatype.cpp b/src/plugins/directshow/common/directshowmediatype.cpp index 37106586a..3429f4848 100644 --- a/src/plugins/directshow/common/directshowmediatype.cpp +++ b/src/plugins/directshow/common/directshowmediatype.cpp @@ -40,6 +40,11 @@ #include "directshowmediatype.h" #include "directshowglobal.h" +#include <initguid.h> + +DEFINE_GUID(MEDIASUBTYPE_Y800, 0x30303859, 0x0000, 0x0010, 0x80, 0x00, + 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); + namespace { struct TypeLookup @@ -66,7 +71,8 @@ namespace { QVideoFrame::Format_NV12, MEDIASUBTYPE_NV12 }, { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_IYUV }, { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_I420 }, - { QVideoFrame::Format_Jpeg, MEDIASUBTYPE_MJPG } + { QVideoFrame::Format_Jpeg, MEDIASUBTYPE_MJPG }, + { QVideoFrame::Format_Y8, MEDIASUBTYPE_Y800 }, }; } |