Changes between Version 8 and Version 9 of VicDev

06/05/07 14:50:06 (9 years ago)

Added more info on encoder and grabber initialisation


  • VicDev

    v8 v9  
    1616instantiated by vic. 
     18== ''Video grabbing/capture and sending'' == 
    1819Basically the encoding process starts with the grabber code being started by  
    1920clicking on the transmit button which calls the start() on the Grabber class.   
    2021The grabber is subclasssed into a number of classes which are specific to the  
    21 video format that is required for the particular codec selected (in the case  
    22 of JPEG on win32 it is "422" vic/video/grabber-win32.cpp:851 void 
     22video format that is required for the particular codec selected (each codec is  
     23contains it's frame-format as it's constructor argument (FT_...) - which is  
     24mapped to frame-format for the grabber by the function 'Module::fttoa()' when  
     25frame-format is called on the encoder object - the plumbing for transmission is done in ui-ctrlmenu.tcl).  
     26E.g. in the case of JPEG it is "422" (for H261/263 its is CIF/411) - On windows vic/video/grabber-win32.cpp:851 void 
    2327`Vfw422Grabber::start()`) - these methods do conversion from the native grabbed  
    2428video to the desired input format for the codec. This then calls the general  
    4145`TransmitterModule` to create an encoder - see for example  
    4246vic/codec/encoder-jepg.cpp which will implement a method: `int encode(const VideoFrame*)` 
    43 which encodes and returns the size of encoded frame. This encode method may  
     47which encodes and returns the size (in bytes) of the resulting encoded frame. This encode method may  
    4448have various other encoding stages (eg.encode_blk() in JPeg). Ultimately every  
    4549encoder makes the consume (which usually calls the encode()) method available  
    4852(converted) image data from the grabber (in whatever format the grabber has  
    4953obtained it in) - in the JPEG case it is `JpegFrame` (see vic/module.h). The  
    50 encoder is called by the grabber as above. 
     54encoder is called by the grabber as above. The video frame sizes are set in the VideoFrame object by the grabber  
     55and the encoder checks the the size when its consume method is called. 
    5257The encoder creates the resulting packet in a pktbuf* pb  
    5560the encode method the flush() method is called which calls the send method:  
    5661`SessionManager::send` (which is a subclass of Transmitter ) 
    57 implemented in 
    58 `rtp/transmitter.cpp:199 void Transmitter::send(pktbuf* pb)` - this starts  
     62implemented in `rtp/transmitter.cpp:199 void Transmitter::send(pktbuf* pb)` - this starts  
    5963another timer to schedule to the packet output dependent upon  
    6064the choosen bitrate and frame rate in the GUI.  The timeout method (void 
    7175used it) allows an externally supplied image to be composited onto the video  
    7276as a simple watermark. 
     78== ''Reception and Decoding of video packets'' == 
    7480The decoder section of vic works when the `SessionManager` object is created and