|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.media.server.impl.BaseComponent
org.mobicents.media.server.impl.AbstractSink
public abstract class AbstractSink
The base implementation of the media sink.
AbstractSource and AbstractSink are implement
general wirring contruct.
All media components have to extend one of these classes.
| Field Summary | |
|---|---|
protected org.apache.log4j.Logger |
logger
|
protected org.mobicents.media.MediaSource |
otherParty
|
| Fields inherited from class org.mobicents.media.server.impl.BaseComponent |
|---|
format |
| Constructor Summary | |
|---|---|
AbstractSink(java.lang.String name)
Creates new instance of sink with specified name. |
|
| Method Summary | ||
|---|---|---|
void |
assignPreffered(org.mobicents.media.Format format)
|
|
void |
connect(org.mobicents.media.MediaSource otherParty)
(Non Java-doc). |
|
void |
connect(org.mobicents.media.Outlet outlet)
|
|
void |
disconnect(org.mobicents.media.MediaSource otherParty)
(Non Java-doc). |
|
void |
disconnect(org.mobicents.media.Outlet outlet)
|
|
protected void |
failed(int eventID,
java.lang.Exception e)
Sends failure notification. |
|
long |
getBytesReceived()
(Non Java-doc). |
|
|
getInterface(java.lang.Class<T> interfaceType)
|
|
long |
getPacketsReceived()
(Non Java-doc). |
|
org.mobicents.media.Format |
getPreffered(java.util.Collection<org.mobicents.media.Format> set)
This methods is called by Media Source to determine the preffred format during connection procedure. |
|
boolean |
isConnected()
(Non Java-doc). |
|
boolean |
isMultipleConnectionsAllowed()
|
|
boolean |
isStarted()
(Non Java-doc). |
|
abstract void |
onMediaTransfer(org.mobicents.media.Buffer buffer)
This methos is called when new portion of media arrives. |
|
void |
receive(org.mobicents.media.Buffer buffer)
(Non Java-doc). |
|
void |
resetStats()
(Non Java-doc.) |
|
protected org.mobicents.media.Format |
selectPreffered(java.util.Collection<org.mobicents.media.Format> set)
Implements the strategy of selecting preffred format from specified set. |
|
void |
start()
(Non Java-doc). |
|
protected void |
started()
Sends notification that media processing has been started. |
|
void |
stop()
(Non Java-doc). |
|
protected void |
stopped()
Sends notification that detection is terminated. |
|
| Methods inherited from class org.mobicents.media.server.impl.BaseComponent |
|---|
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, sendEvent, setConnection, setEndpoint, subset, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mobicents.media.MediaSink |
|---|
getFormats |
| Methods inherited from interface org.mobicents.media.Component |
|---|
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, setConnection, setEndpoint |
| Field Detail |
|---|
protected transient org.mobicents.media.MediaSource otherParty
protected org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public AbstractSink(java.lang.String name)
name - the name of the sink to be created.| Method Detail |
|---|
public org.mobicents.media.Format getPreffered(java.util.Collection<org.mobicents.media.Format> set)
set - the set of capable frmats
public void assignPreffered(org.mobicents.media.Format format)
protected org.mobicents.media.Format selectPreffered(java.util.Collection<org.mobicents.media.Format> set)
set - the set of formats.
public boolean isMultipleConnectionsAllowed()
isMultipleConnectionsAllowed in interface org.mobicents.media.MediaSinkpublic void connect(org.mobicents.media.MediaSource otherParty)
connect in interface org.mobicents.media.MediaSinkorg.mobicents.media.MediaSink#connect(MediaStream).public void disconnect(org.mobicents.media.MediaSource otherParty)
disconnect in interface org.mobicents.media.MediaSinkorg.mobicents.media.MediaSink#disconnect(MediaStream).public void connect(org.mobicents.media.Outlet outlet)
connect in interface org.mobicents.media.MediaSinkpublic void disconnect(org.mobicents.media.Outlet outlet)
disconnect in interface org.mobicents.media.MediaSinkpublic boolean isConnected()
isConnected in interface org.mobicents.media.MediaSinkMediaSink.isConnected().public boolean isStarted()
isStarted in interface org.mobicents.media.MediaSinkMediaSink.isStarted().
public abstract void onMediaTransfer(org.mobicents.media.Buffer buffer)
throws java.io.IOException
buffer - the new portion of media data.
java.io.IOExceptionpublic void start()
start in interface org.mobicents.media.MediaSinkMediaSink.start().public void stop()
stop in interface org.mobicents.media.MediaSinkMediaSink.stop().
public void receive(org.mobicents.media.Buffer buffer)
throws java.io.IOException
receive in interface org.mobicents.media.MediaSinkjava.io.IOExceptionorg.mobicents.media.MediaSink#receive().
protected void failed(int eventID,
java.lang.Exception e)
eventID - failure event identifier.e - the exception caused failure.public long getPacketsReceived()
getPacketsReceived in interface org.mobicents.media.MediaSinkMediaSink.getPacketsReceived().public long getBytesReceived()
getBytesReceived in interface org.mobicents.media.MediaSinkMediaSink.getBytesReceived()public void resetStats()
BaseComponent
resetStats in interface org.mobicents.media.ComponentresetStats in class BaseComponentorg.mobicents.media.Component#reserStats();protected void started()
protected void stopped()
public <T> T getInterface(java.lang.Class<T> interfaceType)
getInterface in interface org.mobicents.media.ComponentgetInterface in class BaseComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||