org.mobicents.media.server.impl.resource
Class Multiplexer

java.lang.Object
  extended by org.mobicents.media.server.impl.BaseComponent
      extended by org.mobicents.media.server.impl.AbstractSink
          extended by org.mobicents.media.server.impl.AbstractSinkSet
              extended by org.mobicents.media.server.impl.resource.Multiplexer
All Implemented Interfaces:
java.io.Serializable, org.mobicents.media.Component, org.mobicents.media.MediaSink, org.mobicents.media.Outlet, org.mobicents.media.server.spi.SyncSource

public class Multiplexer
extends AbstractSinkSet
implements org.mobicents.media.Outlet, org.mobicents.media.server.spi.SyncSource

Combines several signals for transmission over a single medium. A demultiplexor completes the process by separating multiplexed signals from a transmission line. Frequently a multiplexor and demultiplexor are combined into a single device capable of processing both outgoing and incoming signals.
Multiplexer combines data and sends them, it is used as output for components.

Author:
Oleg Kulikov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mobicents.media.server.impl.AbstractSink
logger, otherParty
 
Fields inherited from class org.mobicents.media.server.impl.BaseComponent
format
 
Constructor Summary
Multiplexer(java.lang.String name)
          Creates new instance of multiplexer.
 
Method Summary
 void connect(org.mobicents.media.MediaSink sink)
           
 AbstractSink createSink(org.mobicents.media.MediaSource otherParty)
           
 void destroySink(AbstractSink sink)
           
 void disconnect(org.mobicents.media.MediaSink sink)
           
 org.mobicents.media.Format[] getFormats()
          (Non Java-doc).
 org.mobicents.media.MediaSource getOutput()
          (Non Java-doc).
 long getTimestamp()
           
 void onMediaTransfer(org.mobicents.media.Buffer buffer)
          This methos is called when new portion of media arrives.
 void setConnection(org.mobicents.media.server.spi.Connection connection)
          (Non Java-doc.)
 void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)
          (Non Java-doc.)
 void start()
          (Non Java-doc).
 void stop()
          (Non Java-doc).
 void sync(org.mobicents.media.MediaSource mediaSource)
           
 org.mobicents.media.server.spi.clock.TimerTask sync(org.mobicents.media.server.spi.clock.Task task)
           
 void unsync(org.mobicents.media.MediaSource mediaSource)
           
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSinkSet
connect, disconnect, getActiveSinkCount, getStreams, isMultipleConnectionsAllowed
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSink
assignPreffered, connect, disconnect, failed, getBytesReceived, getInterface, getPacketsReceived, getPreffered, isConnected, isStarted, receive, resetStats, selectPreffered, started, stopped
 
Methods inherited from class org.mobicents.media.server.impl.BaseComponent
addListener, getConnection, getEndpoint, getFormat, getId, getName, removeListener, sendEvent, 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.Component
addListener, getConnection, getEndpoint, getFormat, getId, getInterface, getName, removeListener, resetStats
 
Methods inherited from interface org.mobicents.media.MediaSink
connect, disconnect, getBytesReceived, getPacketsReceived, isConnected, isStarted, receive
 

Constructor Detail

Multiplexer

public Multiplexer(java.lang.String name)
Creates new instance of multiplexer.

Parameters:
name - the name of the multiplexer to be created.
Method Detail

connect

public void connect(org.mobicents.media.MediaSink sink)
Specified by:
connect in interface org.mobicents.media.Outlet

disconnect

public void disconnect(org.mobicents.media.MediaSink sink)
Specified by:
disconnect in interface org.mobicents.media.Outlet

createSink

public AbstractSink createSink(org.mobicents.media.MediaSource otherParty)
Specified by:
createSink in class AbstractSinkSet

start

public void start()
Description copied from class: AbstractSink
(Non Java-doc).

Specified by:
start in interface org.mobicents.media.MediaSink
Specified by:
start in interface org.mobicents.media.server.spi.SyncSource
Overrides:
start in class AbstractSink
See Also:
MediaSink.start().

stop

public void stop()
Description copied from class: AbstractSink
(Non Java-doc).

Specified by:
stop in interface org.mobicents.media.MediaSink
Specified by:
stop in interface org.mobicents.media.server.spi.SyncSource
Overrides:
stop in class AbstractSink
See Also:
MediaSink.stop().

getOutput

public org.mobicents.media.MediaSource getOutput()
(Non Java-doc).

Specified by:
getOutput in interface org.mobicents.media.Outlet
See Also:
Outlet.getOutput().

getFormats

public org.mobicents.media.Format[] getFormats()
(Non Java-doc).

Specified by:
getFormats in interface org.mobicents.media.MediaSink
See Also:
MediaSource.getFormats().

setConnection

public void setConnection(org.mobicents.media.server.spi.Connection connection)
Description copied from class: BaseComponent
(Non Java-doc.)

Specified by:
setConnection in interface org.mobicents.media.Component
Overrides:
setConnection in class BaseComponent
See Also:
org.mobicents.media.Component#setConnection().

setEndpoint

public void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)
Description copied from class: BaseComponent
(Non Java-doc.)

Specified by:
setEndpoint in interface org.mobicents.media.Component
Overrides:
setEndpoint in class BaseComponent
See Also:
Component.setEndpoint(Endpoint).

onMediaTransfer

public void onMediaTransfer(org.mobicents.media.Buffer buffer)
                     throws java.io.IOException
Description copied from class: AbstractSink
This methos is called when new portion of media arrives.

Specified by:
onMediaTransfer in class AbstractSink
Parameters:
buffer - the new portion of media data.
Throws:
java.io.IOException

destroySink

public void destroySink(AbstractSink sink)
Specified by:
destroySink in class AbstractSinkSet

sync

public void sync(org.mobicents.media.MediaSource mediaSource)
Specified by:
sync in interface org.mobicents.media.server.spi.SyncSource

unsync

public void unsync(org.mobicents.media.MediaSource mediaSource)
Specified by:
unsync in interface org.mobicents.media.server.spi.SyncSource

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface org.mobicents.media.server.spi.SyncSource

sync

public org.mobicents.media.server.spi.clock.TimerTask sync(org.mobicents.media.server.spi.clock.Task task)
Specified by:
sync in interface org.mobicents.media.server.spi.SyncSource


Copyright © 2010. All Rights Reserved.