public class RewritablePullBufferDataSource extends PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource> implements MuteDataSource, InbandDTMFDataSource
Because the class wouldn't work for our use case without it, CaptureDevice is implemented and is being delegated to the wrapped DataSource (if it supports the interface in question).
dataSource
captureDevice, EMPTY_STREAMS
Constructor and Description |
---|
RewritablePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)
Initializes a new RewritablePullBufferDataSource instance which
is to provide mute support for a specific PullBufferDataSource.
|
Modifier and Type | Method and Description |
---|---|
void |
addDTMF(DTMFInbandTone tone)
Adds a new inband DTMF tone to send.
|
java.lang.Object |
getControl(java.lang.String controlType)
Implements
DataSource.getControl(String) . |
javax.media.protocol.PullBufferStream[] |
getStreams()
Implements
PullBufferDataSource.getStreams() . |
javax.media.protocol.PullBufferDataSource |
getWrappedDataSource()
Get wrapped DataSource.
|
boolean |
isMute()
Determines whether this DataSource is mute.
|
boolean |
isSendingDTMF()
Determines whether this DataSource sends a DTMF tone.
|
void |
setMute(boolean mute)
Sets the mute state of this DataSource.
|
connect, disconnect, getContentType, getControls, getDataSource, getDuration, getLocator, start, stop
getCaptureDeviceInfo, getFormatControls
public RewritablePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)
dataSource
- the PullBufferDataSource the new instance is
to provide mute support forpublic void setMute(boolean mute)
setMute
in interface MuteDataSource
mute
- true to mute this DataSource; otherwise,
falsepublic boolean isMute()
isMute
in interface MuteDataSource
public void addDTMF(DTMFInbandTone tone)
addDTMF
in interface InbandDTMFDataSource
tone
- the DTMF tone to send.public boolean isSendingDTMF()
public javax.media.protocol.PullBufferDataSource getWrappedDataSource()
public java.lang.Object getControl(java.lang.String controlType)
DataSource.getControl(String)
. Delegates to the
wrapped DataSource. Overrides
CaptureDeviceDelegatePullBufferDataSource.getControl(String)
because the wrapped DataSource may not be a
CaptureDevice yet it still needs to give access to the control.
Overrides the super implementation to include the type hierarchy of the
very wrapped dataSource instance into the search for the
specified controlType.getControl
in interface javax.media.Controls
getControl
in class PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
controlType
- a String value which names the type of the
control to be retrievedpublic javax.media.protocol.PullBufferStream[] getStreams()
PullBufferDataSource.getStreams()
. Wraps the streams
of the wrapped PullBufferDataSource into
MutePullBufferStream instances in order to provide mute support
to them.getStreams
in class PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.