00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef MN_LCRTPCachingReflectorGM_H
00027
#define MN_LCRTPCachingReflectorGM_H
00028
00029
#include <sys/types.h>
00030
#include "var_type.h"
00031
00032
#include "MNSem.h"
00033
#include "MNMutex.h"
00034
00035
#include "MNRTPutildefs.h"
00036
00037
#include "ServerGM.h"
00038
00039
#include "MNFileSinkSH.h"
00040
#include "MNPacketMultiplierSH.h"
00041
00042
#include "SDPMediaDescription.h"
00043
00044
namespace SH
00045 {
00046
class PushPullSH;
00047
class RTPDecoderSH;
00048
class RTPEncoderSH;
00049
class RTPSourceSH;
00050
class RTPSinkSH;
00051
class DummyLayerSinkSH;
00052 };
00053
00057 struct Subsession
00058 {
00059 SH::RTPSourceSH*
_RTPSourceSH;
00060 SH::PacketMultiplierSH*
_MultiplierSH;
00061 SH::RTPDecoderSH*
_DecoderSH;
00062 SH::FileSinkSH*
_FileSinkSH;
00063 SH::PacketMultiplierSH*
_filterMultiSH;
00064 SH::RTPDecoderSH*
_filterDecSH;
00065 SH::PushPullSH*
_filterBufferSH;
00066 SH::RTPEncoderSH*
_filterEncSH;
00067 SH::DummyLayerSinkSH*
_filterDropSH;
00068 SH::RTPSinkSH*
_RTPSinkSH;
00069
00070 MNSem _eof_sig;
00071 MNMutex _eof_lock;
00072
00073
00074 MNSocket*
_local_down_rtp;
00075 MNSocket*
_local_down_rtcp;
00076 MNSocket*
_local_up_rtp;
00077 MNSocket*
_local_up_rtcp;
00078 int _DistantPortDown;
00079 int _DistantPortUp;
00080 bool _use_file;
00081 char*
_filename;
00082 MDescPtr _mdesc;
00083 };
00084
00085
00086
00091 class LCRTPCachingReflectorGM :
public ServerGM
00092 {
00096
MNList<struct Subsession*>* _subsessions;
00097
00098
MediaState _streamer_state;
00099
00100
MNString _client;
00101
MNString _server;
00102
00103
bool _initialized;
00104
char* _logfile;
00105
00106 RTSP::TransportTypes _requested_transport;
00107
00108
00109
public:
00110
LCRTPCachingReflectorGM(
GMUser* user,
MNSelector& sel, RTSP::TransportTypes requested_transport = RTSP::RTP_AVP_UDP );
00111
virtual ~LCRTPCachingReflectorGM();
00112
00116
void addSubsession();
00117
00118
virtual void init();
00121
virtual void init(
int idx);
00122
virtual void uninit();
00123
virtual void set_hostnames(
const MNString& Client,
const MNString& Server );
00126
virtual void set_ports(
int idx,
00127
MNSocket* locDownRtp,
00128
MNSocket* locDownRtcp,
00129
int distDown,
00130
MNSocket* locUpRtp,
00131
MNSocket* locUpRtcp,
00132
int distUp );
00135
void set_mdesc(
int idx,
MDescPtr mdesc);
00136
virtual void start();
00140
virtual bool graphManNotify(
int idx,
SH::Base* caller, SH::Notification attribute,
void* msg );
00141
virtual bool synchronousGet(
int idx, GetValue what,
u_int32& outVar );
00142
private:
00143
virtual int start_streamer(
int idx,
int bandwidth );
00144
00145
public:
00148
virtual int open_file(
int idx,
00149
const char* name,
00150
int rtp_pt,
00151 SDP::PayloadTypes int_pt,
00152
u_int32 bw,
00153 SDP::RetransTypes int_rt,
00154
int packetsize );
00158
virtual int play(
int startp,
int stopp );
00159
virtual int stop( );
00160
virtual int pause( );
00161
virtual int jump (
long pos );
00162
void set_write_to_file(
int idx,
bool yes );
00163 };
00164
00166
00167
#endif
00168