Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.alsa
Class DataSource

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PushBufferDataSource
          extended by net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.alsa.DataSource
All Implemented Interfaces:
javax.media.Controls, javax.media.Duration

public class DataSource
extends javax.media.protocol.PushBufferDataSource

low-latency ALSA access through JNI wrapper

Author:
Jean Lorchat, Lubomir Marinov

Field Summary
protected  boolean connected
           
protected  javax.media.Time duration
           
protected  boolean started
           
protected  AlsaStream stream
           
protected  AlsaStream[] streams
           
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
DataSource()
          Constructs a new ALSA DataSource.
 
Method Summary
 void connect()
          Connect the datasource
 void disconnect()
          Disconnect the datasource
 String getContentType()
          Gets the type of the content made available by this DataSource (i.e.
 Object getControl(String controlType)
          Return required control from the Control[] array if exists, that is
 Object[] getControls()
          Gives control information to the caller.
 javax.media.Time getDuration()
          Gives to the caller the duration information of our stream Which is, obviously unknown.
 javax.media.protocol.PushBufferStream[] getStreams()
          Returns an array of PushBufferStream containing all the streams i.e.
 void start()
          Start the datasource and the underlying stream
 void stop()
          Stop the datasource and it's underlying stream
 
Methods inherited from class javax.media.protocol.DataSource
getLocator, initCheck, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

started

protected boolean started

connected

protected boolean connected

duration

protected javax.media.Time duration

streams

protected AlsaStream[] streams

stream

protected AlsaStream stream
Constructor Detail

DataSource

public DataSource()
Constructs a new ALSA DataSource.

Method Detail

getContentType

public String getContentType()
Gets the type of the content made available by this DataSource (i.e. raw).

Specified by:
getContentType in class javax.media.protocol.DataSource
Returns:
the type of the content made available by this DataSource (i.e. raw)

connect

public void connect()
             throws IOException
Connect the datasource

Specified by:
connect in class javax.media.protocol.DataSource
Throws:
IOException

disconnect

public void disconnect()
Disconnect the datasource

Specified by:
disconnect in class javax.media.protocol.DataSource

start

public void start()
           throws IOException
Start the datasource and the underlying stream

Specified by:
start in class javax.media.protocol.DataSource
Throws:
IOException

stop

public void stop()
          throws IOException
Stop the datasource and it's underlying stream

Specified by:
stop in class javax.media.protocol.DataSource
Throws:
IOException

getControls

public Object[] getControls()
Gives control information to the caller.

Specified by:
getControls in interface javax.media.Controls
Specified by:
getControls in class javax.media.protocol.DataSource

getControl

public Object getControl(String controlType)
Return required control from the Control[] array if exists, that is

Specified by:
getControl in interface javax.media.Controls
Specified by:
getControl in class javax.media.protocol.DataSource

getDuration

public javax.media.Time getDuration()
Gives to the caller the duration information of our stream Which is, obviously unknown. Better turn on that premonition switch again, Mrs Cake.

Specified by:
getDuration in interface javax.media.Duration
Specified by:
getDuration in class javax.media.protocol.DataSource
Returns:
DURATION_UNKNOWN

getStreams

public javax.media.protocol.PushBufferStream[] getStreams()
Returns an array of PushBufferStream containing all the streams i.e. only one in our case : only sound If no stream actually exists, instanciate one on the fly

Specified by:
getStreams in class javax.media.protocol.PushBufferDataSource
Returns:
Array of one stream

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.