Commit 34c65987 authored by Alexander Smorkalov's avatar Alexander Smorkalov

Perf test failure fixes for Media Foundation.

parent 2bc1d370
......@@ -11,11 +11,21 @@ using std::tr1::get;
typedef perf::TestBaseWithParam<String> VideoCapture_Reading;
#if defined(HAVE_MSMF)
// MPEG2 is not supported by Media Foundation yet
// http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/39a36231-8c01-40af-9af5-3c105d684429
PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_buck_bunny.avi",
"highgui/video/big_buck_bunny.mov",
"highgui/video/big_buck_bunny.mp4",
"highgui/video/big_buck_bunny.wmv" ) )
#else
PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_buck_bunny.avi",
"highgui/video/big_buck_bunny.mov",
"highgui/video/big_buck_bunny.mp4",
"highgui/video/big_buck_bunny.mpg",
"highgui/video/big_buck_bunny.wmv" ) )
#endif
{
string filename = getDataPath(GetParam());
......
......@@ -22,10 +22,16 @@ PERF_TEST_P(VideoWriter_Writing, WriteFrame,
{
string filename = getDataPath(get<0>(GetParam()));
bool isColor = get<1>(GetParam());
VideoWriter writer(cv::tempfile(".avi"), CV_FOURCC('X', 'V', 'I', 'D'), 25, cv::Size(640, 480), isColor);
TEST_CYCLE() { Mat image = imread(filename, 1); writer << image; }
Mat image = imread(filename, 1);
#if defined(HAVE_MSMF) && !defined(HAVE_VFW) && !defined(HAVE_FFMPEG) // VFW has greater priority
VideoWriter writer(cv::tempfile(".wmv"), CV_FOURCC('W', 'M', 'V', '3'),
25, cv::Size(image.cols, image.rows), isColor);
#else
VideoWriter writer(cv::tempfile(".avi"), CV_FOURCC('X', 'V', 'I', 'D'),
25, cv::Size(image.cols, image.rows), isColor);
#endif
TEST_CYCLE() { image = imread(filename, 1); writer << image; }
bool dummy = writer.isOpened();
SANITY_CHECK(dummy);
......
......@@ -21,6 +21,7 @@
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF) || \
defined(HAVE_VFW)
/*defined(HAVE_OPENNI) too specialized */ \
......@@ -34,6 +35,7 @@
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF) || \
defined(HAVE_VFW)
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment