sipxmedialib  Version 3.3
Classes | Public Types | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MpStreamQueuePlayer Class Reference

#include <MpStreamQueuePlayer.h>

Inheritance diagram for MpStreamQueuePlayer:
Inheritance graph
[legend]
Collaboration diagram for MpStreamQueuePlayer:
Collaboration graph
[legend]

Classes

struct  PlayerListenerDb
 
struct  PlaylistQueue
 

Public Types

enum  SourceType { SourceUrl, SourceBuffer }
 

Public Member Functions

Creators
 MpStreamQueuePlayer (OsMsgQ *pMsgQ, const char *pTarget=NULL)
 
virtual ~MpStreamQueuePlayer ()
 
Manipulators
virtual OsStatus add (Url &url, int flags)
 
virtual OsStatus add (UtlString *pBuffer, int flags)
 
virtual OsStatus play ()
 param pBuffer - Net Buffer containing buffered audio data. The More...
 
virtual OsStatus reset ()
 
virtual OsStatus destroy ()
 
virtual OsStatus clear ()
 
virtual OsStatus wait (const OsTime &rTimeout=OsTime::OS_INFINITY)
 
OsStatus addListener (MpQueuePlayerListener *pListener)
 
OsStatus removeListener (MpQueuePlayerListener *pListener)
 
Inquiry
UtlBoolean isPlaying ()
 

Protected Member Functions

 MpStreamQueuePlayer (const MpStreamQueuePlayer &rMpStreamQueuePlayer)
 
MpStreamQueuePlayeroperator= (const MpStreamQueuePlayer &rhs)
 
virtual UtlBoolean handleMessage (OsMsg &rMsg)
 
void handleReset ()
 
void handlePlayNext ()
 
void handleDequeue ()
 
void handleRemoveFailed ()
 
UtlBoolean isPlayingStream (MpPlayer *pPlayer)
 
void setFailedPlayer (MpPlayer *pPlayer)
 
virtual void playerRealized (MpPlayerEvent &event)
 
virtual void playerPrefetched (MpPlayerEvent &event)
 
virtual void playerPlaying (MpPlayerEvent &event)
 
virtual void playerPaused (MpPlayerEvent &event)
 
virtual void playerStopped (MpPlayerEvent &event)
 
virtual void playerFailed (MpPlayerEvent &event)
 
void fireQueuePlayerStarted ()
 
void fireQueuePlayerStopped ()
 
void fireQueuePlayerAdvanced ()
 
- Protected Member Functions inherited from MpPlayerListener
virtual ~MpPlayerListener ()
 

Private Types

enum  { EVENT_DEQUEUE, EVENT_PLAY_NEXT, EVENT_REMOVE_FAILED, EVENT_PLAY_RESET }
 

Private Member Functions

int expandQueue (struct PlaylistQueue *&queue, int currentLength, int desiredLength)
 
void swapQueues (struct PlaylistQueue *&queue1, int &queueLength1, struct PlaylistQueue *&queue2, int &queueLength2)
 

Private Attributes

OsMsgQ * mpMsgQ
 
UtlString mTarget
 
OsBSem mSemQueueChange
 
OsBSem mSemWaitSynch
 
OsQueuedEvent * mpQueueEvent
 
struct PlaylistQueuemToPlayQueue
 
int mToPlayQueueLength
 
int mNumToPlayElements
 
struct PlaylistQueuemPlayingQueue
 
int mPlayingQueueLength
 
int mNumPlayingElements
 
UtlBoolean mbFatalError
 
PlayerListenerDb mListenerDb [MAX_PLAYER_LISTENERS]
 
OsRWMutex mListenerMutex
 

Member Enumeration Documentation

enum SourceType
Enumerator
SourceUrl 
SourceBuffer 
anonymous enum
private
Enumerator
EVENT_DEQUEUE 
EVENT_PLAY_NEXT 
EVENT_REMOVE_FAILED 
EVENT_PLAY_RESET 

Constructor & Destructor Documentation

MpStreamQueuePlayer ( OsMsgQ *  pMsgQ,
const char *  pTarget = NULL 
)
~MpStreamQueuePlayer ( )
virtual
MpStreamQueuePlayer ( const MpStreamQueuePlayer rMpStreamQueuePlayer)
protected

Member Function Documentation

OsStatus add ( Url &  url,
int  flags 
)
virtual
OsStatus add ( UtlString *  pBuffer,
int  flags 
)
virtual

param url - Url identifing the source data stream param flags - Playing flags (see StreamDefs.h)

OsStatus play ( )
virtual

param pBuffer - Net Buffer containing buffered audio data. The

param flags - Playing flags (see StreamDefs.h)

OsStatus reset ( )
virtual
OsStatus destroy ( )
virtual
OsStatus clear ( )
virtual
OsStatus wait ( const OsTime &  rTimeout = OsTime::OS_INFINITY)
virtual
OsStatus addListener ( MpQueuePlayerListener pListener)
OsStatus removeListener ( MpQueuePlayerListener pListener)
UtlBoolean isPlaying ( )
MpStreamQueuePlayer & operator= ( const MpStreamQueuePlayer rhs)
protected
UtlBoolean handleMessage ( OsMsg &  rMsg)
protectedvirtual
void handleReset ( )
protected
void handlePlayNext ( )
protected
void handleDequeue ( )
protected
void handleRemoveFailed ( )
protected
UtlBoolean isPlayingStream ( MpPlayer pPlayer)
protected
void setFailedPlayer ( MpPlayer pPlayer)
protected
void playerRealized ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void playerPrefetched ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void playerPlaying ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void playerPaused ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void playerStopped ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void playerFailed ( MpPlayerEvent event)
protectedvirtual

Implements MpPlayerListener.

void fireQueuePlayerStarted ( )
protected
void fireQueuePlayerStopped ( )
protected
void fireQueuePlayerAdvanced ( )
protected
int expandQueue ( struct PlaylistQueue *&  queue,
int  currentLength,
int  desiredLength 
)
private
void swapQueues ( struct PlaylistQueue *&  queue1,
int &  queueLength1,
struct PlaylistQueue *&  queue2,
int &  queueLength2 
)
private

Member Data Documentation

OsMsgQ* mpMsgQ
private
UtlString mTarget
private
OsBSem mSemQueueChange
private
OsBSem mSemWaitSynch
private
OsQueuedEvent* mpQueueEvent
private
struct PlaylistQueue* mToPlayQueue
private
int mToPlayQueueLength
private
int mNumToPlayElements
private
struct PlaylistQueue* mPlayingQueue
private
int mPlayingQueueLength
private
int mNumPlayingElements
private
UtlBoolean mbFatalError
private
PlayerListenerDb mListenerDb[MAX_PLAYER_LISTENERS]
private
OsRWMutex mListenerMutex
private