Merge remote-tracking branch 'origin/5.6.1' into 5.6
Change-Id: Iaecbb5c4a33bf0eaffa4f1896bdc09751b1f04c4
This commit is contained in:
@@ -43,9 +43,6 @@ qhp.QtMultimedia.subprojects.examples.sortPages = true
|
|||||||
exampledirs += ../../../examples \
|
exampledirs += ../../../examples \
|
||||||
snippets
|
snippets
|
||||||
|
|
||||||
# Specify example install dir under QT_INSTALL_EXAMPLES
|
|
||||||
examplesinstallpath = qtmultimedia
|
|
||||||
|
|
||||||
headerdirs += ../..
|
headerdirs += ../..
|
||||||
|
|
||||||
imagedirs += src/images \
|
imagedirs += src/images \
|
||||||
|
|||||||
@@ -101,15 +101,30 @@ HRESULT getMediaStreamResolutions(IMediaDeviceController *device,
|
|||||||
ComPtr<IMediaEncodingProperties> properties;
|
ComPtr<IMediaEncodingProperties> properties;
|
||||||
hr = (*propertiesList)->GetAt(index, &properties);
|
hr = (*propertiesList)->GetAt(index, &properties);
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
ComPtr<IVideoEncodingProperties> videoProperties;
|
if (type == MediaStreamType_VideoRecord || type == MediaStreamType_VideoPreview) {
|
||||||
hr = properties.As(&videoProperties);
|
ComPtr<IVideoEncodingProperties> videoProperties;
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
hr = properties.As(&videoProperties);
|
||||||
UINT32 width, height;
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
hr = videoProperties->get_Width(&width);
|
UINT32 width, height;
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
hr = videoProperties->get_Width(&width);
|
||||||
hr = videoProperties->get_Height(&height);
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
hr = videoProperties->get_Height(&height);
|
||||||
resolutions->append(QSize(width, height));
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
|
resolutions->append(QSize(width, height));
|
||||||
|
} else if (type == MediaStreamType_Photo) {
|
||||||
|
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;
|
||||||
|
UINT32 width, height;
|
||||||
|
hr = imageProperties->get_Width(&width);
|
||||||
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
|
hr = imageProperties->get_Height(&height);
|
||||||
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
|
resolutions->append(QSize(width, height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return resolutions->isEmpty() ? MF_E_INVALID_FORMAT : hr;
|
return resolutions->isEmpty() ? MF_E_INVALID_FORMAT : hr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user