Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.protocol
Class MutePullBufferDataSource

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PullBufferDataSource
          extended by net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
              extended by net.java.sip.communicator.impl.neomedia.protocol.PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
                  extended by net.java.sip.communicator.impl.neomedia.protocol.MutePullBufferDataSource
All Implemented Interfaces:
javax.media.Controls, javax.media.Duration, javax.media.protocol.CaptureDevice, MuteDataSource

public class MutePullBufferDataSource
extends PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
implements MuteDataSource

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, Lubomir Marinov

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.protocol.PullBufferDataSourceDelegate
dataSource
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
captureDevice, EMPTY_STREAMS
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
MutePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)
          Initializes a new MutePullBufferDataSource instance which is to provide mute support for a specific PullBufferDataSource.
 
Method Summary
 javax.media.protocol.PullBufferStream[] getStreams()
          Implements PullBufferDataSource.getStreams().
 javax.media.protocol.PullBufferDataSource getWrappedDataSource()
          Get wrapped DataSource.
 boolean isMute()
          Determines whether this DataSource is mute.
 void setMute(boolean mute)
          Sets the mute state of this DataSource.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.protocol.PullBufferDataSourceDelegate
connect, disconnect, getContentType, getControl, getControls, getDataSource, getDuration, getLocator, start, stop
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePullBufferDataSource
getCaptureDeviceInfo, getFormatControls
 
Methods inherited from class javax.media.protocol.DataSource
initCheck, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutePullBufferDataSource

public MutePullBufferDataSource(javax.media.protocol.PullBufferDataSource dataSource)
Initializes a new MutePullBufferDataSource 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:
setMute in interface MuteDataSource
Parameters:
mute - true to mute this DataSource; otherwise, false

isMute

public boolean isMute()
Determines whether this DataSource is mute.

Specified by:
isMute in interface MuteDataSource
Returns:
true if this DataSource is mute; otherwise, false

getWrappedDataSource

public javax.media.protocol.PullBufferDataSource getWrappedDataSource()
Get wrapped DataSource.

Returns:
wrapped DataSource

getStreams

public javax.media.protocol.PullBufferStream[] getStreams()
Implements PullBufferDataSource.getStreams(). Wraps the streams of the wrapped PullBufferDataSource into MutePullBufferStream instances in order to provide mute support to them.

Specified by:
getStreams in class PullBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
Returns:
an array of PullBufferStream instances with enabled mute support

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.