Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

RtspPlayer.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2000 KOM/Darmstadt University of Technology 00003 * 00004 * This program is free software; you can redistribute it and/or modify it 00005 * under the terms of the GNU General Public License as published by the 00006 * Free Software Foundation; either version 2, or (at your option) any 00007 * 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 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, 00017 * USA. 00018 */ 00019 #ifndef RTSP_PLAYER_H 00020 #define RTSP_PLAYER_H 00021 00022 #include "MNRTSPClient.h" 00023 #include "MNSelector.h" 00024 #include "MNMutex.h" 00025 #include "MNSem.h" 00026 #include "MNThread.h" 00027 00028 class Url; 00029 class MNPipeNotifier; 00030 class PlayerGM; 00031 00032 /*********************************************************************** 00033 * RtspPlayer. 00034 * This class can be understood as the interface to mplayer. It refers 00035 * to RTSP functionality of MNRTSPClient on one hand and to the GraphManager 00036 * (to control RTP handling) on the other hand. 00037 ***********************************************************************/ 00038 00039 class RtspPlayer : public MNRTSPClient 00040 , public MNThread 00041 { 00042 Url* _url; 00043 PlayerGM* _gm; 00044 00045 bool _initialized; 00046 bool _open; 00047 bool _playing; 00048 00049 MNMutex _mutex; 00050 MNSem _cond; 00051 bool _pending; 00052 char* _error_msg; 00053 bool _closed; 00054 int _ownSessionsSetup; 00055 public: 00056 RtspPlayer( MNSelector& sel ); 00057 virtual ~RtspPlayer( ); 00058 00059 virtual void run( ); 00060 00061 void call( ); 00062 bool send_describe( const char* url ); 00063 bool send_setup( ); 00064 bool send_play( int from, int to ); 00065 bool send_pause(); 00066 bool send_resume(int pos); 00067 void call_stop( int pos ); 00068 bool call_close( ); 00069 void call_uninit( ); 00070 00071 bool wait_describe_response( ); 00072 bool wait_setup_response( ); 00073 bool wait_play_response( ); 00074 bool wait_pause_response( ); 00075 bool wait_resume_response( ); 00076 bool wait_stop_response( ); 00077 00078 const char* getLastError() const; 00079 00084 bool call_set_notify( bool trigger ); 00085 00086 bool is_multiplexed_stream( ); 00087 SDP::PayloadTypes get_internal_pt( ); 00092 SDP::PayloadTypes get_internal_pt( int idx ); 00097 int get_rtp_pt(int idx); 00098 00105 const char* getConfig(int idx, int pt); 00106 00109 unsigned int getConfigSize(int idx, int pt); 00110 00113 unsigned getRate(int idx, int pt); 00114 00117 unsigned getNumChannels(int idx, int pt); 00118 00119 int checkBuffer( ); 00120 int fillBuffer( unsigned char* buffer, int length ); 00121 int checkBuffer( int idx); 00122 int fillBuffer( int idx, unsigned char* buffer, int length ); 00123 00126 bool hasBeenSynchronized(int idx); 00129 void getPT(int idx, struct timeval& resPT); 00130 00133 int getSessionsSetup(); 00134 00137 SDP::MNMediaType getMediaType(int idx); 00138 00139 private: 00140 bool private_open( ); 00141 00142 void finalAnswer( const char* file, int line, const char* text ); 00143 00144 protected: 00146 virtual void init_stage_2( ); 00147 00149 virtual void open_stage_2( ); 00150 00152 virtual void play_stage_2( ); 00153 00155 virtual void pause_stage_2( ); 00156 00158 virtual void stop_stage_2( ); 00159 00161 virtual void init_stage_2_failed( const char* file, 00162 int line, 00163 const char* text ); 00164 00166 virtual void open_stage_2_failed( const char* file, 00167 int line, 00168 const char* text ); 00169 00171 virtual void play_stage_2_failed( const char* file, 00172 int line, 00173 const char* text ); 00174 00176 virtual void pause_stage_2_failed( const char* file, 00177 int line, 00178 const char* text); 00179 00181 virtual void stop_stage_2_failed( const char* file, 00182 int line, 00183 const char* text ); 00184 00186 virtual void unknown_stage_2( const char* file, 00187 int line, 00188 const char* text ); 00189 }; 00190 00191 #endif /* RTSP_PLAYER_H */ 00192

Generated on Sun Mar 6 13:35:50 2005 for Komssys by doxygen 1.3.8