Few small fixes:

1) Added a workaround against SWS_CPU_CAPS_SSE2 not being defined.
2) Fixed enableDisableAlarms javascript error.
3) swscale unsupported format errors now include the unsupported format in the error.
4) Fixed a small error affecting local cameras with rotation enabled.
pull/49/head
Kfir Itzhak 2012-03-07 14:33:09 +02:00
parent 8d304972f1
commit 2dfdc8129c
5 changed files with 13 additions and 12 deletions

View File

@ -54,6 +54,11 @@ extern "C" {
#else // FFMPEG_VERSION_INT
#define ZM_FFMPEG_SVN 1
#endif // FFMPEG_VERSION_INT
/* Fix for not having SWS_CPU_CAPS_SSE2 defined */
#ifndef SWS_CPU_CAPS_SSE2
#define SWS_CPU_CAPS_SSE2 0x02000000
#endif
#endif // HAVE_LIBAVCODEC

View File

@ -158,11 +158,11 @@ int FfmpegCamera::PrimeCapture()
#if HAVE_LIBSWSCALE
if(!sws_isSupportedInput(mCodecContext->pix_fmt)) {
Fatal("swscale does not support the codec format");
Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff));
}
if(!sws_isSupportedOutput(imagePixFormat)) {
Fatal("swscale does not support the target format");
Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff));
}
#else // HAVE_LIBSWSCALE

View File

@ -339,7 +339,7 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
Error("Automatic format selection failed. Falling back to YUYV");
palette = V4L2_PIX_FMT_YUYV;
} else {
Debug(2,"Selected capture palette: %s (%c%c%c%c)",palette_desc,palette&0xff, (palette>>8)&0xff, (palette>>16)&0xff, (palette>>24)&0xff );
Info("Selected capture palette: %s (%c%c%c%c)", palette_desc, palette&0xff, (palette>>8)&0xff, (palette>>16)&0xff, (palette>>24)&0xff);
}
}
#endif
@ -419,11 +419,11 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
}
if( capture ) {
if(!sws_isSupportedInput(capturePixFormat)) {
Error("swscale does not support the used capture format");
Error("swscale does not support the used capture format: %c%c%c%c",(capturePixFormat)&0xff,((capturePixFormat>>8)&0xff),((capturePixFormat>>16)&0xff),((capturePixFormat>>24)&0xff));
conversion_type = 2; /* Try ZM format conversions */
}
if(!sws_isSupportedOutput(imagePixFormat)) {
Error("swscale does not support the target format");
Error("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff));
conversion_type = 2; /* Try ZM format conversions */
}
}
@ -2013,7 +2013,7 @@ int LocalCamera::Capture( Image &image )
buffer = (unsigned char *)v4l2_data.buffers[v4l2_data.bufptr->index].start;
buffer_bytesused = v4l2_data.bufptr->bytesused;
if(v4l2_data.fmt.fmt.pix.width != width && v4l2_data.fmt.fmt.pix.height != height) {
if((v4l2_data.fmt.fmt.pix.width * v4l2_data.fmt.fmt.pix.height) != (width * height)) {
Fatal("Captured image dimensions differ: V4L2: %dx%d monitor: %dx%d",v4l2_data.fmt.fmt.pix.width,v4l2_data.fmt.fmt.pix.height,width,height);
}

View File

@ -202,11 +202,11 @@ int RemoteCameraRtsp::PrimeCapture()
#if HAVE_LIBSWSCALE
if(!sws_isSupportedInput(mCodecContext->pix_fmt)) {
Fatal("swscale does not support the codec format");
Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff));
}
if(!sws_isSupportedOutput(imagePixFormat)) {
Fatal("swscale does not support the target format");
Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff));
}
#else // HAVE_LIBSWSCALE

View File

@ -204,10 +204,6 @@ function getStreamCmdResponse( respObj, respText )
}
$('enableDisableAlarms').removeClass( 'hidden' );
}
else
{
$('enableDisableAlarms').addClass( 'hidden' );
}
}
else
checkStreamForErrors("getStreamCmdResponse",respObj);//log them