[Sumover-dev] [svn commit] r4540 - vic/branches/mpeg4/video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Tue Dec 8 16:53:45 GMT 2009


Author: piers
Date: Tue Dec  8 16:53:45 2009
New Revision: 4540

Modified:
   vic/branches/mpeg4/video/grabber-win32DS.cpp

Log:
Updated resolution test to be more strict so it only selects resolutions that match both height and width. Fixes problem with VX6000 style cameras that had resolutions that were close but not the same as the requested ones which resulted in crash. It is possible that it is too strict for some cameras though according to the APIs its correct.

Modified: vic/branches/mpeg4/video/grabber-win32DS.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-win32DS.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-win32DS.cpp	Tue Dec  8 16:53:45 2009
@@ -972,8 +972,8 @@
                   (scc.MaxOutputSize.cx <= width_)                    &&
                   (scc.MaxOutputSize.cy <= height_)*/){
 
-               if ((abs(width_ - scc.MaxOutputSize.cx) + abs(height_ - scc.MaxOutputSize.cy))<
-                   (abs(width_ - curr_w) +abs(height_ - curr_h))) {
+               if ( (width_ <= scc.MaxOutputSize.cx) && (width_ >= scc.MinOutputSize.cx) &&
+				   (height_ <= scc.MaxOutputSize.cx) && (height_ >= scc.MinOutputSize.cy)) {
 
                     pVih = (VIDEOINFOHEADER *)pmtConfig->pbFormat;
                     //pVih->bmiHeader.biWidth     = width_;



More information about the Sumover-dev mailing list