From 6e0db3f52760b17614dc308872ed44b244d53de1 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 29 Nov 2012 15:44:24 +0400 Subject: [PATCH] Feature #1322 "If dll cannot be loaded a warning should be generated" implemented. --- modules/highgui/src/cap_ffmpeg.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/modules/highgui/src/cap_ffmpeg.cpp b/modules/highgui/src/cap_ffmpeg.cpp index 040adbd507..f9fc75cc4b 100644 --- a/modules/highgui/src/cap_ffmpeg.cpp +++ b/modules/highgui/src/cap_ffmpeg.cpp @@ -114,24 +114,18 @@ private: icvWriteFrame_FFMPEG_p = (CvWriteFrame_Plugin)GetProcAddress(icvFFOpenCV, "cvWriteFrame_FFMPEG"); -#if 0 - if( icvCreateFileCapture_FFMPEG_p != 0 && - icvReleaseCapture_FFMPEG_p != 0 && - icvGrabFrame_FFMPEG_p != 0 && - icvRetrieveFrame_FFMPEG_p != 0 && - icvSetCaptureProperty_FFMPEG_p != 0 && - icvGetCaptureProperty_FFMPEG_p != 0 && - icvCreateVideoWriter_FFMPEG_p != 0 && - icvReleaseVideoWriter_FFMPEG_p != 0 && - icvWriteFrame_FFMPEG_p != 0 ) + if( icvCreateFileCapture_FFMPEG_p == NULL || + icvReleaseCapture_FFMPEG_p == NULL || + icvGrabFrame_FFMPEG_p == NULL || + icvRetrieveFrame_FFMPEG_p == NULL || + icvSetCaptureProperty_FFMPEG_p == NULL || + icvGetCaptureProperty_FFMPEG_p == NULL || + icvCreateVideoWriter_FFMPEG_p == NULL || + icvReleaseVideoWriter_FFMPEG_p == NULL || + icvWriteFrame_FFMPEG_p == NULL ) { - printf("Successfully initialized ffmpeg plugin!\n"); + fprintf(stderr, "Failed to load FFMPEG plugin: module handle=%p\n", icvFFOpenCV); } - else - { - printf("Failed to load FFMPEG plugin: module handle=%p\n", icvFFOpenCV); - } -#endif } #elif defined HAVE_FFMPEG icvCreateFileCapture_FFMPEG_p = (CvCreateFileCapture_Plugin)cvCreateFileCapture_FFMPEG;