sipxmedialib
Version 3.3
|
The MpStreamFeed coordinates with the data source and decoder to ready the input stream and then plugs into the MprFromStream resource to supply audio info the flowgraph. More...
#include <MpStreamFeeder.h>
Public Member Functions | |
Creators | |
MpStreamFeeder (Url resource, int flags) | |
Constructor accepting a url resource, type, and cache all flag. More... | |
MpStreamFeeder (UtlString *pBuffer, int flags) | |
Constructor accepting a pre-populated buffer, type and cache all flag. More... | |
virtual | ~MpStreamFeeder () |
Destructor. More... | |
OsStatus | realize () |
Initiates the connection with the outbound party to validate the connection. Buffers are allocated at this point. More... | |
OsStatus | render () |
Begin downloading and decoding data. More... | |
OsStatus | rewind () |
Rewind the data source to the prefetched state. More... | |
OsStatus | stop () |
OsStatus | setEventHandler (OsNotification *pEventHandler) |
Stop collecting/rendering data. More... | |
void | markPaused (UtlBoolean bPaused) |
Accessors | |
OsStatus | getFrame (unsigned short *samples) |
Get a frames worth of data (80 samples per frame) ;. More... | |
UtlBoolean | isMarkedPaused () |
Has the rendered been marked as paused? More... | |
OsStatus | getFlags (int &flags) |
Get the flags for this renderer. More... | |
FeederState | getState () |
Query the state for this renderer. More... | |
void | fromStreamUpdate (FeederEvent event) |
Called by the MprFromStream resource when events changes. More... | |
Inquiry | |
UtlBoolean | isValidStateChange (FeederState source, FeederState target) |
Is the transition from state source to target valid? More... | |
Public Member Functions inherited from StreamDataSourceListener | |
StreamDataSourceListener () | |
virtual | ~StreamDataSourceListener () |
Public Member Functions inherited from StreamDecoderListener | |
StreamDecoderListener () | |
virtual | ~StreamDecoderListener () |
Protected Member Functions | |
void | fireEvent (FeederEvent eventType) |
Fires renderer event to interested consumers. More... | |
void | setState (FeederState state) |
Sets the internal renderer state. More... | |
virtual void | decoderUpdate (StreamFormatDecoder *pDecoder, StreamDecoderEvent event) |
Call back for decoder updates. More... | |
virtual void | dataSourceUpdate (StreamDataSource *pDataSource, StreamDataSourceEvent event) |
Call back for data source updates. More... | |
Protected Member Functions inherited from StreamDataSourceListener | |
StreamDataSourceListener (const StreamDataSourceListener &rStreamDataSourceListener) | |
StreamDataSourceListener & | operator= (const StreamDataSourceListener &rhs) |
Protected Member Functions inherited from StreamDecoderListener | |
StreamDecoderListener (const StreamDecoderListener &rStreamDecoderListener) | |
StreamDecoderListener & | operator= (const StreamDecoderListener &rhs) |
Private Member Functions | |
void | initDecodingSource () |
Construction helper: initialize the decoding source. More... | |
Private Attributes | |
FeederState | m_state |
State of the Feeder. More... | |
StreamFormatDecoder * | m_pFormatDecoder |
Decoder. More... | |
StreamDataSource * | m_pDataSource |
Data Source. More... | |
int | mFlags |
Flags given at creation. More... | |
UtlBoolean | m_bMarkedPaused |
Is this marked as paused? More... | |
OsNotification * | m_pEventHandler |
Event sink. More... | |
int | m_iInstanceId |
OsMutex | m_eventGuard |
Static Private Attributes | |
static int | s_iInstanceCount = 0 |
The MpStreamFeed coordinates with the data source and decoder to ready the input stream and then plugs into the MprFromStream resource to supply audio info the flowgraph.
+-> | StreamDataSource |
| MprFromStream | 1..N -> | MpStreamFeeder |
The MpStreamFeeder has its own state table that mostly matches the generic player's state table:
Unrealized -> Realized -> Prefetching -> Prefetched -> Rendering -> Stopped
*->FailedState
Communications:
Events are send to the MpStreamPlayer resource indirectly through a settable OsNotifyEvent (setEventHandler).
Events are received from the MprFromStream object by the fromStreamUpdate callback function.
MpStreamFeeder | ( | Url | resource, |
int | flags | ||
) |
Constructor accepting a url resource, type, and cache all flag.
MpStreamFeeder | ( | UtlString * | pBuffer, |
int | flags | ||
) |
Constructor accepting a pre-populated buffer, type and cache all flag.
|
virtual |
Destructor.
As part of destroying the task, flush all messages from the incoming OsMsgQ.
OsStatus realize | ( | ) |
Initiates the connection with the outbound party to validate the connection. Buffers are allocated at this point.
OsStatus render | ( | ) |
Begin downloading and decoding data.
The state is not moved to prefetched until a sensible amount of data has been received and decoded.
OsStatus rewind | ( | ) |
Rewind the data source to the prefetched state.
OsStatus stop | ( | void | ) |
OsStatus setEventHandler | ( | OsNotification * | pEventHandler | ) |
Stop collecting/rendering data.
Set the event handler for this renderer. All events will be delievered to this handler.
void markPaused | ( | UtlBoolean | bPaused | ) |
Marks that playing is pauses; however, continues to render and stream.
OsStatus getFrame | ( | unsigned short * | samples | ) |
Get a frames worth of data (80 samples per frame) ;.
UtlBoolean isMarkedPaused | ( | ) |
Has the rendered been marked as paused?
OsStatus getFlags | ( | int & | flags | ) |
Get the flags for this renderer.
FeederState getState | ( | void | ) |
Query the state for this renderer.
void fromStreamUpdate | ( | FeederEvent | event | ) |
Called by the MprFromStream resource when events changes.
UtlBoolean isValidStateChange | ( | FeederState | source, |
FeederState | target | ||
) |
Is the transition from state source to target valid?
|
protected |
Fires renderer event to interested consumers.
|
protected |
Sets the internal renderer state.
|
protectedvirtual |
Call back for decoder updates.
Implements StreamDecoderListener.
|
protectedvirtual |
Call back for data source updates.
Implements StreamDataSourceListener.
|
private |
Construction helper: initialize the decoding source.
|
staticprivate |
|
private |
State of the Feeder.
|
private |
Decoder.
|
private |
Data Source.
|
private |
Flags given at creation.
|
private |
Is this marked as paused?
|
private |
Event sink.
|
private |
|
private |
Guards multiple threads from calling fireEvent at same time