00001 // /// // Mx clientSDK 00002 // ///// //// Mx Crossplatform Client Library 00003 // /// XXX XXX /// 00004 // /// XXX XXX /// $RCSfile: mxcpcBufferedMxPEGVideoRenderer.h,v $ 00005 // /// XXX /// $Revision: 1.5 $ 00006 // /// XXX XXX /// $Date: 2006/01/18 17:24:59 $ 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_BUFFEREDMXPEGVIDEORENDERER_H__ 00021 #define __MXCPC_BUFFEREDMXPEGVIDEORENDERER_H__ 00022 00023 00024 00025 #include <mxcpcBufferedMxPEGDecoderBackEnd.h> 00026 00027 #include <QObject> 00028 #include <QTime> 00029 00030 00031 00032 class mxcpcVideoDisplay; 00033 00034 00035 00036 //! <tt>OpenGL</tt>-based <tt>MxPEG</tt> decoder backend internally buffering 00037 //! video tile updates and transmitting to the graphics hardware frame-wise and 00038 //! only as frames complete. 00039 /*! 00040 * \ingroup mxcpc_tek 00041 * 00042 * This backend was devised to be used with the mxcpcSimpleMxPEGViewer. 00043 * 00044 * It uses the classic Mx approach - opposed to the alternative of writing to 00045 * the graphics hardware tile-wise and upon arrival of every single tile as it 00046 * is done by mxcpcSimpleMxPEGVideoTileRenderer. 00047 */ 00048 class mxcpcBufferedMxPEGVideoRenderer 00049 : public QObject, 00050 public mxcpcBufferedMxPEGDecoderBackEnd 00051 { 00052 00053 Q_OBJECT 00054 00055 private: 00056 mxcpcVideoDisplay *Viewer; 00057 int CenterX, CenterY, 00058 OffsetX, OffsetY; 00059 int FrameCount; 00060 int FramerateMeasureInterval; 00061 QTime FramerateMeasureTime; 00062 int FramerateFrameCount; 00063 00064 public: 00065 //! The constructor does <b>not</b> assume ownership over the viewer widget! 00066 mxcpcBufferedMxPEGVideoRenderer(mxcpcVideoDisplay *viewer); 00067 ~mxcpcBufferedMxPEGVideoRenderer(); 00068 00069 signals: 00070 //! Emitted if framerate measure mode is enabled and a new framerate measure 00071 //! becomes available (roughly every <i>n</i> milliseconds with <i>n</i> 00072 //! as it was specified to setFramerateMeasureModeEnabled()). 00073 void framerateMeasured(float fps); 00074 00075 public: 00076 //! Retrieves the current value of the renderer's internal frame counter. 00077 int getFrameCount(void); 00078 //! Toggles framerate measure mode. 00079 void setFramerateMeasureModeEnabled(bool enabled, 00080 int measure_interval_ms = 10000); 00081 00082 //! (Re)implemented. 00083 void videoResolutionChanged(int width, int height); 00084 //! (Re)implemented. 00085 void errorEncountered(void); 00086 //! (Re)implemented. 00087 void frameComplete(void); 00088 //! (Re)implemented. 00089 void videoTileReceived(void); 00090 }; 00091 00092 00093 00094 00095 #endif // __MXCPC_BUFFEREDMXPEGVIDEORENDERER_H__