00001
#ifndef CLIENTSIDEREFLECTORGM_H
00002
#define CLIENTSIDEREFLECTORGM_H
00003
00004
#include "ServerGM.h"
00005
#include "MNRTPSinkSH.h"
00006
#include "MNString.h"
00007
#include "MNRTPutildefs.h"
00008
#include "ServerSideReflectorGM.h"
00009
#include <vector>
00010
00016 class ClientSideReflectorGM :
public ServerGM
00017 {
00018
private:
00019
ServerSideReflectorGM* _serverSideReflectorGM;
00020
struct Subsession
00021 {
00022
00023
SH::RTPSinkSH* _rtpSinkSH;
00024
00025
MNSocket* _localDownRTP;
00026
MNSocket* _localDownRTCP;
00027
MNSocket* _localUpRTP;
00028
MNSocket* _localUpRTCP;
00029
int _distantPortDown;
00030
int _distantPortUp;
00031 };
00032 std::vector<Subsession*> _subsessions;
00033
00034
MediaState _state;
00035
MNString _server;
00036
MNString _client;
00037
MNString _url;
00038
00039
00040
00041
00042
public:
00043
ClientSideReflectorGM(
GMUser* user,
00044
MNSelector& sel,
00045
MNString& url,
00046 RTSP::TransportTypes requested_transport = RTSP::RTP_AVP_UDP );
00047
00048
virtual ~ClientSideReflectorGM();
00049
virtual void init(
int idx);
00050
void addSubsession();
00051
void attachToServerSideReflectorGM(
int idx);
00052
virtual void set_hostnames(
const MNString& client,
const MNString& server);
00053
virtual void set_ports(
int idx,
00054
MNSocket* locDownRtp,
00055
MNSocket* locDownRtcp,
00056
int distDown,
00057
MNSocket* locUpRtp,
00058
MNSocket* locUpRtcp,
00059
int distUp );
00060
virtual int open_file(
int idx,
00061
const char* name,
00062
int rtp_pt,
00063 SDP::PayloadTypes int_pt,
00064
u_int32_t bw,
00065 SDP::RetransTypes int_rt,
00066
int packetsize );
00067
00071
void setupForNewSession(
int idx,
u_int32_t bw);
00072
00076
void setupForExistingSession(
int idx);
00077
virtual bool graphManNotify(
int idx,
SH::Base* caller, SH::Notification attribute,
void* msg );
00078
00079
00080
virtual void uninit();
00081
virtual void start();
00082
virtual int play(
int startp,
int stopp );
00083
virtual int stop( );
00087
void detach();
00088
virtual int pause( );
00089
virtual int jump (
long pos );
00090
00092
virtual void setNptSeek(
int npt);
00093
virtual int getNptSeconds();
00094
00098
virtual void setRTPTimestamp(
int idx,
u_int32 rtptime);
00099
00100
private:
00101
static void deleteSubsession(Subsession* subsession);
00102
static void uninitSubsession(Subsession* subsession);
00103
static void startSubsession(Subsession* subsession);
00104
static void stopSubsession(Subsession* subsession);
00105
virtual int start_streamer(
int idx,
int bandwidth );
00106
void unmatchAllSubsessions();
00107
00108
ClientSideReflectorGM(
const ClientSideReflectorGM& gm);
00109
ClientSideReflectorGM& operator=(
const ClientSideReflectorGM& gm);
00110 };
00111
00112
#endif