Commit 996f02a5 authored by Alexander Smorkalov's avatar Alexander Smorkalov

Multiple Media Foundation video i/o fixes.

Video i/o tests enabled for media foundation;
Negative stride support added to VideoCapture;
Error handling improved, dead lock in case of playback error fixed;
Some code refacotring done.
parent 0c9d7760
This diff is collapsed.
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
/*defined(HAVE_OPENNI) || too specialized */ \ /*defined(HAVE_OPENNI) || too specialized */ \
defined(HAVE_FFMPEG) defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF)
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else #else
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0 # define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
...@@ -57,7 +58,8 @@ ...@@ -57,7 +58,8 @@
defined(HAVE_GSTREAMER) || \ defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) defined(HAVE_FFMPEG) || \
defined(HAVE_MSMF)
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
#else #else
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
......
...@@ -54,6 +54,33 @@ string fourccToString(int fourcc) ...@@ -54,6 +54,33 @@ string fourccToString(int fourcc)
return format("%c%c%c%c", fourcc & 255, (fourcc >> 8) & 255, (fourcc >> 16) & 255, (fourcc >> 24) & 255); return format("%c%c%c%c", fourcc & 255, (fourcc >> 8) & 255, (fourcc >> 16) & 255, (fourcc >> 24) & 255);
} }
#ifdef HAVE_MSMF
const VideoFormat g_specific_fmt_list[] =
{
/* VideoFormat("avi", 'dv25'),
VideoFormat("avi", 'dv50'),
VideoFormat("avi", 'dvc '),
VideoFormat("avi", 'dvh1'),
VideoFormat("avi", 'dvhd'),
VideoFormat("avi", 'dvsd'),
VideoFormat("avi", 'dvsl'),
VideoFormat("avi", 'M4S2'), */
VideoFormat("wmv", 'WMV3'),
// VideoFormat("avi", 'H264'),
// VideoFormat("avi", 'MJPG'),
// VideoFormat("avi", 'MP43'),
// VideoFormat("avi", 'MP4S'),
// VideoFormat("avi", 'MP4V'),
/* VideoFormat("avi", 'MPG1'),
VideoFormat("avi", 'MSS1'),
VideoFormat("avi", 'MSS2'),
VideoFormat("avi", 'WMV1'),
VideoFormat("avi", 'WMV2'),
VideoFormat("avi", 'WMV3'),
VideoFormat("avi", 'WVC1'), */
VideoFormat()
};
#else
const VideoFormat g_specific_fmt_list[] = const VideoFormat g_specific_fmt_list[] =
{ {
VideoFormat("avi", CV_FOURCC('X', 'V', 'I', 'D')), VideoFormat("avi", CV_FOURCC('X', 'V', 'I', 'D')),
...@@ -63,17 +90,17 @@ const VideoFormat g_specific_fmt_list[] = ...@@ -63,17 +90,17 @@ const VideoFormat g_specific_fmt_list[] =
VideoFormat("mkv", CV_FOURCC('X', 'V', 'I', 'D')), VideoFormat("mkv", CV_FOURCC('X', 'V', 'I', 'D')),
VideoFormat("mkv", CV_FOURCC('M', 'P', 'E', 'G')), VideoFormat("mkv", CV_FOURCC('M', 'P', 'E', 'G')),
VideoFormat("mkv", CV_FOURCC('M', 'J', 'P', 'G')), VideoFormat("mkv", CV_FOURCC('M', 'J', 'P', 'G')),
VideoFormat("mov", CV_FOURCC('m', 'p', '4', 'v')), VideoFormat("mov", CV_FOURCC('m', 'p', '4', 'v')),
VideoFormat() VideoFormat()
}; };
#endif
} }
class CV_HighGuiTest : public cvtest::BaseTest class CV_HighGuiTest : public cvtest::BaseTest
{ {
protected: protected:
void ImageTest(const string& dir); void ImageTest (const string& dir);
void VideoTest (const string& dir, const cvtest::VideoFormat& fmt); void VideoTest (const string& dir, const cvtest::VideoFormat& fmt);
void SpecificImageTest (const string& dir); void SpecificImageTest (const string& dir);
void SpecificVideoTest (const string& dir, const cvtest::VideoFormat& fmt); void SpecificVideoTest (const string& dir, const cvtest::VideoFormat& fmt);
...@@ -291,8 +318,11 @@ void CV_HighGuiTest::VideoTest(const string& dir, const cvtest::VideoFormat& fmt ...@@ -291,8 +318,11 @@ void CV_HighGuiTest::VideoTest(const string& dir, const cvtest::VideoFormat& fmt
if (psnr < thresDbell) if (psnr < thresDbell)
{ {
printf("Too low psnr = %gdb\n", psnr); printf("Too low psnr = %gdb\n", psnr);
// imwrite("img.png", img); //imwrite("original.png", img);
// imwrite("img1.png", img1); //imwrite("after_test.png", img1);
//Mat diff;
//absdiff(img, img1, diff);
//imwrite("diff.png", diff);
ts->set_failed_test_info(ts->FAIL_MISMATCH); ts->set_failed_test_info(ts->FAIL_MISMATCH);
break; break;
} }
......
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