1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

videoio(test): add extra videoio tests

This commit is contained in:
Alexander Alekhin
2019-06-17 20:47:41 +00:00
committed by Alexander Alekhin
parent 264679a725
commit baf372ad3d
2 changed files with 141 additions and 54 deletions
+18
View File
@@ -71,6 +71,24 @@ Param test_data[] = {
INSTANTIATE_TEST_CASE_P(videoio, Videoio_Gstreamer_Test, testing::ValuesIn(test_data));
TEST(Videoio_GStreamer, unsupported_pipeline)
{
VideoCaptureAPIs apiPref = CAP_GSTREAMER;
if (!isBackendAvailable(apiPref, cv::videoio_registry::getStreamBackends()))
throw SkipTestException(cv::String("Backend is not available/disabled: ") + cv::videoio_registry::getBackendName(apiPref));
// could not link videoconvert0 to matroskamux0, matroskamux0 can't handle caps video/x-raw, format=(string)RGBA
std::string pipeline = "appsrc ! videoconvert ! video/x-raw, format=(string)RGBA ! matroskamux ! filesink location=test.mkv";
Size frame_size(640, 480);
VideoWriter writer;
EXPECT_NO_THROW(writer.open(pipeline, apiPref, 0/*fourcc*/, 30/*fps*/, frame_size, true));
EXPECT_FALSE(writer.isOpened());
// no frames
EXPECT_NO_THROW(writer.release());
}
} // namespace
#endif