This resource is an insertion point for the streaming infrastructure by connecting the flowgraph to MpStreamFeeders.
More...
|
|
| MprFromStream (const UtlString &rName) |
|
virtual | ~MprFromStream () |
|
|
OsStatus | realize (Url urlSource, int flags, StreamHandle &handle, OsNotification *event=NULL) |
|
OsStatus | realize (UtlString *pBuffer, int flags, StreamHandle &handle, OsNotification *event=NULL) |
|
OsStatus | prefetch (StreamHandle handle) |
|
OsStatus | play (StreamHandle handle) |
|
OsStatus | rewind (StreamHandle handle) |
|
OsStatus | pause (StreamHandle handle) |
|
OsStatus | stop (StreamHandle handle) |
|
OsStatus | destroy (StreamHandle handle) |
|
OsStatus | getFlags (StreamHandle handle, int &flags) |
|
| MpAudioResource (const UtlString &rName, int minInputs, int maxInputs, int minOutputs, int maxOutputs) |
| Constructor. More...
|
|
virtual | ~MpAudioResource () |
| Destructor. More...
|
|
virtual UtlBoolean | processFrame (void) |
| Wrapper around doProcessFrame(). More...
|
|
| MpResource (const UtlString &rName, int minInputs, int maxInputs, int minOutputs, int maxOutputs) |
| Constructor. More...
|
|
virtual | ~MpResource () |
| Destructor. More...
|
|
virtual UtlBoolean | disable () |
| Disable this resource. More...
|
|
virtual UtlBoolean | enable () |
| Enable this resource. More...
|
|
virtual void | reset () |
| This method is invoked for resources that care about stream discontinuities. More...
|
|
UtlBoolean | handleMessages (OsMsgQ &msgQ) |
| Handles a queue full of incoming messages for this media processing object. More...
|
|
void | setVisitState (int newState) |
| Sets the visit state for this resource. More...
|
|
OsStatus | sendNotification (MpResNotificationMsg::RNMsgType msgType) |
| Send a notification with the given message type if notifications are enabled. More...
|
|
OsStatus | sendNotification (MpResNotificationMsg &msg) |
| Send the given notification message if notifications are enabled. More...
|
|
virtual void | setConnectionId (MpConnectionID connectionId) |
| Set the ID of a connection this resource belongs to. More...
|
|
virtual void | setStreamId (int streamId) |
| Set the ID of a stream inside of the connection this resource belongs to. More...
|
|
virtual int | getStreamId (void) |
| Get the ID of a stream within the connection this resource belongs to. More...
|
|
virtual OsStatus | pushBuffer (int inputPort, MpBufPtr &inputBuffer) |
| Receive buffer asynchronously from resource at given input port. More...
|
|
virtual void | reassignSSRC (void) |
| Broadcast announcement that we are changing our SSRC. More...
|
|
MpFlowGraphBase * | getFlowGraph () const |
| Returns parent flowgraph. More...
|
|
void | getInputInfo (int inPortIdx, MpResource *&rpUpstreamResource, int &rUpstreamPortIdx) |
| Returns information about the upstream end of a connection. More...
|
|
const UtlString & | getName () const |
| Returns the name associated with this resource. More...
|
|
void | getOutputInfo (int outPortIdx, MpResource *&rpDownstreamResource, int &rDownstreamPortIdx) |
| Returns information about the downstream end of a connection. More...
|
|
int | getVisitState () |
| Returns the current visit state for this resource. More...
|
|
int | maxInputs () const |
| Returns the maximum number of inputs supported by this resource. More...
|
|
int | maxOutputs () const |
| Returns the maximum number of outputs supported by this resource. More...
|
|
int | minInputs () const |
| Returns the minimum number of inputs required by this resource. More...
|
|
int | minOutputs () const |
| Returns the minimum number of outputs required by this resource. More...
|
|
int | numInputs () const |
| Returns the number of resource inputs that are currently connected. More...
|
|
int | numOutputs () const |
| Returns the number of resource outputs that are currently connected. More...
|
|
virtual MpConnectionID | getConnectionId (void) const |
| Get the ID of a connection this resource belongs to. More...
|
|
int | reserveFirstUnconnectedInput () |
| Find the first unconnected input port and reserve it. More...
|
|
int | reserveFirstUnconnectedOutput () |
| Find the first unconnected output port and reserve it. More...
|
|
UtlContainableType | getContainableType () const |
| Get the ContainableType for a UtlContainable derived class. More...
|
|
virtual OsStatus | getCurrentLatency (int &latency, int input=0, int output=0) const |
| Get current input to output latency (in samples) More...
|
|
UtlBoolean | isEnabled () const |
| Returns TRUE is this resource is currently enabled, FALSE otherwise. More...
|
|
UtlBoolean | isInputConnected (int portIdx) |
| Returns TRUE if portIdx is valid and the indicated input is connected, FALSE otherwise. More...
|
|
UtlBoolean | isInputUnconnected (int portIdx) |
| Returns TRUE if portIdx is valid and the indicated input is not connected, FALSE otherwise. More...
|
|
UtlBoolean | isOutputConnected (int portIdx) |
| Returns TRUE if portIdx is valid and the indicated output is connected, FALSE otherwise. More...
|
|
UtlBoolean | isOutputUnconnected (int portIdx) |
| Returns TRUE if portIdx is valid and the indicated output is not connected, FALSE otherwise. More...
|
|
UtlBoolean | areNotificationsEnabled () const |
| Returns TRUE if notification sending is enabled on this resource. More...
|
|
virtual UtlBoolean | isAsynchInput (int inputIndex) |
| Takes asynchronous input (pushBuffer). More...
|
|
|
enum | VisitState { NOT_VISITED,
IN_PROGRESS,
FINISHED
} |
| Graph traversal states that are used when running a topological sort to order resources within a flow graph. More...
|
|
enum | { ASSOCIATED_LATENCY =-1,
INF_LATENCY =-1
} |
|
static OsStatus | disable (const UtlString &namedResource, OsMsgQ &fgQ) |
| Post a message to disable the resource named. More...
|
|
static OsStatus | enable (const UtlString &namedResource, OsMsgQ &fgQ) |
| Post a message to enable the resource named. More...
|
|
static OsStatus | setNotificationsEnabled (UtlBoolean enable, const UtlString &namedResource, OsMsgQ &fgQ) |
| Post a message to enable or disable resource notifications on the named resource. More...
|
|
static void | resourceInfo (MpResource *pResource, int index) |
| Displays information on the console about the specified resource. More...
|
|
static const UtlContainableType | TYPE = "MpResource" |
| Class name, used for run-time checks. More...
|
|
MpFlowGraphBase * | mpFlowGraph |
| flow graph this resource belongs to More...
|
|
MpConnectionID | mConnectionId |
| The ID of connection this resource belongs to. More...
|
|
int | mStreamId |
|
UtlBoolean | mIsEnabled |
| TRUE if resource is enabled, FALSE otherwise. More...
|
|
OsRWMutex | mRWMutex |
| reader/writer lock for synchronization More...
|
|
MpBufPtr * | mpInBufs |
| input buffers for this resource More...
|
|
MpBufPtr * | mpOutBufs |
| output buffers for this resource More...
|
|
Conn * | mpInConns |
| input connections for this resource More...
|
|
Conn * | mpOutConns |
| output connections for this resource More...
|
|
int | mMaxInputs |
| maximum number of inputs More...
|
|
int | mMaxOutputs |
| maximum number of outputs More...
|
|
int | mMinInputs |
| number of required inputs More...
|
|
int | mMinOutputs |
| number of required outputs More...
|
|
int | mNumActualInputs |
| actual number of connected inputs More...
|
|
int | mNumActualOutputs |
| actual number of connected outputs More...
|
|
int | mVisitState |
| (used by flow graph topological sort alg.) More...
|
|
UtlBoolean | mNotificationsEnabled |
| Whether we should send notifications or not. More...
|
|
OsBSem | mLock |
| used mainly to make safe changes to ports More...
|
|
static const OsTime | sOperationQueueTimeout = OsTime::OS_INFINITY |
| The timeout for message operations for all resources when posting to the flowgraph queue. More...
|
|
This resource is an insertion point for the streaming infrastructure by connecting the flowgraph to MpStreamFeeders.
Whenever requested to "realize" a stream, this code will create a MpStreamFeeder which inturn creates a StreamDataSource and a StreamFormatDecoder. Many MpStreamFeeders may be managed/created by a single MprFromStream, however, only one can be active at only one point.
For thread safety, all operations (play, destroy, rewind, etc.) result in a message being posted to itself. This forces all of the tasks to be performed on the same task context. The "realize" operation is an exception, where it is processed on the called context.
Additionally, the code creates a level of indirection between between the implementation and calling parties (application layer). All MpStreamFeeders created by this resource are collected within a list (mStreamList) and only a handle to the resource is exposed to application layer. Handles are unique for an instance of a MprFromStream. If the destruct is called for MprFromStream and the mStreamList is not null, the list is purged.
This class bubbles events to the MpStreamFeeder by calling the fromStreamUpdate callback on the feeder itself.