net.sf.fmj.media.protocol.javasound
Class DataSource
java.lang.Object
javax.media.protocol.DataSource
javax.media.protocol.PushBufferDataSource
net.sf.fmj.media.protocol.javasound.DataSource
- All Implemented Interfaces:
- Controls, Duration, CaptureDevice
public class DataSource
- extends PushBufferDataSource
- implements CaptureDevice
DataSource for JavaSound audio recording.
TODO: we should maybe make this a PullBufferDataSource, because otherwise
it has to constantly poll javasound to see if new data is available.
JMF's is a PushBufferDataSource though.
TODO: do transfer handler notifications asynchronously
- Author:
- Ken Larson
mgodehardt: added double buffering thru a ringbuffer, the buffer is filled by the
AvailabilityThread, the TrackThread is fetching the data from the buffer, this can
lead to dropped frames, increasing the size of the ringbuffer leads to more latency
Field Summary |
protected java.lang.Object[] |
controls
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
controls
protected java.lang.Object[] controls
DataSource
public DataSource()
connect
public void connect()
throws java.io.IOException
- Specified by:
connect
in interface CaptureDevice
- Specified by:
connect
in class DataSource
- Throws:
java.io.IOException
disconnect
public void disconnect()
- Specified by:
disconnect
in interface CaptureDevice
- Specified by:
disconnect
in class DataSource
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in class DataSource
getControl
public java.lang.Object getControl(java.lang.String controlType)
- Specified by:
getControl
in interface Controls
- Specified by:
getControl
in class DataSource
getControls
public java.lang.Object[] getControls()
- Specified by:
getControls
in interface Controls
- Specified by:
getControls
in class DataSource
start
public void start()
throws java.io.IOException
- Specified by:
start
in interface CaptureDevice
- Specified by:
start
in class DataSource
- Throws:
java.io.IOException
stop
public void stop()
throws java.io.IOException
- Specified by:
stop
in interface CaptureDevice
- Specified by:
stop
in class DataSource
- Throws:
java.io.IOException
getDuration
public Time getDuration()
- Specified by:
getDuration
in interface Duration
- Specified by:
getDuration
in class DataSource
getStreams
public PushBufferStream[] getStreams()
- Specified by:
getStreams
in class PushBufferDataSource
querySupportedFormats
public static Format[] querySupportedFormats(int mixerIndex)
getCaptureDeviceInfo
public CaptureDeviceInfo getCaptureDeviceInfo()
- Specified by:
getCaptureDeviceInfo
in interface CaptureDevice
getFormatControls
public FormatControl[] getFormatControls()
- Specified by:
getFormatControls
in interface CaptureDevice