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

dataPump Class Reference

#include <dataPump.h>

Inheritance diagram for dataPump:

Inheritance graph
[legend]
Collaboration diagram for dataPump:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Server_Type { MN_SERVER, VC_SERVER }

Public Member Functions

 dataPump (MNSelector &sel, DataPumpResponse *resp, SDPSessionDescription *sdesc)
virtual ~dataPump ()
DataPumpResponseresponder ()
MNSelectormainSelector ()
virtual int init (KomServer *, StreamingType type)=0
void setUrl (MNString &url)
virtual void setNptSeek (int npt)
virtual int getNptSeconds ()
virtual void setRTPTimestamp (int idx, u_int32 rtptime)
virtual bool createUpstreamSocks (int idx, int &requested, RTPSockets::FactoryMode mode, RTSP::TransportTypes requested_transport=RTSP::RTP_AVP_UDP)=0
virtual bool createDownstreamSocks (int idx, int &requested, RTPSockets::FactoryMode mode, RTSP::TransportTypes requested_transport=RTSP::RTP_AVP_UDP)=0
virtual int stream_start (int idx, const MNString &filename, const MNString &DescFileName, const MNString &client, const MNString &server, int ClientPortAnnounced, int ServerPortAnnounced)=0
virtual void setupNewServerSideReflectorGM (int idx)
virtual void setupExistingServerSideReflectorGM (int idx)
virtual int play (int start, int stop)=0
virtual int stop ()=0
virtual int pause ()
virtual int jump (int startpos)
virtual void fileComplete (const char *filename, bool comp)
virtual long getFilePos ()
Server_Type getServerType ()
void setServerType (Server_Type stype)
bool upStreamReady (int idx) const
bool downStreamReady (int idx) const
virtual MNSocketgetLocalDownRtp (int idx) const
virtual MNSocketgetLocalDownRtcp (int idx) const
virtual MNSocketgetLocalUpRtp (int idx) const
virtual MNSocketgetLocalUpRtcp (int idx) const
virtual bool fillTransportString (int idx, MNString &out, bool mc) const =0
virtual void setLocalDownSocks (int idx, MNSocket *rtp, MNSocket *rtcp)
virtual void setLocalUpSocks (int idx, MNSocket *rtp, MNSocket *rtcp)
virtual int getDistantPortDownstream (int idx) const
virtual void setDistantPortDownstream (int idx, int)
virtual int getDistantPortUpstream (int idx) const
virtual void setDistantPortUpstream (int idx, int)
virtual int getLocalPortDownstream (int idx) const
virtual int getLocalPortUpstream (int idx) const
virtual StreamingType getStreamingType () const
virtual void set_client_port (int, int)
virtual long getCorrespondingSsrc (int payloadtype)
virtual void addFmtSsrcMapping (SDPSessionDescription *sdesc)
virtual void switchFormat ()
void setSessionDescription (SDPSessionDescription *desc)
SDPSessionDescriptiongetSessionDescription ()
virtual const SDP::PayloadTypeTablegetPayloadTypes ()
 Implementation of the only GMuser interface function.
virtual SDP::PayloadTypes getInternalPayloadType ()
virtual int getRTPPayloadType ()
virtual const SDP::PayloadTypeTablegetPayloadTypes (int idx)
virtual SDP::PayloadTypes getInternalPayloadType (int idx)
virtual int getRTPPayloadType (int idx)
virtual int getPlayTimeSeconds ()
virtual bool isPatchingCapable () const
virtual void setMulticastInformation (MNString, MNSocket *, MNSocket *)
virtual void setBufferInformation (int, int)
void setProxyFormatswitching (bool yesno)
bool getProxyFormatswitching () const
void setTCPfriendly (bool yesno)
void setClientHostname (MNString client)
bool getTCPfriendly () const
void setClientBandwidth (int client_bw)
int getClientBandwidth () const
void setClientBandwidth (int idx, int client_bw)
int getClientBandwidth (int idx) const

Static Public Member Functions

int getLegalEvenPortnum ()

Public Attributes

Server_Type _stype
DataPumpResponse_resp

Protected Attributes

StreamingType _StreamingType
PortVector _DistantPortDownstream
PortVector _DistantPortUpstream
bool _tfrc
int _client_bw
 Holds the ClientBandwidth.
PortVector _client_bw_vec
MNString _clientname
 Holds clienthostname to connect to in case of RTP/TCP.
MNString _url

Member Enumeration Documentation

enum dataPump::Server_Type
 

Enumeration values:
MN_SERVER 
VC_SERVER 


Constructor & Destructor Documentation

dataPump::dataPump MNSelector sel,
DataPumpResponse resp,
SDPSessionDescription sdesc
 

virtual dataPump::~dataPump  )  [virtual]
 


Member Function Documentation

virtual void dataPump::addFmtSsrcMapping SDPSessionDescription sdesc  )  [virtual]
 

This function is called for an original sender data pump, ie. a server or a proxy in streaming mode. It checks the payload types for all streams in a container, and adds the mapping payload type to ssrc to the session description. Problems:

  • This function is a dummy right now, because we don't have containers at the moment.
  • Payload type is not necessarily the right term for the left value of the mapping. Assume independent audio channels with identical encoding. This seems to be only a naming problem.
  • It should not be necessary to pass the session description as a parameter to this function because it has been made known to this object via setSessionDescription. However, I don't know whether this function is reliable, or whether it should be used at all.
  • In the final incarnation, this function is of course data pump dependent and must be implemented separately in each one.
    Author:
    griff 16sep2001

virtual bool dataPump::createDownstreamSocks int  idx,
int &  requested,
RTPSockets::FactoryMode  mode,
RTSP::TransportTypes  requested_transport = RTSP::RTP_AVP_UDP
[pure virtual]
 

The data pump tries to create the requested socket as an RTP socket, with the matching RTCP socket as well. The mode determines whether the actual port may differ, and whether the RTCP socket must exist or not. On return, the actually allocated port is returned in the parameter requested.

Parameters:
idx Index into the socket vector.
requested On input, the requested port. On output and in case of success, the actually opened port.
mode DEFAULT indicates that any pair of ports can be opened, FIXED indicates that only the requested port is OK, RTCP_FAIL_OK indicates that only the RTP port is really required.
requested_transport Informs if the ports are UDP or TCP.
Returns:
true on success, false on error.

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

virtual bool dataPump::createUpstreamSocks int  idx,
int &  requested,
RTPSockets::FactoryMode  mode,
RTSP::TransportTypes  requested_transport = RTSP::RTP_AVP_UDP
[pure virtual]
 

The data pump tries to create the requested socket as an RTP socket, with the matching RTCP socket as well. The mode determines whether the actual port may differ, and whether the RTCP socket must exist or not. On return, the actually allocated port is returned in the parameter requested.

Parameters:
idx Index into the socket vector.
requested On input, the requested port. On output and in case of success, the actually opened port.
mode DEFAULT indicates that any pair of ports can be opened, FIXED indicates that only the requested port is OK, RTCP_FAIL_OK indicates that only the RTP port is really required.
requested_transport Translated to an enum for the RTSP transport specification. Usually 1 for RTP/AVP/UDP.
Returns:
true on success, false on error.

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

bool dataPump::downStreamReady int  idx  )  const [inline]
 

virtual void dataPump::fileComplete const char *  filename,
bool  comp
[virtual]
 

Reimplemented from GMUser.

Reimplemented in MNStreamer, and NopStreamer.

virtual bool dataPump::fillTransportString int  idx,
MNString out,
bool  mc
const [pure virtual]
 

When the proxy must formulate a SETUP response for the client, the Transport line must be created. Since the transport protocol is only known to the specific data pump, the data pump is the entity that should write this string.

Parameters:
out Out parameter containing the transport string that is fill by the specific data pump.
mc In parameter telling the data pump that it should assume multicast or unicast, respectively. The necessity of this parameter is a design flaw, because this information is exchange with the data pump far too late.
Returns:
True, if the transport string was successfully filled in, false otherwise.

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

int dataPump::getClientBandwidth int  idx  )  const
 

int dataPump::getClientBandwidth  )  const
 

virtual long dataPump::getCorrespondingSsrc int  payloadtype  )  [virtual]
 

This code is unfinished. It will become necessary when we reintroduce containers.

virtual int dataPump::getDistantPortDownstream int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual int dataPump::getDistantPortUpstream int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual long dataPump::getFilePos  )  [virtual]
 

If the dataPump is streaming, this method returns the current time position in the source file. Else it returns -1!!

Reimplemented in MNStreamer, and NopStreamer.

virtual SDP::PayloadTypes dataPump::getInternalPayloadType int  idx  )  [virtual]
 

Implements GMUser.

virtual SDP::PayloadTypes dataPump::getInternalPayloadType  )  [virtual]
 

int dataPump::getLegalEvenPortnum  )  [static]
 

This function returns a random integer that can legally be used as a UDP/TCP port. This integer will be even, but the port may already be allocated.

virtual MNSocket* dataPump::getLocalDownRtcp int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual MNSocket* dataPump::getLocalDownRtp int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual int dataPump::getLocalPortDownstream int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual int dataPump::getLocalPortUpstream int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual MNSocket* dataPump::getLocalUpRtcp int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual MNSocket* dataPump::getLocalUpRtp int  idx  )  const [virtual]
 

Reimplemented in NopStreamer.

virtual int dataPump::getNptSeconds  )  [virtual]
 

Reimplemented in MNStreamer.

virtual const SDP::PayloadTypeTable* dataPump::getPayloadTypes int  idx  )  [virtual]
 

Implements GMUser.

virtual const SDP::PayloadTypeTable* dataPump::getPayloadTypes  )  [virtual]
 

Implementation of the only GMuser interface function.

virtual int dataPump::getPlayTimeSeconds  )  [virtual]
 

Reimplemented from GMUser.

bool dataPump::getProxyFormatswitching  )  const
 

virtual int dataPump::getRTPPayloadType int  idx  )  [virtual]
 

Implements GMUser.

virtual int dataPump::getRTPPayloadType  )  [virtual]
 

Server_Type dataPump::getServerType  ) 
 

SDPSessionDescription* dataPump::getSessionDescription  ) 
 

virtual StreamingType dataPump::getStreamingType  )  const [inline, virtual]
 

bool dataPump::getTCPfriendly  )  const
 

virtual int dataPump::init KomServer *  ,
StreamingType  type
[pure virtual]
 

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

virtual bool dataPump::isPatchingCapable  )  const [inline, virtual]
 

If a data pump is capable of patching support, it must overload the functions setMulticastInformation and setBufferInformation that exist only as dummy implementations in this base class. The default is that a data pump is not capable of patching.

Reimplemented in MNStreamer, and NopStreamer.

virtual int dataPump::jump int  startpos  )  [virtual]
 

Reimplemented in MNStreamer, and NopStreamer.

MNSelector& dataPump::mainSelector  ) 
 

virtual int dataPump::pause  )  [virtual]
 

Reimplemented in MNDummyStreamer, MNStreamer, and NopStreamer.

virtual int dataPump::play int  start,
int  stop
[pure virtual]
 

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

DataPumpResponse* dataPump::responder  ) 
 

virtual void dataPump::set_client_port int  ,
int 
[inline, virtual]
 

Reimplemented in MNStreamer.

virtual void dataPump::setBufferInformation int  ,
int 
[inline, virtual]
 

A dummy provided for non-patching-capable data pumps and overloaded by patching-capable data pumps.

Reimplemented in MNStreamer, and NopStreamer.

void dataPump::setClientBandwidth int  idx,
int  client_bw
 

void dataPump::setClientBandwidth int  client_bw  ) 
 

void dataPump::setClientHostname MNString  client  ) 
 

virtual void dataPump::setDistantPortDownstream int  idx,
int 
[virtual]
 

virtual void dataPump::setDistantPortUpstream int  idx,
int 
[virtual]
 

virtual void dataPump::setLocalDownSocks int  idx,
MNSocket rtp,
MNSocket rtcp
[virtual]
 

virtual void dataPump::setLocalUpSocks int  idx,
MNSocket rtp,
MNSocket rtcp
[virtual]
 

virtual void dataPump::setMulticastInformation MNString  ,
MNSocket ,
MNSocket
[inline, virtual]
 

A dummy provided for non-patching-capable data pumps and overloaded by patching-capable data pumps.

Reimplemented in NopStreamer.

virtual void dataPump::setNptSeek int  npt  )  [virtual]
 

Reimplemented in MNStreamer.

void dataPump::setProxyFormatswitching bool  yesno  ) 
 

virtual void dataPump::setRTPTimestamp int  idx,
u_int32  rtptime
[virtual]
 

Reimplemented in MNStreamer.

void dataPump::setServerType Server_Type  stype  ) 
 

void dataPump::setSessionDescription SDPSessionDescription desc  ) 
 

void dataPump::setTCPfriendly bool  yesno  ) 
 

virtual void dataPump::setupExistingServerSideReflectorGM int  idx  )  [virtual]
 

Reimplemented in MNStreamer.

virtual void dataPump::setupNewServerSideReflectorGM int  idx  )  [virtual]
 

Reimplemented in MNStreamer.

void dataPump::setUrl MNString url  ) 
 

virtual int dataPump::stop  )  [pure virtual]
 

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

virtual int dataPump::stream_start int  idx,
const MNString filename,
const MNString DescFileName,
const MNString client,
const MNString server,
int  ClientPortAnnounced,
int  ServerPortAnnounced
[pure virtual]
 

Implemented in MNDummyStreamer, MNStreamer, and NopStreamer.

virtual void dataPump::switchFormat  )  [inline, virtual]
 

bool dataPump::upStreamReady int  idx  )  const [inline]
 


Member Data Documentation

int dataPump::_client_bw [protected]
 

Holds the ClientBandwidth.

PortVector dataPump::_client_bw_vec [protected]
 

MNString dataPump::_clientname [protected]
 

Holds clienthostname to connect to in case of RTP/TCP.

PortVector dataPump::_DistantPortDownstream [protected]
 

General: see _LocalPortDownstream. Specific: CacheReflectors have all of these <> -1

PortVector dataPump::_DistantPortUpstream [protected]
 

General: see _LocalPortDownstream.

DataPumpResponse* dataPump::_resp
 

StreamingType dataPump::_StreamingType [protected]
 

Server_Type dataPump::_stype
 

bool dataPump::_tfrc [protected]
 

MNString dataPump::_url [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:35:51 2005 for Komssys by doxygen 1.3.8