#######################################
#A Simple PPM frame Frag/Defrag interface
#
#@author Wenchang Yan
#@date Mar, 2002
#######################################

0) Source Files and Class relations
1) Installation
2) How to run
3) How to use the interface
4) Known bugs
5) To do



 
 

0) Source Files and Class relations

    connect.{c,h}                        For UDP connection

    getopt.{c,h}                          Command line option utility

 ppmdecoder.{cpp,h}    Contains the PPMDecoder class, which has a PPMP_Receiver
                                                                class as a member variable.

 PPMP.{cpp,h}        Contains the fragment classes for PPM frag/defrag, some are
                                                                similar to UDFP classes in
                       $QUO_ROOT/UAV/uav/qosket/fragment/cpp

 ppmudpreader.{cpp,h}  A PPM fragmentation class specified for UDP connection

 reader.cpp          The test loop for ppmudpreader

 receiver.cpp        The test loop for ppmdecoder
 

   The class diagram:

 //ToDo
 


1) Installation

    Depends on your needs, modify the Makefile and put whatever you like into one library.

2) How to run

    First start the receiver as $what_ever_dir/receiver.
    Or you can type  $what_ever_dir/receiver -h for more information to choose the command line option.

    Second, start the reader as $what_ever_dir/reader -n 40.
  Or you can type $what_ever_dir/receiver -h to view more command line options like
the receiver host id or the receiver UDP port number.

    You may check the PPM files created by the receiver.

3) How to use the interface

     There are several ways to use this interface in your implementation. You may take a look at the
     testing example before you use it.

    a) You may replace the
          PPMDecoder::process_whole_frame(const char* frame, size_t len)
         method in the PPMDecoder class to do whatever you want on the accumulated complete frame.
         For example, you can forward the PPM frame further in the relay.

    b) You may make your own ppm decoder class which derive from the PPMDecoder class. Also
         please pay attention to the process_whole_frame method.
         Look at the class definition of the PPMDecoder class in ppmdecoder.h.
 
    c) Do-it-yourself. You may modify anything to tailor your requirement.
 


4) Known bugs

     There must be some bugs in these files.

      e.g.
      a) htonl, htons and ntohl, ntohs should be used on the sender/receiver side. But
           Assume everybody runs Linux, this should not be a problem for the time being.
      b) The color depth. Now we only consider 24bpp pixelmap and graymap.
      c) Appropriate mem allocation at the receiver side shall be considered in the future. If you have
           receive signal SIGSEGV when running it, most likely it's because of the malloc problem.
      d) You may tune the usleep number in PPMP.cpp in order to synchronize your sender and
           receiverll  depending on your system setup.
 


5) To do

     a) Sometimes the color seems wrong.