Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members

mxcpcDefaultMxPEGDecoderBackEnd.cpp

00001 //           ///          //
00002 //          /////        ////
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxcpcDefaultMxPEGDecoderBackEnd.cpp,v $  
00005 //       ///       XXX       ///     $Revision: 1.9 $
00006 //      ///      XXX XXX      ///     $Date: 2005/08/09 13:57:26 $
00007 //     ////    XXX     XXX    ////     $Author: cvs-steve $
00008 //    ////                     ////
00009 //   ////  M  O  B  O  T  I  X  ////////////////////////////////////////////////
00010 //  //// Security Vision Systems ///////////////////////////////////////////////
00011 
00012 // Copyright (c) 2005, MOBOTIX AG.
00013 // This software is made available under the BSD licence. Please refer 
00014 // to the file LICENCE.TXT contained in this distribution for details.
00015 
00016 
00017 #include <mxcpcDefaultMxPEGDecoderBackEnd.h>
00018 #include <mxcpc_namespace.h>
00019 
00020 #include <cstdlib>
00021 #include <cstdio>
00022 
00023 
00024 
00025 mxcpcDefaultMxPEGDecoderBackEnd::mxcpcDefaultMxPEGDecoderBackEnd() {
00026 
00027   ReceivedFrames = 0;
00028   TileNum = 0;
00029   
00030   ErrorEncountered = false;
00031 }
00032 
00033 
00034 
00035 void mxcpcDefaultMxPEGDecoderBackEnd::videoResolutionChanged(int width, 
00036                                                              int height) {
00037                                                              
00038   char txt[100];
00039   
00040   std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00041                     "video resolution changed to %dx%d.", width, height);
00042   mxcpc::sendStatusMsg(txt);
00043 }
00044 
00045 
00046 void mxcpcDefaultMxPEGDecoderBackEnd::errorEncountered(void) {
00047 
00048   ErrorEncountered = true;
00049 }
00050 
00051 
00052 void mxcpcDefaultMxPEGDecoderBackEnd::frameComplete(void) {
00053 
00054   char txt[100];
00055 
00056   ReceivedFrames++;
00057  
00058   if(!ErrorEncountered) 
00059     std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00060                       "------ video frame #%d with %d tiles OK ------", 
00061                  ReceivedFrames, TileNum);
00062   else 
00063     std::sprintf(txt, "@@@@@@@@ mxcpcDefaultMxPEGDecoderBackEnd : CORRUPT FRAME");
00064   
00065   mxcpc::sendStatusMsg(txt);
00066     
00067            
00068   TileNum = 0;
00069   ErrorEncountered = false;
00070 }
00071 
00072 
00073 void mxcpcDefaultMxPEGDecoderBackEnd::provideVideoTilePixelTarget(
00074                                        int tile_x, int tile_y,
00075                                        mxcpc::u32 **target_ptr,
00076                                        int *row_stepping_ptr)      {
00077 
00078   *target_ptr       = (mxcpc::u32 *)TilePixelBuffer;
00079   *row_stepping_ptr = 0;                                       
00080 
00081   // asign so no warning ...
00082   tile_x = tile_y =0;
00083 }
00084 
00085                                                              
00086 void mxcpcDefaultMxPEGDecoderBackEnd::videoTileReceived(void) {
00087 
00088   TileNum++;
00089 }
00090 
00091 
00092 int mxcpcDefaultMxPEGDecoderBackEnd::getDecodedFramesNum(void) {
00093 
00094   return(ReceivedFrames);
00095 }
00096 

Generated on Mon Aug 15 03:39:29 2005 for mxcpc by  doxygen 1.4.2-20050421