00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00044
00045
00046
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
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
00078
00079
00080 void framerateMeasured(float fps);
00081
00082 public slots:
00083
00084 void playCameraLiveFastStream(
00085 const mxcpcIPAddress& camera_ip,
00086 int camera_port,
00087 const mxcpcProxyConfiguration& camera_proxy_configuration,
00088 float fps);
00089
00090
00091 void stop(void);
00092
00093 public:
00094
00095
00096 void addMenuItem(const QString& item_text,
00097 const QObject *receiver, const char *slot);
00098
00099 void addMenuSeparator(void);
00100
00101 void setFramerateMeasureModeEnabled(bool enabled,
00102 int measure_interval_ms = 10000);
00103
00104 protected:
00105
00106 void paintGL(void);
00107
00108 void resizeGL(int width, int height);
00109
00110
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