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

mxcpcDefaultMxPEGDecoderBackEnd.cpp

00001 //           ///          //                                        Mx clientSDK
00002 //          /////        ////                    Mx Crossplatform Client Library
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxcpcDefaultMxPEGDecoderBackEnd.cpp,v $
00005 //       ///       XXX       ///     $Revision: 1.2 $
00006 //      ///      XXX XXX      ///     $Date: 2005/12/07 10:38:54 $
00007 //     ////    XXX     XXX    ////     $Author: cvs-kai $
00008 //    ////                     ////
00009 //   ////  M  O  B  O  T  I  X  ////////////////////////////////////////////////
00010 //  //// Security Vision Systems //////////////////////////////////////////////
00011 //                                                                          //
00012 //  Copyright (C) 2005 - 2006, MOBOTIX AG, Germany                         //
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 
00018 
00019 
00020 #include <mxcpcDefaultMxPEGDecoderBackEnd.h>
00021 #include <mxcpc_namespace.h>
00022 
00023 #include <cstdlib>
00024 #include <cstdio>
00025 
00026 
00027 
00028 mxcpcDefaultMxPEGDecoderBackEnd::mxcpcDefaultMxPEGDecoderBackEnd() {
00029 
00030   ReceivedFrames = 0;
00031   TileNum = 0;
00032   
00033   ErrorEncountered = false;
00034 }
00035 
00036 
00037 
00038 void mxcpcDefaultMxPEGDecoderBackEnd::videoResolutionChanged(int width, 
00039                                                              int height) {
00040                                                              
00041   char txt[100];
00042   
00043   std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00044                     "video resolution changed to %dx%d.", width, height);
00045   mxcpc::sendStatusMsg(txt);
00046 }
00047 
00048 
00049 void mxcpcDefaultMxPEGDecoderBackEnd::errorEncountered(void) {
00050 
00051   ErrorEncountered = true;
00052 }
00053 
00054 
00055 void mxcpcDefaultMxPEGDecoderBackEnd::frameComplete(void) {
00056 
00057   char txt[100];
00058 
00059   ReceivedFrames++;
00060  
00061   if(!ErrorEncountered) 
00062     std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00063                       "------ video frame #%d with %d tiles OK ------", 
00064                  ReceivedFrames, TileNum);
00065   else 
00066     std::sprintf(txt, "@@@@@@@@ mxcpcDefaultMxPEGDecoderBackEnd : CORRUPT FRAME");
00067   
00068   mxcpc::sendStatusMsg(txt);
00069     
00070            
00071   TileNum = 0;
00072   ErrorEncountered = false;
00073 }
00074 
00075 
00076 void mxcpcDefaultMxPEGDecoderBackEnd::provideVideoTilePixelTarget(
00077                                        int tile_x, int tile_y,
00078                                        mxcpc::u32 **target_ptr,
00079                                        int *row_stepping_ptr)      {
00080 
00081   *target_ptr       = (mxcpc::u32 *)TilePixelBuffer;
00082   *row_stepping_ptr = 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 Jan 30 15:52:42 2006 for mxcpc by  doxygen 1.4.4