From 3b64c91b578f2a567afebd40228aee736e9167d3 Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 16 Feb 2009 18:18:37 +0000 Subject: [PATCH] Don't fail to compile if ffmpeg compiled with swscale, though won't work. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2764 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_ffmpeg_camera.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 973f7ce3c..204cf0223 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -122,8 +122,12 @@ int FfmpegCamera::PrimeCapture() avpicture_fill( (AVPicture *)mFrame, (unsigned char *)mBuffer, PIX_FMT_RGB24, mCodecContext->width, mCodecContext->height); +#if HAVE_LIBSWSCALE if ( (mConvertContext = sws_getCachedContext( mConvertContext, mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL )) == NULL ) Fatal( "Unable to create conversion context for %s", mPath.c_str() ); +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); +#endif // HAVE_LIBSWSCALE return( 0 ); } @@ -153,8 +157,12 @@ int FfmpegCamera::Capture( Image &image ) { Debug( 1, "Got frame %d", frameCount ); +#if HAVE_LIBSWSCALE if ( sws_scale( mConvertContext, mRawFrame->data, mRawFrame->linesize, 0, mCodecContext->height, mFrame->data, mFrame->linesize ) < 0 ) Fatal( "Unable to convert raw format %d to RGB at frame %d", mCodecContext->pix_fmt, frameCount ); +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); +#endif // HAVE_LIBSWSCALE image.Assign( mCodecContext->width, mCodecContext->height, colours, (unsigned char *)mFrame->data[0] );