public class WASAPIStream extends AbstractPushBufferStream<DataSource>
PUSH_BUFFER_STREAM_CLASS_NAME, transferHandler
dataSource, formatControl
Constructor and Description |
---|
WASAPIStream(DataSource dataSource,
javax.media.control.FormatControl formatControl)
Initializes a new WASAPIStream instance which is to have its
Format-related information abstracted by a specific
FormatControl.
|
Modifier and Type | Method and Description |
---|---|
protected javax.media.Format |
doGetFormat()
Gets the Format of this AbstractBufferStream as
directly known by it.
|
javax.media.Format |
getFormat()
Gets the Format of the media data made available by this
AbstractBufferStream.
|
void |
read(javax.media.Buffer buffer)
|
(package private) void |
setLocator(javax.media.MediaLocator locator)
Sets the MediaLocator of this instance which identifies the
audio endpoint device this SourceStream is to capture data from.
|
void |
start()
Starts the transfer of media data from this
AbstractBufferStream.
|
void |
stop()
Stops the transfer of media data from this AbstractBufferStream.
|
(package private) static void |
throwNewIOException(java.lang.String message,
HResultException hre)
Throws a new IOException instance initialized with a specific
String message and a specific HResultException cause.
|
setTransferHandler
close, doSetFormat, endOfStream, getContentDescriptor, getContentLength, getControls
getControl, getControl, queryInterface, queryInterface
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public WASAPIStream(DataSource dataSource, javax.media.control.FormatControl formatControl)
dataSource
- the DataSource which is initializing the new
instance so that it becomes one of its streamsformatControl
- the FormatControl which is to abstract the
Format-related information of the new instancestatic void throwNewIOException(java.lang.String message, HResultException hre) throws java.io.IOException
message
- the message to initialize the new IOException
instance withhre
- an HResultException which is to be set as the
cause of the new IOException instancejava.io.IOException
protected javax.media.Format doGetFormat()
doGetFormat
in class AbstractBufferStream<DataSource>
public javax.media.Format getFormat()
stop()
. The stop() method is generally invoked with a
certain synchronization root locked, the implementation of
WASAPIStream waits for processThread
to quit but
processThread indirectly invokes
AbstractBufferStream.getFormat()
which in turn results in an
attempt to lock the mentioned synchronization root i.e. the thread
invoking the stop() method and processThread fall into
a deadlock.getFormat
in interface javax.media.protocol.PushBufferStream
getFormat
in class AbstractBufferStream<DataSource>
public void read(javax.media.Buffer buffer) throws java.io.IOException
resampler
is non-null, uses it to resample the media
data read from capture
or processed
into
format
.java.io.IOException
void setLocator(javax.media.MediaLocator locator) throws java.io.IOException
locator
- a MediaLocator which identifies the audio
endpoint device this SourceStream is to capture data fromjava.io.IOException
- if anything goes wrong while setting the specified
locator on this instancepublic void start() throws java.io.IOException
start
in class AbstractBufferStream<DataSource>
java.io.IOException
- if anything goes wrong while starting the transfer of
media data from this AbstractBufferStreampublic void stop() throws java.io.IOException
stop
in class AbstractBufferStream<DataSource>
java.io.IOException
- if anything goes wrong while stopping the transfer of
media data from this AbstractBufferStream
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.