Class DataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PullBufferDataSource
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.AbstractPullBufferCaptureDevice
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.portaudio.DataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls
public class DataSource extends AbstractPullBufferCaptureDevice
Implements DataSource and CaptureDevice for PortAudio.- Author:
- Damian Minkov, Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description DataSource()Initializes a new DataSource instance.DataSource(javax.media.MediaLocator locator)Initializes a new DataSource instance from a specific MediaLocator.DataSource(javax.media.MediaLocator locator, javax.media.Format[] supportedFormats, boolean audioQualityImprovement)Initializes a new DataSource instance from a specific MediaLocator and which has a specific list of Format in which it is capable of capturing audio data overriding its registration with JMF and optionally uses audio quality improvement in accord with the preferences of the user.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PortAudioStreamcreateStream(int streamIndex, javax.media.control.FormatControl formatControl)Creates a new PullBufferStream which is to be at a specific zero-based index in the list of streams of this PullBufferDataSource.protected voiddoConnect()Opens a connection to the media source specified by the MediaLocator of this DataSource.protected voiddoDisconnect()Closes the connection to the media source specified by the MediaLocator of this DataSource.static StringgetDeviceID(javax.media.MediaLocator locator)Gets the device index of a PortAudio device from a specific MediaLocator identifying it.protected javax.media.Format[]getSupportedFormats(int streamIndex)Gets the Formats which are to be reported by a FormatControl as supported formats for a PullBufferStream at a specific zero-based index in the list of streams of this PullBufferDataSource.-
Methods inherited from class org.jitsi.impl.neomedia.jmfext.media.protocol.AbstractPullBufferCaptureDevice
connect, createFrameRateControl, disconnect, doStart, doStop, getCaptureDeviceInfo, getContentType, getControl, getControls, getDuration, getFormat, getFormatControls, getStreams, getStreamSyncRoot, setCaptureDeviceInfo, setFormat, start, stop, streams
-
-
-
-
Constructor Detail
-
DataSource
public DataSource()
Initializes a new DataSource instance.
-
DataSource
public DataSource(javax.media.MediaLocator locator)
Initializes a new DataSource instance from a specific MediaLocator.- Parameters:
locator- the MediaLocator to create the new instance from
-
DataSource
public DataSource(javax.media.MediaLocator locator, javax.media.Format[] supportedFormats, boolean audioQualityImprovement)Initializes a new DataSource instance from a specific MediaLocator and which has a specific list of Format in which it is capable of capturing audio data overriding its registration with JMF and optionally uses audio quality improvement in accord with the preferences of the user.- Parameters:
locator- the MediaLocator to create the new instance fromsupportedFormats- the list of Formats in which the new instance is to be capable of capturing audio dataaudioQualityImprovement- true if audio quality improvement is to be enabled in accord with the preferences of the user or false to completely disable audio quality improvement
-
-
Method Detail
-
createStream
protected PortAudioStream createStream(int streamIndex, javax.media.control.FormatControl formatControl)
Creates a new PullBufferStream which is to be at a specific zero-based index in the list of streams of this PullBufferDataSource. The Format-related information of the new instance is to be abstracted by a specific FormatControl.- Specified by:
createStreamin classAbstractPullBufferCaptureDevice- Parameters:
streamIndex- the zero-based index of the PullBufferStream in the list of streams of this PullBufferDataSourceformatControl- the FormatControl which is to abstract the Format-related information of the new instance- Returns:
- a new PullBufferStream which is to be at the specified streamIndex in the list of streams of this PullBufferDataSource and which has its Format-related information abstracted by the specified formatControl
- See Also:
AbstractPullBufferCaptureDevice.createStream(int, FormatControl)
-
doConnect
protected void doConnect() throws IOExceptionOpens a connection to the media source specified by the MediaLocator of this DataSource.- Overrides:
doConnectin classAbstractPullBufferCaptureDevice- Throws:
IOException- if anything goes wrong while opening the connection to the media source specified by the MediaLocator of this DataSource- See Also:
AbstractPullBufferCaptureDevice.doConnect()
-
doDisconnect
protected void doDisconnect()
Closes the connection to the media source specified by the MediaLocator of this DataSource. Allows extenders to override and be sure that there will be no request to close a connection if the connection has not been opened yet.- Overrides:
doDisconnectin classAbstractPullBufferCaptureDevice
-
getDeviceID
public static String getDeviceID(javax.media.MediaLocator locator)
Gets the device index of a PortAudio device from a specific MediaLocator identifying it.- Parameters:
locator- the MediaLocator identifying the device index of a PortAudio device to get- Returns:
- the device index of a PortAudio device identified by locator
-
getSupportedFormats
protected javax.media.Format[] getSupportedFormats(int streamIndex)
Gets the Formats which are to be reported by a FormatControl as supported formats for a PullBufferStream at a specific zero-based index in the list of streams of this PullBufferDataSource.- Overrides:
getSupportedFormatsin classAbstractPullBufferCaptureDevice- Parameters:
streamIndex- the zero-based index of the PullBufferStream for which the specified FormatControl is to report the list of supported Formats- Returns:
- an array of Formats to be reported by a FormatControl as the supported formats for the PullBufferStream at the specified streamIndex in the list of streams of this PullBufferDataSource
- See Also:
AbstractPullBufferCaptureDevice.getSupportedFormats(int)
-
-