00001 // /// // Mx clientSDK 00002 // ///// //// Mx Crossplatform Client Library 00003 // /// XXX XXX /// 00004 // /// XXX XXX /// $RCSfile: mxcpcMxPEGDecoderBackEnd.h,v $ 00005 // /// XXX /// $Revision: 1.3 $ 00006 // /// XXX XXX /// $Date: 2005/12/09 15:33:45 $ 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 #ifndef __MXCPC_MXPEGDECODERBACKEND_H__ 00021 #define __MXCPC_MXPEGDECODERBACKEND_H__ 00022 00023 00024 00025 #include <mxcpc_namespace.h> 00026 00027 00028 00029 //! Interface (baseclass) to MxPEG decoder backends. 00030 /*! 00031 * \ingroup mxcpc_core 00032 * 00033 * Backends decide for what is actually to be done with video tiles and 00034 * audio segments decoded from a MxPEG stream. 00035 * 00036 */ 00037 class mxcpcMxPEGDecoderBackEnd { 00038 00039 public: 00040 virtual ~mxcpcMxPEGDecoderBackEnd(); 00041 00042 public: 00043 00044 //! To inform the backend that the stream switched to another video 00045 //! resolution. 00046 /*! 00047 * Guaranteed to be called at least once before the first tiles arrive. 00048 * 00049 * Guaranteed to be called with both dimensions being positive. 00050 */ 00051 virtual void videoResolutionChanged(int width, int height) = 0; 00052 00053 //! To inform the backend that while decoding the current frame, an error 00054 //! condition was encountered. 00055 /*! 00056 * Can be called multiple times while decoding of a frame is in progress. 00057 * Processing of current frame is to be cosidered as finished only when 00058 * the frameComplete() method is invoked. 00059 */ 00060 virtual void errorEncountered(void) = 0; 00061 00062 //! To inform the backend that decoding of the current frame was finished 00063 //! and that - as a result - the following video tiles belong to the next 00064 //! frame. 00065 /*! 00066 * \note A call to this method does not mean that the frame was decoded 00067 * <i>successfully</i>, see errorEncountered(). 00068 */ 00069 virtual void frameComplete(void) = 0; 00070 00071 //! By calling this method the decoder asks the backend where to store the 00072 //! decoded pixel data for the next video tile. 00073 /*! 00074 * The pixel data will be written out RGBRGBRGB... with one byte per color 00075 * channel. Between rows, a certain amount of memory is skipped according 00076 * to the specified row stepping which is given in <tt>u32</tt> units. 00077 * It is perfectly legal to specify negative values here, in fact this is 00078 * how it will be handled in most cases when <tt>OpenGL</tt> is involved in 00079 * the actual rendering, because here, the origin of 2D image data is 00080 * usually located in the lower/left corner. 00081 */ 00082 virtual void provideVideoTilePixelTarget(int tile_x, int tile_y, 00083 mxcpc::u32 **target_ptr, 00084 int *row_stepping_ptr) = 0; 00085 //! To inform the backend about a received video tile. 00086 /*! It has been stored to the pixel target provided by the backend 00087 * through a previous call to provideVideoTilePixelTarget(). 00088 */ 00089 virtual void videoTileReceived(void) = 0; 00090 }; 00091 00092 00093 00094 #endif // __MXCPC_MXPEGDECODERBACKEND_H__