Changeset 4187

Show
Ignore:
Timestamp:
06/25/08 15:07:28 (6 years ago)
Author:
piers
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/video/grabber-still.cpp

    r4186 r4187  
    7272//      u_char *frame_; // copied frames from StillDevice 
    7373        int     decimate_; 
    74 //      int     width_;         // width in pixel 
    75 //      int height_;    // height in pixel 
     74        int     width_;         // width in pixel 
     75        int     height_;        // height in pixel 
    7676        int num_frame_; // the number of frame 
    7777}; 
     
    165165 
    166166StillGrabber::StillGrabber() : 
    167  num_frame_(0) 
     167        width_(0), height_(0), num_frame_(0) 
    168168//      frame_(NULL), width_(0), height_(0), num_frame_(0) 
    169169{ 
     
    249249 
    250250//      num_frame_ = fread(frame_, 1, framesize_, still_device.frame_); 
    251         memcpy(frame_, still_device.frame_, framesize_);  
     251        memcpy(frame_, still_device.frame_+num_frame_, framesize_);  
     252        if ((num_frame_+= framesize_)<still_device.len_) 
     253          ; 
     254        else num_frame_=0; 
     255         
    252256#ifdef DEBUG 
    253257        debug_msg("     number of frames:       %d\n", num_frame_); 
     
    275279        /*framesize_ = 2 * width_ * height_;    // frame size in pixel 
    276280        frame_ = new u_char[2 * framesize_]; 
    277         crinit(width_, height_); 
    278         allocref();*/ 
    279 } 
     281        crinit(width_, height_);*/ 
     282        allocref(); 
     283}