From 34533dc569cde73be02a9d52c0c8e4c43aacb6d0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 29 Sep 2014 00:39:35 +0200 Subject: [PATCH] Use FFMPEG capture only if HAVE_FFMPEG flag is defined. --- modules/videoio/src/cap.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/videoio/src/cap.cpp b/modules/videoio/src/cap.cpp index 30ec7ecc9..ee2405898 100644 --- a/modules/videoio/src/cap.cpp +++ b/modules/videoio/src/cap.cpp @@ -363,8 +363,10 @@ CV_IMPL CvCapture * cvCreateFileCapture (const char * filename) { CvCapture * result = 0; +#ifdef HAVE_FFMPEG if (! result) result = cvCreateFileCapture_FFMPEG_proxy (filename); +#endif #ifdef HAVE_VFW if (! result) @@ -421,8 +423,10 @@ CV_IMPL CvVideoWriter* cvCreateVideoWriter( const char* filename, int fourcc, if(!fourcc || !fps) result = cvCreateVideoWriter_Images(filename); +#ifdef HAVE_FFMPEG if(!result) result = cvCreateVideoWriter_FFMPEG_proxy (filename, fourcc, fps, frameSize, is_color); +#endif #ifdef HAVE_VFW if(!result) @@ -454,6 +458,19 @@ CV_IMPL CvVideoWriter* cvCreateVideoWriter( const char* filename, int fourcc, result = cvCreateVideoWriter_GStreamer(filename, fourcc, fps, frameSize, is_color); #endif +#if !defined(HAVE_FFMPEG) && \ + !defined(HAVE_VFW) && \ + !defined(HAVE_MSMF) && \ + !defined(HAVE_AVFOUNDATION) && \ + !defined(HAVE_QUICKTIME) && \ + !defined(HAVE_QTKIT) && \ + !defined(HAVE_GSTREAMER) +// If none of the writers is used +// these statements suppress 'unused parameter' warnings. + (void)frameSize; + (void)is_color; +#endif + if(!result) result = cvCreateVideoWriter_Images(filename);