ffmpeg 2.9 patched removed SSE2 CPU flags as these are automatically detected

for all ffmpeg versions circa 2010. This commit removes the if statement on
duplicated functions.
This commit is contained in:
SteveGilvarry 2015-11-04 16:24:39 +11:00
parent 51914994f7
commit 5ba13f1a76
3 changed files with 7 additions and 16 deletions

View File

@ -187,11 +187,8 @@ int FfmpegCamera::Capture( Image &image )
#if HAVE_LIBSWSCALE
if(mConvertContext == NULL) {
if(config.cpu_extensions && sseversion >= 20) {
mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
} else {
mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
}
if(mConvertContext == NULL)
Fatal( "Unable to create conversion context for %s", mPath.c_str() );
}

View File

@ -631,14 +631,11 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize);
}
if(config.cpu_extensions && sseversion >= 20) {
imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
} else {
imgConversionContext = sws_getContext(width, height, capturePixFormat, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
}
if ( !imgConversionContext )
if ( !imgConversionContext ) {
Fatal( "Unable to initialise image scaling context" );
}
}
#endif

View File

@ -333,11 +333,8 @@ int RemoteCameraRtsp::Capture( Image &image )
#if HAVE_LIBSWSCALE
if(mConvertContext == NULL) {
if(config.cpu_extensions && sseversion >= 20) {
mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
} else {
mConvertContext = sws_getContext( mCodecContext->width, mCodecContext->height, mCodecContext->pix_fmt, width, height, imagePixFormat, SWS_BICUBIC, NULL, NULL, NULL );
}
if(mConvertContext == NULL)
Fatal( "Unable to create conversion context");
}