OStreamUCast.hh

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) Massimo Cora' 2006 <maxcvs@email.it>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef _OSTREAMUCAST_H_
00020 #define _OSTREAMUCAST_H_
00021 
00022 #include <liveMedia.hh>
00023 #include <BasicUsageEnvironment.hh>
00024 #include <GroupsockHelper.hh>
00025 
00026 
00027 
00028 #include "OStreamOnDemandSMS.hh"
00029 #include "MJPEGVideoSource.hh"
00030 #include "HardwareSingleVideoSource.hh"
00031 #include "FileSingleVideoSource.hh"
00032 #include "BufferedImageMultiVideoSource.hh"
00033 #include <list>
00034 
00036 using namespace std;
00037 
00038 
00039 typedef void (on_parsable_image_cb)( IplImage* image,                           
00040                                                                          void* this_klass_callback_data,
00041                                                                          void* callback_data
00042                                                                         );
00043 
00050 class OStreamUCast
00051 {
00052 
00053 public: 
00060         OStreamUCast( on_parsable_image_cb *f, void *parsable_image_callback_data, int num_of_streams = 1 );
00061         virtual ~OStreamUCast();
00062 
00075         bool startStreaming( int encoding_type,
00076                                                  char* file_path = NULL,        // if this is != NULL camera_num won't be used [i.e. for hardware].
00077                                                  int camera_num = 0,            // used only if file_path = NULL
00078                                                  int audio_num = -1,            // used only if audio_num is != -1
00079                                                  const char* subsessionUrl = "testStream", 
00080                                                  unsigned short port_rtsp = 8554,
00081                                                  unsigned int fps = 25 );
00086         bool stopStreaming();
00087 
00092         char* getUrlToPlay();
00093 
00094 private:        // functions
00099         void createRTSPInstance( Port &port_to_listen );
00100         void createServerMediaSession( int encoding_type, char* sub_url, 
00101                                                                    char* file_path, int camera_num, int audio_num );
00102         
00104         on_parsable_image_cb* f_parsable_image_cb;
00105                 
00106 private:    // data
00108         char _watchVariable;
00109         
00111         unsigned int _fps;
00112 
00114         unsigned int _num_of_streams;
00115         
00117         bool _multi_stream_mode;
00118         
00120         void *_parsable_image_callback_data;
00121         
00123         list<OStreamOnDemandSMS *> *_dms_list;
00124         
00126         RTSPServer* _rtspServer;        
00127         ServerMediaSession* _sms;
00128         TaskScheduler* _scheduler;
00129         UsageEnvironment* _env;
00130 };
00131 
00132 
00133 #endif  //_OSTREAMUCAST_H_
00134 

Generated on Tue Dec 26 10:32:39 2006 for Omnimeeting by  doxygen 1.4.7