1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Fixed MediaSDK tests and build warnings

This commit is contained in:
Maksim Shabunin
2017-08-30 18:08:36 +03:00
parent 05b99a4dde
commit 235b00b6ee
3 changed files with 17 additions and 20 deletions
+10 -10
View File
@@ -30,24 +30,24 @@ TEST(Videoio_MFX, write_invalid)
{
const string filename = cv::tempfile(".264");
VideoWriter writer;
bool res;
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX, filename, VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(641, 480), true));
bool res = true;
ASSERT_NO_THROW(res = writer.open(filename, CAP_INTEL_MFX, VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(641, 480), true));
EXPECT_FALSE(res);
EXPECT_FALSE(writer.isOpened());
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX,filename, VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(640, 481), true));
ASSERT_NO_THROW(res = writer.open(filename, CAP_INTEL_MFX, VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(640, 481), true));
EXPECT_FALSE(res);
EXPECT_FALSE(writer.isOpened());
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX,filename, VideoWriter::fourcc('A', 'B', 'C', 'D'), 1, Size(640, 480), true));
ASSERT_NO_THROW(res = writer.open(filename, CAP_INTEL_MFX, VideoWriter::fourcc('A', 'B', 'C', 'D'), 1, Size(640, 480), true));
EXPECT_FALSE(res);
EXPECT_FALSE(writer.isOpened());
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX,String(), VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(640, 480), true));
ASSERT_NO_THROW(res = writer.open(String(), CAP_INTEL_MFX, VideoWriter::fourcc('H', '2', '6', '4'), 1, Size(640, 480), true));
EXPECT_FALSE(res);
EXPECT_FALSE(writer.isOpened());
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX,filename, VideoWriter::fourcc('H', '2', '6', '4'), 0, Size(640, 480), true));
ASSERT_ANY_THROW(res = writer.open(filename, CAP_INTEL_MFX, VideoWriter::fourcc('H', '2', '6', '4'), 0, Size(640, 480), true));
EXPECT_FALSE(res);
EXPECT_FALSE(writer.isOpened());
ASSERT_NO_THROW(res = writer.open(CAP_INTEL_MFX,filename, VideoWriter::fourcc('H', '2', '6', '4'), 30, Size(640, 480), true));
ASSERT_NO_THROW(res = writer.open(filename, CAP_INTEL_MFX, VideoWriter::fourcc('H', '2', '6', '4'), 30, Size(640, 480), true));
ASSERT_TRUE(res);
ASSERT_TRUE(writer.isOpened());
Mat t;
@@ -103,7 +103,7 @@ TEST_P(Videoio_MFX, read_write_raw)
// Write video
VideoWriter writer;
writer.open(CAP_INTEL_MFX, filename, fourcc, FPS, FRAME_SIZE, isColor);
writer.open(filename, CAP_INTEL_MFX, fourcc, FPS, FRAME_SIZE, isColor);
ASSERT_TRUE(writer.isOpened());
Mat frame(FRAME_SIZE, CV_8UC3);
for (int i = 0; i < FRAME_COUNT; ++i)
@@ -133,9 +133,9 @@ TEST_P(Videoio_MFX, read_write_raw)
EXPECT_EQ(goodFrame.type(), frame.type());
double psnr = cvtest::PSNR(goodFrame, frame);
if (fourcc == VideoWriter::fourcc('M', 'P', 'G', '2'))
EXPECT_GT(psnr, 37); // experimentally chosen value
EXPECT_GT(psnr, 31); // experimentally chosen value
else
EXPECT_GT(psnr, 43); // experimentally chosen value
EXPECT_GT(psnr, 33); // experimentally chosen value
goodFrames.pop();
}
EXPECT_FALSE(cap.read(frame));