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

mxcpcSimpleMxPEGViewer.h

00001 //           ///          //                                        Mx clientSDK
00002 //          /////        ////                    Mx Crossplatform Client Library
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxcpcSimpleMxPEGViewer.h,v $
00005 //       ///       XXX       ///     $Revision: 1.7 $
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_SIMPLEMXPEGVIEWER_H__
00021 #define __MXCPC_SIMPLEMXPEGVIEWER_H__
00022 
00023 
00024 
00025 #include <mxcpcVideoDisplay.h>
00026 
00027 
00028 
00029 class mxcpcIPAddress;
00030 class mxcpcProxyConfiguration;
00031 class mxcpcMxPEGCodecFactory;
00032 class mxcpcFramewiseMxPEGDecoder;
00033 class mxcpcAsynchronousCameraLiveMxPEGFastStream;
00034 class mxcpcBufferedMxPEGVideoRenderer;
00035 class mxcpcAuthenticationDialog;
00036 class mxcpcMessageDialog;
00037 
00038 class QTimer;
00039 class QMenu;
00040 
00041 
00042 
00043 //! Simple, one-channel <tt>MxPEG</tt> viewer widget for early demo 
00044 //! configurations.
00045 /*!
00046  * \ingroup mxcpc_gui
00047  */
00048 class mxcpcSimpleMxPEGViewer : public mxcpcVideoDisplay {
00049    
00050   Q_OBJECT
00051   
00052  private:
00053   mxcpcMxPEGCodecFactory *CodecFactory;
00054   mxcpcFramewiseMxPEGDecoder *Decoder;
00055   mxcpcAsynchronousCameraLiveMxPEGFastStream *FastStream;
00056   mxcpcBufferedMxPEGVideoRenderer *Renderer;  
00057   QTimer *ConnectionWatchdogTimer;
00058   int LastDrawnFrame;
00059   int ConnectionTimeout;
00060   QMenu *Menu;
00061   mxcpcAuthenticationDialog *AuthenticationDialog;
00062   mxcpcMessageDialog *MessageDialog;
00063   QString WindowTitlePrefix;
00064   int FramerateMeasureInterval;
00065   
00066  public:
00067   //! Well, constructor.
00068   mxcpcSimpleMxPEGViewer(
00069    QWidget *parent,
00070    mxcpcMxPEGCodecFactory *codec_factory,
00071    const QString& window_title_prefix = QString("SimpleMxPEGViewer"),
00072    int connection_timeout = 2000
00073   );
00074   ~mxcpcSimpleMxPEGViewer();
00075   
00076  signals:
00077   //! Emitted if framerate measure mode is enabled and a new framerate measure
00078   //! becomes available (roughly every <i>n</i> milliseconds with <i>n</i> 
00079   //! as it was specified to setFramerateMeasureModeEnabled()).
00080   void framerateMeasured(float fps);
00081   
00082  public slots:
00083   //! Connects to the camera specified and begins displaying the live stream.
00084   void playCameraLiveFastStream(
00085          const mxcpcIPAddress& camera_ip,
00086          int camera_port,
00087          const mxcpcProxyConfiguration& camera_proxy_configuration, 
00088          float fps);
00089   //! Disconnects any potential stream source asnd switches to disconnected
00090   //! state.
00091   void stop(void);
00092 
00093  public:
00094   //! Adds an item to the viewer's context menu that is raised by right-clicking
00095   //! into the display.
00096   void addMenuItem(const QString& item_text,
00097                    const QObject *receiver, const char *slot);
00098   //! Adds a horizontal separator to the viewer's popup menu.
00099   void addMenuSeparator(void);
00100   //! Toggles framerate measure mode.
00101   void setFramerateMeasureModeEnabled(bool enabled, 
00102                                       int measure_interval_ms = 10000);       
00103   
00104  protected:
00105   //! Reimplemented.
00106   void paintGL(void);
00107   //! Reimplemented.
00108   void resizeGL(int width, int height);
00109 
00110   //! Reimplemented.
00111   void mousePressEvent(QMouseEvent *e);
00112   
00113  private slots:
00114   void processIncoming(void);
00115   void processWatchdog(void);
00116   void processMeasuredFramerate(float fps);
00117 };
00118 
00119 
00120 
00121 #endif   // __MXCPC_SIMPLEMXPEGVIEWER_H__
00122 

Generated on Mon Jan 30 15:52:44 2006 for mxcpc by  doxygen 1.4.4