Split highgui module to videoio and highgui
This commit is contained in:
40
modules/videoio/perf/perf_input.cpp
Normal file
40
modules/videoio/perf/perf_input.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "perf_precomp.hpp"
|
||||
|
||||
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
|
||||
typedef perf::TestBaseWithParam<std::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());
|
||||
|
||||
VideoCapture cap;
|
||||
|
||||
TEST_CYCLE() cap.open(filename);
|
||||
|
||||
bool dummy = cap.isOpened();
|
||||
SANITY_CHECK(dummy);
|
||||
}
|
||||
|
||||
#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT
|
3
modules/videoio/perf/perf_main.cpp
Normal file
3
modules/videoio/perf/perf_main.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "perf_precomp.hpp"
|
||||
|
||||
CV_PERF_TEST_MAIN(videoio)
|
40
modules/videoio/perf/perf_output.cpp
Normal file
40
modules/videoio/perf/perf_output.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "perf_precomp.hpp"
|
||||
|
||||
#if BUILD_WITH_VIDEO_OUTPUT_SUPPORT
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace perf;
|
||||
using std::tr1::make_tuple;
|
||||
using std::tr1::get;
|
||||
|
||||
typedef std::tr1::tuple<std::string, bool> VideoWriter_Writing_t;
|
||||
typedef perf::TestBaseWithParam<VideoWriter_Writing_t> VideoWriter_Writing;
|
||||
|
||||
PERF_TEST_P(VideoWriter_Writing, WriteFrame,
|
||||
testing::Combine( testing::Values( "python/images/QCIF_00.bmp",
|
||||
"python/images/QCIF_01.bmp",
|
||||
"python/images/QCIF_02.bmp",
|
||||
"python/images/QCIF_03.bmp",
|
||||
"python/images/QCIF_04.bmp",
|
||||
"python/images/QCIF_05.bmp" ),
|
||||
testing::Bool()))
|
||||
{
|
||||
string filename = getDataPath(get<0>(GetParam()));
|
||||
bool isColor = get<1>(GetParam());
|
||||
Mat image = imread(filename, 1);
|
||||
#if defined(HAVE_MSMF) && !defined(HAVE_VFW) && !defined(HAVE_FFMPEG) // VFW has greater priority
|
||||
VideoWriter writer(cv::tempfile(".wmv"), VideoWriter::fourcc('W', 'M', 'V', '3'),
|
||||
25, cv::Size(image.cols, image.rows), isColor);
|
||||
#else
|
||||
VideoWriter writer(cv::tempfile(".avi"), VideoWriter::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);
|
||||
}
|
||||
|
||||
#endif // BUILD_WITH_VIDEO_OUTPUT_SUPPORT
|
49
modules/videoio/perf/perf_precomp.hpp
Normal file
49
modules/videoio/perf/perf_precomp.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
# if defined __clang__ || defined __APPLE__
|
||||
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
# pragma GCC diagnostic ignored "-Wextra"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef __OPENCV_PERF_PRECOMP_HPP__
|
||||
#define __OPENCV_PERF_PRECOMP_HPP__
|
||||
|
||||
#include "opencv2/ts.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
|
||||
#ifdef GTEST_CREATE_SHARED_LIBRARY
|
||||
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_XINE) || \
|
||||
defined(HAVE_GSTREAMER) || \
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_QTKIT) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(HAVE_MSMF) || \
|
||||
defined(HAVE_VFW)
|
||||
/*defined(HAVE_OPENNI) too specialized */ \
|
||||
|
||||
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
|
||||
#else
|
||||
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#if /*defined(HAVE_XINE) || */\
|
||||
defined(HAVE_GSTREAMER) || \
|
||||
defined(HAVE_QUICKTIME) || \
|
||||
defined(HAVE_QTKIT) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_FFMPEG) || \
|
||||
defined(HAVE_MSMF) || \
|
||||
defined(HAVE_VFW)
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
|
||||
#else
|
||||
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user