RtspPlayer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00034
00035
00036
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
00192
Generated on Sun Mar 6 13:35:50 2005 for Komssys by
1.3.8