mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
select correct MediaType in MSMF backend.
This commit is contained in:
parent
cde18648dc
commit
6432f02996
@ -347,6 +347,12 @@ struct MediaType
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool VideoIsAvailable() const
|
||||||
|
{
|
||||||
|
return ((subType == MFVideoFormat_RGB32) ||
|
||||||
|
(subType == MFVideoFormat_RGB24) ||
|
||||||
|
(subType == MFVideoFormat_YUY2));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void printFormat(std::ostream& out, const GUID& fmt)
|
void printFormat(std::ostream& out, const GUID& fmt)
|
||||||
@ -627,7 +633,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (i->second.majorType == MFMediaType_Video)
|
if (i->second.majorType == MFMediaType_Video)
|
||||||
{
|
{
|
||||||
if (best.second.isEmpty() || i->second.VideoIsBetterThan(best.second, newType))
|
if (best.second.isEmpty() || (i->second.VideoIsBetterThan(best.second, newType) && i->second.VideoIsAvailable()))
|
||||||
{
|
{
|
||||||
best = *i;
|
best = *i;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user