org.mobicents.media
Interface MediaSink

All Superinterfaces:
Component, java.io.Serializable
All Known Subinterfaces:
DtmfDetector, Recorder

public interface MediaSink
extends Component

Implements the media consumer.

Author:
Oleg Kulikov\, baranowb

Method Summary
 void connect(MediaSource source)
          Joins this media sink with media source.
 void connect(Outlet outlet)
          Create connection between outlet and this sink.
 void disconnect(MediaSource source)
          Breaks connection with media source.
 void disconnect(Outlet outlet)
          Disconnects specified outlet from this sink.
 long getBytesReceived()
          Shows the number of bytes received by this sink since last start;
 Format[] getFormats()
          Get possible formats which this consumer can handle.
 long getPacketsReceived()
          Shows the number of packets received by this medis sink since last start.
 boolean isConnected()
          Gets the state of the component.
 boolean isMultipleConnectionsAllowed()
          Flags which indicates that multiple connections to this sink are allowed.
 boolean isStarted()
          Gets true if component is able to receive media.
 void receive(Buffer buffer)
          This methos is called by media source when new media is available
 void start()
          Starts media processing.
 void stop()
          Terminates media processing.
 
Methods inherited from interface org.mobicents.media.Component
addListener, getConnection, getEndpoint, getFormat, getId, getInterface, getName, removeListener, resetStats, setConnection, setEndpoint
 

Method Detail

start

void start()
Starts media processing.


stop

void stop()
Terminates media processing.


getFormats

Format[] getFormats()
Get possible formats which this consumer can handle.

Returns:
an array of Format objects.

connect

void connect(MediaSource source)
Joins this media sink with media source. The concrete media sink can allow to join with multiple sources

Parameters:
source - the media source to join with.

disconnect

void disconnect(MediaSource source)
Breaks connection with media source. The concrete media sink can allow to join with multiple sources so this method requires the explicit source for disconnection.

Parameters:
source - the source to disconnect from.

isMultipleConnectionsAllowed

boolean isMultipleConnectionsAllowed()
Flags which indicates that multiple connections to this sink are allowed.

Returns:
true if multiple connections are allowed

connect

void connect(Outlet outlet)
Create connection between outlet and this sink.

Parameters:
outlet - the outlet to connect with

disconnect

void disconnect(Outlet outlet)
Disconnects specified outlet from this sink.

Parameters:
outlet - the outlet to disconnect.

receive

void receive(Buffer buffer)
             throws java.io.IOException
This methos is called by media source when new media is available

Parameters:
buffer - the Buffer object which contains the next portion of media.
Throws:
java.io.IOException

isConnected

boolean isConnected()
Gets the state of the component.

Returns:
true if component is connected to other component.

isStarted

boolean isStarted()
Gets true if component is able to receive media.

Returns:
true if component is able to receive media.

getPacketsReceived

long getPacketsReceived()
Shows the number of packets received by this medis sink since last start.

Returns:
the number of packets.

getBytesReceived

long getBytesReceived()
Shows the number of bytes received by this sink since last start;

Returns:
the number of bytes.


Copyright © 2010. All Rights Reserved.