diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-01 13:35:52 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-01 13:35:52 +0200 |
commit | 48086a7573268774fab346d6fde0c9137ba1bf4e (patch) | |
tree | 8c976ef081c2b9a844fcc70deae7de55d09d23fd /src/plugins/winrt/qwinrtcameracontrol.cpp | |
parent | f2b9fb776b78fc10424c0325ab4316a45360130e (diff) | |
parent | 711efc552d65f22b262e049c5a046198377519dc (diff) | |
download | qtmultimedia-48086a7573268774fab346d6fde0c9137ba1bf4e.tar.gz |
Merge remote-tracking branch 'origin/5.6.1' into 5.7.0
Change-Id: If59885e0d0780390705c69fa7520c6ccc179ef45
Diffstat (limited to 'src/plugins/winrt/qwinrtcameracontrol.cpp')
-rw-r--r-- | src/plugins/winrt/qwinrtcameracontrol.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index a4584487a..856549438 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -101,7 +101,13 @@ HRESULT getMediaStreamResolutions(IMediaDeviceController *device, ComPtr<IMediaEncodingProperties> properties; hr = (*propertiesList)->GetAt(index, &properties); Q_ASSERT_SUCCEEDED(hr); - if (type == MediaStreamType_VideoRecord || type == MediaStreamType_VideoPreview) { + HString propertyType; + hr = properties->get_Type(propertyType.GetAddressOf()); + Q_ASSERT_SUCCEEDED(hr); + + const HStringReference videoRef = HString::MakeReference(L"Video"); + const HStringReference imageRef = HString::MakeReference(L"Image"); + if (propertyType == videoRef) { ComPtr<IVideoEncodingProperties> videoProperties; hr = properties.As(&videoProperties); Q_ASSERT_SUCCEEDED(hr); @@ -111,13 +117,10 @@ HRESULT getMediaStreamResolutions(IMediaDeviceController *device, hr = videoProperties->get_Height(&height); Q_ASSERT_SUCCEEDED(hr); resolutions->append(QSize(width, height)); - } else if (type == MediaStreamType_Photo) { + } else if (propertyType == imageRef) { ComPtr<IImageEncodingProperties> imageProperties; hr = properties.As(&imageProperties); - // Asking for Photo also returns video resolutions in addition - // We skip those, as we are only interested in image Type - if (FAILED(hr) || !imageProperties) - continue; + Q_ASSERT_SUCCEEDED(hr); UINT32 width, height; hr = imageProperties->get_Width(&width); Q_ASSERT_SUCCEEDED(hr); |