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

mxplayer.cpp

Go to the documentation of this file.
00001 //           ///          //                                        Mx clientSDK
00002 //          /////        ////                    Mx Crossplatform Client Library
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxplayer.cpp,v $
00005 //       ///       XXX       ///     $Revision: 1.4 $
00006 //      ///      XXX XXX      ///     $Date: 2006/01/20 11:57:00 $
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 /*! \file mxplayer.cpp
00021     \brief <tt>MxPEG Player</tt>, the new <tt>MxPEG</tt> livestream viewer for 
00022     LINUX, MAC OS X and Windows.
00023 */
00024 
00025 
00026 
00027 #include <mxcpcSimpleMxPEGViewer.h>
00028 #include <mxcpcFastStreamSelectionDialog.h>
00029 #include <mxcpcSDKInfoDialog.h> 
00030 #include <mxcpcBestPerformanceMxPEGCodecFactory.h>
00031 #include <mxcpcIPAddress.h>
00032 #include <mxcpcProxyConfiguration.h>
00033 
00034 #include <QApplication>
00035 
00036 #include <cstdlib>
00037 #include <cstdio>
00038 
00039 
00040 
00041 #define MXPLAYER_APPNAME "MxPEG Player"
00042 
00043 
00044 
00045 int main(int argc, char **argv) {
00046 
00047   QApplication qapp(argc, argv);
00048   
00049   mxcpcSimpleMxPEGViewer *viewer;
00050   mxcpcFastStreamSelectionDialog *faststream_selection_dialog;
00051   mxcpcSDKInfoDialog *sdk_info_dialog;
00052   mxcpcMxPEGCodecFactory *codec_factory;
00053   int ip1, ip2, ip3, ip4;
00054   
00055   codec_factory = new mxcpcBestPerformanceMxPEGCodecFactory();
00056   
00057   viewer = new mxcpcSimpleMxPEGViewer(0, 
00058                                       codec_factory,
00059                                       QString(MXPLAYER_APPNAME));
00060   viewer->show();
00061   
00062   faststream_selection_dialog = new mxcpcFastStreamSelectionDialog(0);
00063   faststream_selection_dialog->setWindowTitle(QString("Connect to Camera..."));
00064   
00065   sdk_info_dialog = new mxcpcSDKInfoDialog(0);
00066   sdk_info_dialog->show();
00067   sdk_info_dialog->hideLater();
00068   
00069   viewer->addMenuItem(QString("Connect to Camera..."), 
00070                       faststream_selection_dialog, SLOT(openDialog(void)));
00071   viewer->addMenuSeparator();
00072   viewer->addMenuItem(QString("About..."), 
00073                       sdk_info_dialog, SLOT(openDialog(void)));
00074   viewer->addMenuSeparator();
00075   viewer->addMenuItem(QString("Quit"), &qapp, SLOT(quit(void)));
00076   //viewer->setFramerateMeasureModeEnabled(true);
00077   
00078   QObject
00079    ::connect(faststream_selection_dialog, 
00080              SIGNAL(fastStreamSelected(const mxcpcIPAddress&, 
00081                                        int,
00082                                        const mxcpcProxyConfiguration&,
00083                                        float)),
00084              viewer,                    
00085              SLOT(playCameraLiveFastStream(const mxcpcIPAddress&,
00086                                            int,
00087                                            const mxcpcProxyConfiguration&,
00088                                            float)));
00089   
00090   // command arg?
00091   if(argc == 2) {
00092     ip1 = ip2 = ip3 = ip4 = 0;
00093     std::sscanf(argv[1], "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
00094     viewer->playCameraLiveFastStream(mxcpcIPAddress(ip1, ip2, ip3, ip4),
00095                                      80,
00096                                      mxcpcProxyConfiguration(),   // no proxy
00097                                      8);
00098   }
00099   
00100   // have fun...
00101   qapp.exec();
00102 
00103   // shut down...
00104   delete viewer;
00105   delete faststream_selection_dialog;
00106   delete sdk_info_dialog;
00107   exit(0);
00108 }

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