[Sumover-dev] [svn commit] r4187 - vic/branches/cc/video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Jun 25 15:07:28 BST 2008


Author: piers
Date: Wed Jun 25 15:07:28 2008
New Revision: 4187

Modified:
   vic/branches/cc/video/grabber-still.cpp

Log:
Got grabber partially working with yuv file - the colour information seems to
come after the luminosity information so at the moment the image is just grey-
scale. Will need to tweak things to get YUV colour information.

Added basic frame sequence playback but it shows the that frames contain
more information that we're reading so you see a whole frame followed by a 
half a frame and half color info.

The fix from the previous versio was to re-instate the allocref(); call in the
setsize() function. Also to reinstate the height_ and width_ variables - 
although they're declared in module.h - the Grabber is not a Module.



Modified: vic/branches/cc/video/grabber-still.cpp
==============================================================================
--- vic/branches/cc/video/grabber-still.cpp	(original)
+++ vic/branches/cc/video/grabber-still.cpp	Wed Jun 25 15:07:28 2008
@@ -71,8 +71,8 @@
 
 //	u_char *frame_;	// copied frames from StillDevice
 	int	decimate_;
-//	int	width_;		// width in pixel
-//	int height_;	// height in pixel
+	int	width_;		// width in pixel
+	int	height_;	// height in pixel
 	int num_frame_;	// the number of frame
 };
 
@@ -164,7 +164,7 @@
 }
 
 StillGrabber::StillGrabber() :
- num_frame_(0)
+	width_(0), height_(0), num_frame_(0)
 //	frame_(NULL), width_(0), height_(0), num_frame_(0)
 {
 }
@@ -248,7 +248,11 @@
 */
 
 //	num_frame_ = fread(frame_, 1, framesize_, still_device.frame_);
-	memcpy(frame_, still_device.frame_, framesize_); 
+	memcpy(frame_, still_device.frame_+num_frame_, framesize_); 
+	if ((num_frame_+= framesize_)<still_device.len_)
+	  ;
+       	else num_frame_=0;
+ 	
 #ifdef DEBUG
 	debug_msg("	number of frames:	%d\n", num_frame_);
 #endif
@@ -274,6 +278,6 @@
 	debug_msg("StillGrabber::setsize()\n");
 	/*framesize_ = 2 * width_ * height_;	// frame size in pixel
 	frame_ = new u_char[2 * framesize_];
-	crinit(width_, height_);
-	allocref();*/
+	crinit(width_, height_);*/
+	allocref();
 }



More information about the Sumover-dev mailing list