mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 22:00:25 +08:00
Merge pull request #7843 from chacha21:fix-capture-msmf
This commit is contained in:
commit
c977af8ee8
@ -1986,13 +1986,17 @@ long videoDevice::resetDevice(IMFActivate *pActivate)
|
||||
&vd_pFriendlyName,
|
||||
NULL
|
||||
);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = pActivate->ActivateObject(
|
||||
__uuidof(IMFMediaSource),
|
||||
(void**)&pSource
|
||||
);
|
||||
if (SUCCEEDED(hr) && pSource)
|
||||
{
|
||||
enumerateCaptureFormats(pSource);
|
||||
buildLibraryofTypes();
|
||||
SafeRelease(&pSource);
|
||||
}//end if (SUCCEEDED(hr) && pSource)
|
||||
if(FAILED(hr))
|
||||
{
|
||||
vd_pFriendlyName = NULL;
|
||||
@ -2638,7 +2642,12 @@ HRESULT videoDevice::enumerateCaptureFormats(IMFMediaSource *pSource)
|
||||
_ComPtr<IMFStreamDescriptor> pSD = NULL;
|
||||
_ComPtr<IMFMediaTypeHandler> pHandler = NULL;
|
||||
_ComPtr<IMFMediaType> pType = NULL;
|
||||
HRESULT hr = pSource->CreatePresentationDescriptor(pPD.GetAddressOf());
|
||||
HRESULT hr = !pSource ? E_POINTER : S_OK;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
hr = pSource->CreatePresentationDescriptor(pPD.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
goto done;
|
||||
@ -3815,7 +3824,12 @@ HRESULT CvCaptureFile_MSMF::enumerateCaptureFormats(IMFMediaSource *pSource)
|
||||
_ComPtr<IMFStreamDescriptor> pSD = NULL;
|
||||
_ComPtr<IMFMediaTypeHandler> pHandler = NULL;
|
||||
_ComPtr<IMFMediaType> pType = NULL;
|
||||
HRESULT hr = pSource->CreatePresentationDescriptor(pPD.GetAddressOf());
|
||||
HRESULT hr = !pSource ? E_POINTER : S_OK;
|
||||
if (FAILED(hr))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
hr = pSource->CreatePresentationDescriptor(pPD.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user