|
||||||||||
| 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.AbstractSource
public abstract class AbstractSource
The base implementation of the Media source.
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.MediaSink |
otherParty
|
| Fields inherited from class org.mobicents.media.server.impl.BaseComponent |
|---|
format |
| Constructor Summary | |
|---|---|
AbstractSource(java.lang.String name)
Creates new instance of source with specified name. |
|
| Method Summary | ||
|---|---|---|
void |
afterStop()
This method is called immediately after processing termination. |
|
protected void |
beforeStart()
This method is called just before start. |
|
void |
cancel()
|
|
protected void |
completed()
Sends notification that signal is completed. |
|
void |
connect(org.mobicents.media.Inlet inlet)
|
|
void |
connect(org.mobicents.media.MediaSink otherParty)
(Non Java-doc). |
|
void |
disconnect(org.mobicents.media.Inlet inlet)
|
|
void |
disconnect(org.mobicents.media.MediaSink otherParty)
(Non Java-doc). |
|
abstract void |
evolve(org.mobicents.media.Buffer buffer,
long timestamp)
This method must be overriden by concrete media source. |
|
protected void |
failed(int eventID,
java.lang.Exception e)
Sends failure notification. |
|
long |
getBytesTransmitted()
(Non Java-doc). |
|
long |
getDuration()
(Non Java-doc). |
|
|
getInterface(java.lang.Class<T> interfaceType)
|
|
long |
getMediaTime()
(Non Java-doc). |
|
long |
getPacketsTransmitted()
(Non Java-doc). |
|
protected java.lang.String |
getSupportedFormatList()
|
|
boolean |
isActive()
|
|
boolean |
isConnected()
(Non Java-doc). |
|
boolean |
isMultipleConnectionsAllowed()
|
|
boolean |
isStarted()
(Non Java-doc). |
|
int |
perform()
|
|
void |
resetStats()
(Non Java-doc.) |
|
void |
setDuration(long duration)
(Non Java-doc). |
|
void |
setMediaTime(long timestamp)
(Non Java-doc). |
|
void |
setPreffered(org.mobicents.media.Format format)
This methods is called by media sink to setup preffered format. |
|
protected void |
setStarted(boolean started)
|
|
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.MediaSource |
|---|
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.MediaSink otherParty
protected org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public AbstractSource(java.lang.String name)
name - the name of the sink to be created.| Method Detail |
|---|
public long getMediaTime()
getMediaTime in interface org.mobicents.media.MediaSourceMediaSource.getMediaTime();public void setMediaTime(long timestamp)
setMediaTime in interface org.mobicents.media.MediaSourceMediaSource.setMediaTime(long timestamp);public long getDuration()
getDuration in interface org.mobicents.media.MediaSourceorg.mobicents.media.MediaSource#getDuration(long duration);public void setDuration(long duration)
setDuration in interface org.mobicents.media.MediaSourceMediaSource.setDuration(long duration);
protected void beforeStart()
throws java.lang.Exception
java.lang.Exceptionpublic void start()
start in interface org.mobicents.media.MediaSourceMediaSource.start().public void stop()
stop in interface org.mobicents.media.MediaSourceMediaSource.stop().public void cancel()
cancel in interface org.mobicents.media.server.spi.clock.Taskpublic boolean isActive()
isActive in interface org.mobicents.media.server.spi.clock.Taskprotected void setStarted(boolean started)
public void afterStop()
public boolean isMultipleConnectionsAllowed()
isMultipleConnectionsAllowed in interface org.mobicents.media.MediaSourcepublic void setPreffered(org.mobicents.media.Format format)
sink.getPreffred(Collection)
where collection is a subset of common formats.
format - preffred format.public void connect(org.mobicents.media.MediaSink otherParty)
connect in interface org.mobicents.media.MediaSourceMediaSource.connect(MediaSink).public void disconnect(org.mobicents.media.MediaSink otherParty)
disconnect in interface org.mobicents.media.MediaSourceorg.mobicents.media.MediaSource#diconnection(MediaSink).public void connect(org.mobicents.media.Inlet inlet)
connect in interface org.mobicents.media.MediaSourcepublic void disconnect(org.mobicents.media.Inlet inlet)
disconnect in interface org.mobicents.media.MediaSourcepublic boolean isConnected()
isConnected in interface org.mobicents.media.MediaSourceMediaSink.isConnected().public boolean isStarted()
isStarted in interface org.mobicents.media.MediaSourceMediaSource.isStarted().
public abstract void evolve(org.mobicents.media.Buffer buffer,
long timestamp)
buffer - the buffer object for media.sequenceNumber - the number of timer ticks from the begining.protected java.lang.String getSupportedFormatList()
public int perform()
perform in interface org.mobicents.media.server.spi.clock.Taskprotected void started()
protected void failed(int eventID,
java.lang.Exception e)
eventID - failure event identifier.e - the exception caused failure.protected void completed()
protected void stopped()
public long getPacketsTransmitted()
getPacketsTransmitted in interface org.mobicents.media.MediaSourceorg.mobicents.media.MediaSource#getPacketsReceived()public long getBytesTransmitted()
getBytesTransmitted in interface org.mobicents.media.MediaSourceMediaSource.getBytesTransmitted()public void resetStats()
BaseComponent
resetStats in interface org.mobicents.media.ComponentresetStats in class BaseComponentorg.mobicents.media.Component#reserStats();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 | |||||||||