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

PlayerGM Class Reference

#include <PlayerGM.h>

Inheritance diagram for PlayerGM:

Inheritance graph
[legend]
Collaboration diagram for PlayerGM:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SourceMode { Uninitialized, RtpAny, RtpUnicastUDP, RtpMulticast }

Public Member Functions

 PlayerGM (GMUser *user, MNSelector &sel)
virtual ~PlayerGM ()
void clear ()
void addSubsession (Subsession *s)
void addSubsession ()
virtual bool graphManNotify (int idx, SH::Base *caller, SH::Notification attribute, void *msg)
void setMediaDesc (MDescPtr mdesc)
void setMediaDesc (int idx, MDescPtr mdesc)
void setRtpBandwidth (size_t bandwidth)
void setRtpBandwidth (int idx, size_t bandwidth)
void setRequestedPort (int port)
void setRequestedPort (int idx, int port)
bool open (SourceMode sourceMode)
bool openall (SourceMode sourceMode)
int getOpenRtpPort () const
int getOpenRtpPort (int startPort) const
int getOpenRtpPort (Subsession *s) const
void setRtpSenderPort (int port)
void setRtpSenderPort (int idx, int port)
void setRtpSenderHostname (const MNString &name)
void setRtpSenderHostname (int idx, const MNString &name)
void getPT (int idx, struct timeval &presentationTime)
void resetSyncTime ()
bool hasBeenSynchronized (int idx)
bool start ()
bool startall ()
void stop ()
void stopall ()
int checkBuffer ()
int checkBuffer (int idx)
int fillBuffer (unsigned char *buffer, int length)
int fillBuffer (int idx, unsigned char *buffer, int length)

Member Enumeration Documentation

enum PlayerGM::SourceMode
 

Enumeration values:
Uninitialized 
RtpAny 
RtpUnicastUDP 
RtpMulticast 


Constructor & Destructor Documentation

PlayerGM::PlayerGM GMUser user,
MNSelector sel
 

Constructor.

virtual PlayerGM::~PlayerGM  )  [virtual]
 

Destructor


Member Function Documentation

void PlayerGM::addSubsession  ) 
 

Adds an empty subsession to the PlayerGM state.

void PlayerGM::addSubsession Subsession s  ) 
 

Adds a given subsession to the PlayerGM state. check if this function is really needed.

int PlayerGM::checkBuffer int  idx  ) 
 

Function required by mplayer. It must be checked if data have arrived because the player should block otherwise.

int PlayerGM::checkBuffer  ) 
 

void PlayerGM::clear  ) 
 

Reset the PlayerGM from an arbitrary state.

int PlayerGM::fillBuffer int  idx,
unsigned char *  buffer,
int  length
 

Function to actually copy data for mplayer.

int PlayerGM::fillBuffer unsigned char *  buffer,
int  length
 

int PlayerGM::getOpenRtpPort Subsession s  )  const
 

int PlayerGM::getOpenRtpPort int  startPort  )  const
 

int PlayerGM::getOpenRtpPort  )  const
 

In case of a success, the RTP receive port is retrieved to report it to the server via RTSP.

Precondition:
caller is Automaton
state == Open
Postcondition:
state == Open
Note:
No verification has been made for the multicast case that allows sender and reveicer RTP ports to differ, since is is currently not supported at all.

void PlayerGM::getPT int  idx,
struct timeval &  presentationTime
 

Returns the timestamp corresponding to the data in the rope container. Note that you must provide a reasonable value on your own by calling check_buffer(idx) before.

virtual bool PlayerGM::graphManNotify int  idx,
SH::Base caller,
SH::Notification  attribute,
void *  msg
[virtual]
 

The upcall interface through which all reports from stream handler reach this object. The function does not act directly but calls ll_ functions to allow easier separation in later steps.

Parameters:
idx Index for a media subsession. Currently mostly called with 0 for the first subsession. Fix subsession handling here.
caller The reporting stream handler. Currently NULL.
attribute The attribute indicating the report. Currently hard-coded.
msg The report itself. Currently an appropriate typecast is deduced from the attribute.
Note:
At this time, the client is not implemented by stream handlers, but we are in an intermediate situation. Still, all streaming entities must report through this interface

Implements SHGraphManager.

bool PlayerGM::hasBeenSynchronized int  idx  ) 
 

Called to test if stream has been synchronized in the decoder using RTCP SR.

Returns:
true if stream has been synchronized using RTCP SR, false otherwise

bool PlayerGM::open SourceMode  sourceMode  ) 
 

A success to open the loopback gives us an open port on localhost that we can send data to later. Keep the port number and proceed to opening the RTP sockets. In case of multicast, this may fail immediately if the server's chosen port can not be bound by the client. (Obviously, this termination is not necessary, it would be sufficient to report the lack of RTCP and to receive the data on another port without reporting.) Otherwise, proceed to the Open state.

Parameters:
sourceMode RTP/UDP unicast or multicast
Precondition:
caller is Player
state == Opening
Postcondition:
state == Open || state == Clear
Note:
This is an intermediate approach that must be replaced by buffer passing later, at least for those players that support it. MpegTV supports only this approach. The disadvantage of the loopback socket are the two context switches and the lack of feedback for buffer under- and overruns.

bool PlayerGM::openall SourceMode  sourceMode  ) 
 

Opens the localhost port and sockets for all subsessions of a presentation. This does not work for multicast so far.

void PlayerGM::resetSyncTime  ) 
 

void PlayerGM::setMediaDesc int  idx,
MDescPtr  mdesc
 

void PlayerGM::setMediaDesc MDescPtr  mdesc  ) 
 

Set new media information. The media description field is one entry of the servers SDP message and refers to one RTP substream. At this time, it can not be overridden by information that is extracted from the data stream itself althrough that would be better.

Parameters:
idx Index of media subsession.
mdesc Pointer to parsed media description.
Precondition:
caller is Automaton
state == Clear
Postcondition:
state == Clear

void PlayerGM::setRequestedPort int  idx,
int  port
 

void PlayerGM::setRequestedPort int  port  ) 
 

Set the receive port to allocate in case of RTP multicast. multicast

Precondition:
caller is Automaton
state == Clear mode == RtpMulticast
Postcondition:
state == Clear

void PlayerGM::setRtpBandwidth int  idx,
size_t  bandwidth
 

void PlayerGM::setRtpBandwidth size_t  bandwidth  ) 
 

Set expected bandwidth information.

Parameters:
idx Index of media subsession.
Precondition:
caller is Automaton
state == Clear
Postcondition:
state == Clear

void PlayerGM::setRtpSenderHostname int  idx,
const MNString name
 

void PlayerGM::setRtpSenderHostname const MNString name  ) 
 

Reports the RTP sender's hostname.

void PlayerGM::setRtpSenderPort int  idx,
int  port
 

void PlayerGM::setRtpSenderPort int  port  ) 
 

Reports the RTP sender's chosen port from the RTSP setup message.

bool PlayerGM::start  ) 
 

Changes the player state to prepare it for data reception. This function can only be called for RTSP streams, not for playing from file (which is dumb).

Precondition:
caller is Automaton
state == Open
Postcondition:
state == Open
Returns:
True in case of success, false in case of failure.

bool PlayerGM::startall  ) 
 

Works like start(), but for all subsessions of a presentation.

void PlayerGM::stop  ) 
 

Undo all the work of a successful start.

void PlayerGM::stopall  ) 
 

Like stop(), but for all subsessions of a presentation. Stopping several subsessions must be fixed.


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