|
|
|
@ -258,8 +258,13 @@ CvResult CV_API_CALL cv_capture_open(const char* filename, int camera_index, CV_ |
|
|
|
|
return CV_ERROR_OK; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
} |
|
|
|
|
if (cap) |
|
|
|
|
delete cap; |
|
|
|
@ -290,8 +295,13 @@ CvResult CV_API_CALL cv_capture_open_with_params( |
|
|
|
|
return CV_ERROR_OK; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
} |
|
|
|
|
if (cap) |
|
|
|
|
delete cap; |
|
|
|
@ -322,8 +332,14 @@ CvResult CV_API_CALL cv_capture_get_prop(CvPluginCapture handle, int prop, CV_OU |
|
|
|
|
*val = instance->getProperty(prop); |
|
|
|
|
return CV_ERROR_OK; |
|
|
|
|
} |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -338,8 +354,14 @@ CvResult CV_API_CALL cv_capture_set_prop(CvPluginCapture handle, int prop, doubl |
|
|
|
|
CvCapture_FFMPEG_proxy* instance = (CvCapture_FFMPEG_proxy*)handle; |
|
|
|
|
return instance->setProperty(prop, val) ? CV_ERROR_OK : CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -354,8 +376,14 @@ CvResult CV_API_CALL cv_capture_grab(CvPluginCapture handle) |
|
|
|
|
CvCapture_FFMPEG_proxy* instance = (CvCapture_FFMPEG_proxy*)handle; |
|
|
|
|
return instance->grabFrame() ? CV_ERROR_OK : CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -375,8 +403,14 @@ CvResult CV_API_CALL cv_capture_retrieve(CvPluginCapture handle, int stream_idx, |
|
|
|
|
return callback(stream_idx, img.data, img.step, img.cols, img.rows, img.channels(), userdata); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -395,8 +429,14 @@ CvResult CV_API_CALL cv_capture_retrieve(CvPluginCapture handle, int stream_idx, |
|
|
|
|
return callback(stream_idx, img.data, img.step, img.cols, img.rows, img.type(), userdata); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -417,8 +457,13 @@ CvResult CV_API_CALL cv_writer_open(const char* filename, int fourcc, double fps |
|
|
|
|
return CV_ERROR_OK; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
} |
|
|
|
|
if (wrt) |
|
|
|
|
delete wrt; |
|
|
|
@ -459,8 +504,14 @@ CvResult CV_API_CALL cv_writer_write(CvPluginWriter handle, const unsigned char |
|
|
|
|
instance->write(img); |
|
|
|
|
return CV_ERROR_OK; |
|
|
|
|
} |
|
|
|
|
catch(...) |
|
|
|
|
catch (const std::exception& e) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Exception is raised: " << e.what()); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
catch (...) |
|
|
|
|
{ |
|
|
|
|
CV_LOG_WARNING(NULL, "FFmpeg: Unknown C++ exception is raised"); |
|
|
|
|
return CV_ERROR_FAIL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|