sipxmedialib
Version 3.3
|
#include <MpStreamPlaylistPlayer.h>
Classes | |
struct | PlaylistDb |
Definition for a playlist entry. More... | |
Public Types | |
enum | SourceType { SourceUrl, SourceBuffer } |
Public Types inherited from MpPlayer | |
enum | playerType { STREAM_PLAYER, STREAM_PLAYLIST_PLAYER, STREAM_QUEUE_PLAYER } |
Public Member Functions | |
Creators | |
MpStreamPlaylistPlayer (OsMsgQ *pMsgQ, const char *pTarget=NULL) | |
Constructor accepting a flow graph. More... | |
virtual | ~MpStreamPlaylistPlayer () |
Destructor. More... | |
Manipulators | |
virtual OsStatus | add (Url &url, int flags) |
Adds a url to the playlist. More... | |
virtual OsStatus | add (UtlString *pBuffer, int flags) |
Adds a buffer to the playlist. More... | |
virtual OsStatus | realize (UtlBoolean bBlock=TRUE) |
Realizes the player by initiating a connection to the target, allocates buffers, etc. More... | |
virtual OsStatus | prefetch (UtlBoolean bBlock=TRUE) |
Prefetch enough of the data source to ensure a smooth playback. More... | |
virtual OsStatus | play (UtlBoolean bBlock=TRUE) |
Plays the media stream. This will play all play lists from start to finish. More... | |
virtual OsStatus | wait (const OsTime &rTimeout=OsTime::OS_INFINITY) |
Waits for the media stream(s) to finish playing. This will block the caller until all play lists have finished or rTimeout is reached. More... | |
virtual OsStatus | rewind (UtlBoolean bBlock=TRUE) |
Rewinds a previously played media stream. In some cases this may result in a re-connect/refetch. More... | |
virtual OsStatus | reset () |
Resets the playlist player state by stopping and removing all entries. More... | |
virtual OsStatus | stop () |
Stops play the media stream and resources used for buffering and streaming. More... | |
virtual OsStatus | destroy () |
virtual OsStatus | pause () |
Pauses the media stream temporarily. More... | |
Accessors | |
virtual OsStatus | getCount (int &count) const |
Gets the number of play list entries. More... | |
virtual OsStatus | getSourceType (int index, int &type) const |
Gets the source type for playlist entry 'index'. More... | |
virtual OsStatus | getSourceUrl (int index, Url url) const |
Gets the source url for playlist entry 'index'. More... | |
virtual OsStatus | getSourceBuffer (int index, UtlString *&netBuffer) const |
Gets the source buffer for playlist entry 'index'. More... | |
virtual OsStatus | getSourceState (int index, PlayerState &state) const |
Gets the state for the playlist entry 'index'. More... | |
virtual OsStatus | getCurrentIndex (int &iIndex) const |
Gets the current playing index if playing or the next index to play if playNext() was invoked. More... | |
virtual OsStatus | getState (PlayerState &state) |
Gets the aggregate playerlist player state. More... | |
Public Member Functions inherited from MpPlayer | |
MpPlayer () | |
virtual | ~MpPlayer () |
OsStatus | addListener (MpPlayerListener *pListener, void *pUserData=NULL) |
OsStatus | removeListener (MpPlayerListener *pListener) |
Protected Member Functions | |
MpStreamPlaylistPlayer (const MpStreamPlaylistPlayer &rMpStreamPlaylistPlayer) | |
Copy constructor. More... | |
MpStreamPlaylistPlayer & | operator= (const MpStreamPlaylistPlayer &rhs) |
Assignment operator. More... | |
virtual OsStatus | first () |
Selects the first playlist entry as the next index to play. More... | |
virtual OsStatus | last () |
Selects the last playlist entry as the next index to play. More... | |
virtual OsStatus | playNext (UtlBoolean bBlock=TRUE) |
Plays the next playlist entry without wrapping. More... | |
virtual OsStatus | playPrevious (UtlBoolean bBlock=TRUE) |
Plays the previous playlist entry without wrapping. More... | |
void | setEntryState (int index, PlayerState iState) |
Sets the state for a specific entry. More... | |
OsStatus | playEntry (int iEntry, UtlBoolean bBlock=TRUE) |
Starts playing a specific entry. More... | |
OsStatus | rewindEntry (int iEntry, UtlBoolean bBlock=TRUE) |
Rewinds a specific entry. More... | |
OsStatus | stopEntry (int index, UtlBoolean bBlock=TRUE) |
Stops playing a specific entry. More... | |
OsStatus | pauseEntry (int index) |
Pauses a specific entry. More... | |
OsStatus | destroyEntry (int index, UtlBoolean bBlockAndClean=TRUE) |
Destroys a specific entry. More... | |
virtual UtlBoolean | handleMessage (OsMsg &rMsg) |
Handle messages directed to this server task. More... | |
void | handleRealizedState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the realized state. More... | |
void | handlePrefetchedState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the prefetched state. More... | |
void | handlePlayingState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the playing state. More... | |
void | handlePausedState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the paused state. More... | |
void | handleStoppedState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the stopped state. More... | |
void | handleFailedState (int index, PlayerState oldState, PlayerState newState) |
Handles processing for the failed state. More... | |
const char * | getFeederEventString (int iEvent) |
Handles converting Feeder events into human readable form. More... | |
Protected Member Functions inherited from MpPlayer | |
void | fireEvent (PlayerState state) |
UtlBoolean | isValidStateChange (PlayerState oldState, PlayerState newState) |
Private Attributes | |
int | mNumPlayListElements |
number of play list entries More... | |
int | mCurrentElement |
next item to play More... | |
int | mPlayingElement |
current playing item More... | |
OsQueuedEvent * | mpQueueEvent |
event for notifications More... | |
OsBSem | mSemStateChange |
used to block for state changes More... | |
OsMsgQ * | mpMsgQ |
MsgQ to send commands. More... | |
UtlString | mTarget |
target used for MsgQ receive to help dispatch More... | |
OsEvent | mWaitEvent |
used to block until player completes More... | |
OsTime | mRealizeTimeout |
Timeout for Realize operation. More... | |
OsTime | mPrefetchTimeout |
Timeout for Prefetch operation. More... | |
OsTime | mPlayTimeout |
Timeout for Play operation. More... | |
OsTime | mRewindTimeout |
Timeout for Rewind operation. More... | |
OsTime | mStopTimeout |
Timeout for Stop operation. More... | |
OsTime | mDestroyTimeout |
Timeout for Destroy operation. More... | |
UtlBoolean | mbAutoAdvance |
used to play playlist lists More... | |
struct PlaylistDb | mPlayListDb [MAX_PLAYLIST_LENGTH] |
db of entries More... | |
PlayerState | mAggregateState |
Aggregate state of the player. More... | |
enum SourceType |
MpStreamPlaylistPlayer | ( | OsMsgQ * | pMsgQ, |
const char * | pTarget = NULL |
||
) |
Constructor accepting a flow graph.
|
virtual |
Destructor.
|
protected |
Copy constructor.
|
virtual |
Adds a url to the playlist.
url | Url identifying the source data stream |
flags | Playing flags (see StreamDefs.h) |
|
virtual |
Adds a buffer to the playlist.
pBuffer | - Net Buffer containing buffered audio data. The MpStreamPlayer resource will delete the pBuffer upon destruction of itself. |
flags | - Playing flags (see StreamDefs.h) |
|
virtual |
Realizes the player by initiating a connection to the target, allocates buffers, etc.
bBlock | - TRUE if the method should block until completion, otherwise FALSE. |
Implements MpPlayer.
|
virtual |
Prefetch enough of the data source to ensure a smooth playback.
bBlock | - TRUE if the method should block until completion, otherwise FALSE. |
Implements MpPlayer.
|
virtual |
Plays the media stream. This will play all play lists from start to finish.
bBlock | - TRUE if the method should block until completion, otherwise FALSE. |
Implements MpPlayer.
|
virtual |
Waits for the media stream(s) to finish playing. This will block the caller until all play lists have finished or rTimeout is reached.
rTimeout | - Optional timeout. If not specified, wait forever. |
|
virtual |
Rewinds a previously played media stream. In some cases this may result in a re-connect/refetch.
bBlock | - TRUE if the method should block until completion, otherwise FALSE. |
|
virtual |
Resets the playlist player state by stopping and removing all entries.
|
virtual |
Stops play the media stream and resources used for buffering and streaming.
Implements MpPlayer.
|
virtual |
the player as destroy and frees all allocated resources in media processing.
Implements MpPlayer.
|
virtual |
Pauses the media stream temporarily.
Implements MpPlayer.
|
virtual |
Gets the number of play list entries.
|
virtual |
Gets the source type for playlist entry 'index'.
|
virtual |
Gets the source url for playlist entry 'index'.
|
virtual |
Gets the source buffer for playlist entry 'index'.
|
virtual |
Gets the state for the playlist entry 'index'.
|
virtual |
Gets the current playing index if playing or the next index to play if playNext() was invoked.
|
virtual |
Gets the aggregate playerlist player state.
Implements MpPlayer.
|
protected |
Assignment operator.
|
protectedvirtual |
Selects the first playlist entry as the next index to play.
|
protectedvirtual |
Selects the last playlist entry as the next index to play.
|
protectedvirtual |
Plays the next playlist entry without wrapping.
|
protectedvirtual |
Plays the previous playlist entry without wrapping.
|
protected |
Sets the state for a specific entry.
|
protected |
Starts playing a specific entry.
|
protected |
Rewinds a specific entry.
|
protected |
Stops playing a specific entry.
|
protected |
Pauses a specific entry.
|
protected |
Destroys a specific entry.
|
protectedvirtual |
Handle messages directed to this server task.
|
protected |
Handles processing for the realized state.
|
protected |
Handles processing for the prefetched state.
|
protected |
Handles processing for the playing state.
|
protected |
Handles processing for the paused state.
|
protected |
Handles processing for the stopped state.
|
protected |
Handles processing for the failed state.
|
protected |
Handles converting Feeder events into human readable form.
|
private |
number of play list entries
|
private |
next item to play
|
private |
current playing item
|
private |
event for notifications
|
private |
used to block for state changes
|
private |
MsgQ to send commands.
|
private |
target used for MsgQ receive to help dispatch
|
private |
used to block until player completes
|
private |
Timeout for Realize operation.
|
private |
Timeout for Prefetch operation.
|
private |
Timeout for Play operation.
|
private |
Timeout for Rewind operation.
|
private |
Timeout for Stop operation.
|
private |
Timeout for Destroy operation.
|
private |
used to play playlist lists
|
private |
db of entries
|
private |
Aggregate state of the player.