Package org.jitsi.impl.neomedia.protocol
Class RewritablePullBufferDataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PullBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
-
- org.jitsi.impl.neomedia.protocol.PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
-
- org.jitsi.impl.neomedia.protocol.RewritablePullBufferDataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls,InbandDTMFDataSource,MuteDataSource
public class RewritablePullBufferDataSource extends PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource> implements MuteDataSource, InbandDTMFDataSource
Implements a PullBufferDataSource wrapper which provides mute support for the wrapped instance.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).
- Author:
- Damian Minkov, Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.PullBufferDataSourceDelegate
dataSource
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
captureDevice, EMPTY_STREAMS
-
-
Constructor Summary
Constructors Constructor Description RewritablePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)Initializes a new RewritablePullBufferDataSource instance which is to provide mute support for a specific PullBufferDataSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDTMF(DTMFInbandTone tone)Adds a new inband DTMF tone to send.ObjectgetControl(String controlType)ImplementsControls.getControl(String).javax.media.protocol.PullBufferStream[]getStreams()ImplementsPullBufferDataSource.getStreams().javax.media.protocol.PullBufferDataSourcegetWrappedDataSource()Get wrapped DataSource.booleanisMute()Determines whether this DataSource is mute.booleanisSendingDTMF()Determines whether this DataSource sends a DTMF tone.voidsetMute(boolean mute)Sets the mute state of this DataSource.-
Methods inherited from class org.jitsi.impl.neomedia.protocol.PullBufferDataSourceDelegate
connect, disconnect, getContentType, getControls, getDataSource, getDuration, getLocator, start, stop
-
Methods inherited from class org.jitsi.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
getCaptureDeviceInfo, getFormatControls
-
-
-
-
Constructor Detail
-
RewritablePullBufferDataSource
public RewritablePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)
Initializes a new RewritablePullBufferDataSource instance which is to provide mute support for a specific PullBufferDataSource.- Parameters:
dataSource- the PullBufferDataSource the new instance is to provide mute support for
-
-
Method Detail
-
setMute
public void setMute(boolean mute)
Sets the mute state of this DataSource.- Specified by:
setMutein interfaceMuteDataSource- Parameters:
mute- true to mute this DataSource; otherwise, false
-
isMute
public boolean isMute()
Determines whether this DataSource is mute.- Specified by:
isMutein interfaceMuteDataSource- Returns:
- true if this DataSource is mute; otherwise, false
-
addDTMF
public void addDTMF(DTMFInbandTone tone)
Adds a new inband DTMF tone to send.- Specified by:
addDTMFin interfaceInbandDTMFDataSource- Parameters:
tone- the DTMF tone to send.
-
isSendingDTMF
public boolean isSendingDTMF()
Determines whether this DataSource sends a DTMF tone.- Returns:
- true if this DataSource is sending a DTMF tone; otherwise, false.
-
getWrappedDataSource
public javax.media.protocol.PullBufferDataSource getWrappedDataSource()
Get wrapped DataSource.- Returns:
- wrapped DataSource
-
getControl
public Object getControl(String controlType)
ImplementsControls.getControl(String). Delegates to the wrapped DataSource. OverridesCaptureDeviceDelegatePullBufferDataSource.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.- Specified by:
getControlin interfacejavax.media.Controls- Overrides:
getControlin classPullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>- Parameters:
controlType- a String value which names the type of the control to be retrieved- Returns:
- an Object which represents the control of the requested controlType of the wrapped DataSource
-
getStreams
public javax.media.protocol.PullBufferStream[] getStreams()
ImplementsPullBufferDataSource.getStreams(). Wraps the streams of the wrapped PullBufferDataSource into MutePullBufferStream instances in order to provide mute support to them.- Specified by:
getStreamsin classPullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>- Returns:
- an array of PullBufferStream instances with enabled mute support
-
-