mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #24778 from asmorkalov:as/win_msmf_stream_type_check
Reworked camera stream check to exclude non-video formats
This commit is contained in:
commit
afe7c8b560
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <guiddef.h>
|
#include <guiddef.h>
|
||||||
|
#include <initguid.h>
|
||||||
#include <mfidl.h>
|
#include <mfidl.h>
|
||||||
#include <mfapi.h>
|
#include <mfapi.h>
|
||||||
#include <mfplay.h>
|
#include <mfplay.h>
|
||||||
@ -159,6 +160,11 @@ private:
|
|||||||
|
|
||||||
template <typename T> inline T absDiff(T a, T b) { return a >= b ? a - b : b - a; }
|
template <typename T> inline T absDiff(T a, T b) { return a >= b ? a - b : b - a; }
|
||||||
|
|
||||||
|
// synonym for system MFVideoFormat_D16. D3DFMT_D16 = 80
|
||||||
|
// added to fix builds with old MSVS and platform SDK
|
||||||
|
// see https://learn.microsoft.com/en-us/windows/win32/medfound/video-subtype-guids#luminance-and-depth-formats
|
||||||
|
DEFINE_MEDIATYPE_GUID( OCV_MFVideoFormat_D16, 80 );
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
// Structure for collecting info about types of video which are supported by current video device
|
// Structure for collecting info about types of video which are supported by current video device
|
||||||
@ -350,9 +356,7 @@ struct MediaType
|
|||||||
}
|
}
|
||||||
bool VideoIsAvailable() const
|
bool VideoIsAvailable() const
|
||||||
{
|
{
|
||||||
return ((subType == MFVideoFormat_RGB32) ||
|
return (subType != OCV_MFVideoFormat_D16);
|
||||||
(subType == MFVideoFormat_RGB24) ||
|
|
||||||
(subType == MFVideoFormat_YUY2));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user