org.mobicents.media
Interface MediaSource

All Superinterfaces:
Component, Serializable
All Known Subinterfaces:
DtmfGenerator, Player

public interface MediaSource
extends Component

Abstracts a read interface that pushes data in the form of Buffer objects. This interface allows a source stream to transfer data in the form of an entire media chunk to the user of this source stream.

Author:
Oleg Kulikov, baranowb

Method Summary
 long getBytesTransmitted()
          Shows the number of bytes received by this sink since last start;
 long getDuration()
          Returns duration of the signal generated by this component if it is known.
 long getMediaTime()
          Gets the current media time position.
 long getPacketsTransmitted()
          Shows the number of packets received by this medis sink since last start.
 boolean isConnected()
          Gets the state of the component.
 boolean isStarted()
          Gets true if component is transmitting media.
 void setDuration(long duration)
          Sets maximum duration for the signal generated by media source
 void setInitialDelay(long initialDelay)
          Defines the delay between start() call and actual media streaming beginning.
 void setMediaTime(long time)
          Assigns media time from which this component should start media data.
 void start()
          Starts media processing.
 void stop()
          Terminates media processing.
 
Methods inherited from interface org.mobicents.media.Component
activate, clearEndpoint, deactivate, getEndpoint, getId, getName, reset, setEndpoint
 

Method Detail

setInitialDelay

void setInitialDelay(long initialDelay)
Defines the delay between start() call and actual media streaming beginning. After successful start this value will be changed to zero. The new value must be assigned before each start.

Parameters:
initialDelay - the value of delay measured in nanoseconds.

start

void start()
Starts media processing.


stop

void stop()
Terminates media processing.


getMediaTime

long getMediaTime()
Gets the current media time position.

Returns:
the current media time position in milliseconds.

setMediaTime

void setMediaTime(long time)
Assigns media time from which this component should start media data.

Parameters:
time - the value measured in nanoseconds.

getDuration

long getDuration()
Returns duration of the signal generated by this component if it is known.

Returns:
the duration of the signal in milliseconds or -1 if not known.

setDuration

void setDuration(long duration)
Sets maximum duration for the signal generated by media source

Parameters:
duration - the positive value in nanoseconds.

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 transmitting media.

Returns:
true if component is transmitting media.

getPacketsTransmitted

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

Returns:
the number of packets.

getBytesTransmitted

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

Returns:
the number of bytes.


Copyright © 2013 TeleStax, Inc.. All Rights Reserved.