|
|
|
@ -392,27 +392,6 @@ typedef std::vector<cap_property_t> cap_properties_t; |
|
|
|
|
typedef std::pair<std::string, cap_properties_t> ffmpeg_cap_properties_param_t; |
|
|
|
|
typedef testing::TestWithParam<ffmpeg_cap_properties_param_t> ffmpeg_cap_properties; |
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
|
namespace { |
|
|
|
|
::testing::AssertionResult IsOneOf(double value, double expected1, double expected2) |
|
|
|
|
{ |
|
|
|
|
// internal floating point class is used to perform accurate floating point types comparison
|
|
|
|
|
typedef ::testing::internal::FloatingPoint<double> FloatingPoint; |
|
|
|
|
|
|
|
|
|
FloatingPoint val(value); |
|
|
|
|
if (val.AlmostEquals(FloatingPoint(expected1)) || val.AlmostEquals(FloatingPoint(expected2))) |
|
|
|
|
{ |
|
|
|
|
return ::testing::AssertionSuccess(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
return ::testing::AssertionFailure() |
|
|
|
|
<< value << " is neither equal to " << expected1 << " nor " << expected2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
TEST_P(ffmpeg_cap_properties, can_read_property) |
|
|
|
|
{ |
|
|
|
|
if (!videoio_registry::hasBackend(CAP_FFMPEG)) |
|
|
|
@ -429,13 +408,8 @@ TEST_P(ffmpeg_cap_properties, can_read_property) |
|
|
|
|
{ |
|
|
|
|
const cap_property_t& prop = properties[i]; |
|
|
|
|
const double actualValue = cap.get(static_cast<int>(prop.first)); |
|
|
|
|
#ifndef _WIN32 |
|
|
|
|
EXPECT_DOUBLE_EQ(actualValue, prop.second) |
|
|
|
|
<< "Property " << static_cast<int>(prop.first) << " has wrong value"; |
|
|
|
|
#else |
|
|
|
|
EXPECT_TRUE(IsOneOf(actualValue, prop.second, 0.0)) |
|
|
|
|
<< "Property " << static_cast<int>(prop.first) << " has wrong value"; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -588,11 +562,6 @@ TEST_P(videoio_ffmpeg_16bit, basic) |
|
|
|
|
const double time_sec = 1; |
|
|
|
|
const int numFrames = static_cast<int>(fps * time_sec); |
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 // TODO: FFmpeg wrapper update
|
|
|
|
|
if (isSupported) |
|
|
|
|
throw SkipTestException("FFmpeg wrapper update is required"); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
VideoWriter writer; |
|
|
|
|
writer.open(filename, CAP_FFMPEG, fourcc, fps, sz, |
|
|
|
|