15 #ifndef _MpStreamPlaylistPlayer_h_ 16 #define _MpStreamPlaylistPlayer_h_ 18 #ifndef DISABLE_STREAM_PLAYER // [ 25 #include "os/OsBSem.h" 26 #include "os/OsEvent.h" 27 #include "os/OsDefs.h" 28 #include "os/OsServerTask.h" 29 #include "os/OsStatus.h" 30 #include "os/OsQueuedEvent.h" 33 #define MAX_PLAYLIST_LENGTH 40 34 #define REALIZE_TIMEOUT 15 35 #define PREFETCH_TIMEOUT 30 36 #define PLAY_TIMEOUT 180 37 #define REWIND_TIMEOUT 15 38 #define STOP_TIMEOUT 15 39 #define DESTROY_TIMEOUT 30 80 virtual OsStatus
add( Url& url
86 virtual OsStatus
add(UtlString* pBuffer,
int flags);
110 virtual OsStatus
play(UtlBoolean bBlock =
TRUE);
118 virtual OsStatus
wait(
const OsTime& rTimeout = OsTime::OS_INFINITY);
125 virtual OsStatus
rewind(UtlBoolean bBlock =
TRUE);
133 virtual OsStatus
reset() ;
139 virtual OsStatus
stop() ;
146 virtual OsStatus
pause() ;
156 virtual OsStatus
getCount(
int& count)
const ;
162 virtual OsStatus
getSourceUrl(
int index, Url url)
const ;
165 virtual OsStatus
getSourceBuffer(
int index, UtlString*& netBuffer)
const ;
195 virtual OsStatus
first() ;
200 virtual OsStatus
last() ;
294 #endif // DISABLE_STREAM_PLAYER ] 296 #endif // _MpStreamPlaylistPlayer_h_ int sourceType
Source type (url or buffer)
Definition: MpStreamPlaylistPlayer.h:260
virtual OsStatus getSourceUrl(int index, Url url) const
Gets the source url for playlist entry 'index'.
Definition: MpStreamPlaylistPlayer.cpp:463
OsTime mRealizeTimeout
Timeout for Realize operation.
Definition: MpStreamPlaylistPlayer.h:279
virtual OsStatus stop()
Stops play the media stream and resources used for buffering and streaming.
Definition: MpStreamPlaylistPlayer.cpp:390
MpStreamPlaylistPlayer(OsMsgQ *pMsgQ, const char *pTarget=NULL)
Constructor accepting a flow graph.
Definition: MpStreamPlaylistPlayer.cpp:34
void handlePausedState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the paused state.
Definition: MpStreamPlaylistPlayer.cpp:1070
OsStatus playEntry(int iEntry, UtlBoolean bBlock=TRUE)
Starts playing a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:663
virtual OsStatus play(UtlBoolean bBlock=TRUE)
Plays the media stream. This will play all play lists from start to finish.
Definition: MpStreamPlaylistPlayer.cpp:285
Definition: MpStreamPlaylistPlayer.h:57
virtual OsStatus rewind(UtlBoolean bBlock=TRUE)
Rewinds a previously played media stream. In some cases this may result in a re-connect/refetch.
Definition: MpStreamPlaylistPlayer.cpp:342
OsTime mRewindTimeout
Timeout for Rewind operation.
Definition: MpStreamPlaylistPlayer.h:282
void handlePrefetchedState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the prefetched state.
Definition: MpStreamPlaylistPlayer.cpp:1021
#define MAX_PLAYLIST_LENGTH
Max number of play list entries.
Definition: MpStreamPlaylistPlayer.h:33
virtual UtlBoolean handleMessage(OsMsg &rMsg)
Handle messages directed to this server task.
Definition: MpStreamPlaylistPlayer.cpp:915
MpStreamPlaylistPlayer & operator=(const MpStreamPlaylistPlayer &rhs)
Assignment operator.
Definition: MpStreamPlaylistPlayer.cpp:549
UtlString * pBuffer
buffer if source type buffer
Definition: MpStreamPlaylistPlayer.h:262
void handlePlayingState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the playing state.
Definition: MpStreamPlaylistPlayer.cpp:1055
PlayerState state
state of the entry
Definition: MpStreamPlaylistPlayer.h:264
Definition: MpPlayer.h:92
Definition: MpStreamPlaylistPlayer.h:58
void setEntryState(int index, PlayerState iState)
Sets the state for a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:615
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...
Definition: MpStreamPlaylistPlayer.cpp:322
virtual OsStatus playPrevious(UtlBoolean bBlock=TRUE)
Plays the previous playlist entry without wrapping.
Definition: MpStreamPlaylistPlayer.cpp:599
int mCurrentElement
next item to play
Definition: MpStreamPlaylistPlayer.h:271
Url url
url if source type url
Definition: MpStreamPlaylistPlayer.h:261
virtual OsStatus reset()
Resets the playlist player state by stopping and removing all entries.
Definition: MpStreamPlaylistPlayer.cpp:363
OsTime mPrefetchTimeout
Timeout for Prefetch operation.
Definition: MpStreamPlaylistPlayer.h:280
virtual OsStatus getSourceType(int index, int &type) const
Gets the source type for playlist entry 'index'.
Definition: MpStreamPlaylistPlayer.cpp:448
virtual OsStatus add(Url &url, int flags)
Adds a url to the playlist.
Definition: MpStreamPlaylistPlayer.cpp:92
void * StreamHandle
Handles used by the renderer.
Definition: StreamDefs.h:42
virtual OsStatus destroy()
Definition: MpStreamPlaylistPlayer.cpp:408
OsBSem mSemStateChange
used to block for state changes
Definition: MpStreamPlaylistPlayer.h:275
OsMsgQ * mpMsgQ
MsgQ to send commands.
Definition: MpStreamPlaylistPlayer.h:276
virtual OsStatus prefetch(UtlBoolean bBlock=TRUE)
Prefetch enough of the data source to ensure a smooth playback.
Definition: MpStreamPlaylistPlayer.cpp:240
const char * getFeederEventString(int iEvent)
Handles converting Feeder events into human readable form.
OsQueuedEvent * pQueuedEvent
queued event for notifications
Definition: MpStreamPlaylistPlayer.h:266
UtlBoolean mbAutoAdvance
used to play playlist lists
Definition: MpStreamPlaylistPlayer.h:286
OsTime mStopTimeout
Timeout for Stop operation.
Definition: MpStreamPlaylistPlayer.h:283
virtual OsStatus realize(UtlBoolean bBlock=TRUE)
Realizes the player by initiating a connection to the target, allocates buffers, etc.
Definition: MpStreamPlaylistPlayer.cpp:136
OsStatus destroyEntry(int index, UtlBoolean bBlockAndClean=TRUE)
Destroys a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:846
Definition: MpStreamPlaylistPlayer.h:50
Definition for a playlist entry.
Definition: MpStreamPlaylistPlayer.h:258
struct PlaylistDb mPlayListDb[MAX_PLAYLIST_LENGTH]
db of entries
Definition: MpStreamPlaylistPlayer.h:288
void handleFailedState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the failed state.
Definition: MpStreamPlaylistPlayer.cpp:1130
int flags
flags for the entry
Definition: MpStreamPlaylistPlayer.h:265
virtual OsStatus getSourceBuffer(int index, UtlString *&netBuffer) const
Gets the source buffer for playlist entry 'index'.
Definition: MpStreamPlaylistPlayer.cpp:481
virtual OsStatus getState(PlayerState &state)
Gets the aggregate playerlist player state.
Definition: MpStreamPlaylistPlayer.cpp:527
OsStatus pauseEntry(int index)
Pauses a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:818
virtual OsStatus getCount(int &count) const
Gets the number of play list entries.
Definition: MpStreamPlaylistPlayer.cpp:440
virtual OsStatus getCurrentIndex(int &iIndex) const
Gets the current playing index if playing or the next index to play if playNext() was invoked...
Definition: MpStreamPlaylistPlayer.cpp:514
void handleStoppedState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the stopped state.
Definition: MpStreamPlaylistPlayer.cpp:1085
virtual OsStatus getSourceState(int index, PlayerState &state) const
Gets the state for the playlist entry 'index'.
Definition: MpStreamPlaylistPlayer.cpp:498
virtual OsStatus first()
Selects the first playlist entry as the next index to play.
Definition: MpStreamPlaylistPlayer.cpp:559
PlayerState
Definition: MpPlayer.h:38
int mNumPlayListElements
number of play list entries
Definition: MpStreamPlaylistPlayer.h:270
virtual OsStatus pause()
Pauses the media stream temporarily.
Definition: MpStreamPlaylistPlayer.cpp:423
OsTime mPlayTimeout
Timeout for Play operation.
Definition: MpStreamPlaylistPlayer.h:281
SourceType
Definition: MpStreamPlaylistPlayer.h:55
virtual ~MpStreamPlaylistPlayer()
Destructor.
Definition: MpStreamPlaylistPlayer.cpp:79
int mPlayingElement
current playing item
Definition: MpStreamPlaylistPlayer.h:272
UtlString mTarget
target used for MsgQ receive to help dispatch
Definition: MpStreamPlaylistPlayer.h:277
OsTime mDestroyTimeout
Timeout for Destroy operation.
Definition: MpStreamPlaylistPlayer.h:284
virtual OsStatus last()
Selects the last playlist entry as the next index to play.
Definition: MpStreamPlaylistPlayer.cpp:570
OsQueuedEvent * mpQueueEvent
event for notifications
Definition: MpStreamPlaylistPlayer.h:274
virtual OsStatus playNext(UtlBoolean bBlock=TRUE)
Plays the next playlist entry without wrapping.
Definition: MpStreamPlaylistPlayer.cpp:584
StreamHandle handle
handle of the feeder
Definition: MpStreamPlaylistPlayer.h:263
void handleRealizedState(int index, PlayerState oldState, PlayerState newState)
Handles processing for the realized state.
Definition: MpStreamPlaylistPlayer.cpp:988
#define TRUE
Definition: PlgDefsV1.h:41
OsStatus rewindEntry(int iEntry, UtlBoolean bBlock=TRUE)
Rewinds a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:718
OsStatus stopEntry(int index, UtlBoolean bBlock=TRUE)
Stops playing a specific entry.
Definition: MpStreamPlaylistPlayer.cpp:771
PlayerState mAggregateState
Aggregate state of the player.
Definition: MpStreamPlaylistPlayer.h:289
OsEvent mWaitEvent
used to block until player completes
Definition: MpStreamPlaylistPlayer.h:278