Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PushBufferDataSource
          extended by net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
              extended by net.java.sip.communicator.impl.neomedia.protocol.PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
                  extended by net.java.sip.communicator.impl.neomedia.protocol.PushBufferDataSourceAdapter
All Implemented Interfaces:
javax.media.Controls, javax.media.Duration, javax.media.protocol.CaptureDevice

public class PushBufferDataSourceAdapter
extends PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>

Implements PushBufferDataSource for a specific PullBufferDataSource.

Author:
Lubomir Marinov

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.protocol.PushBufferDataSourceDelegate
dataSource
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
captureDevice, EMPTY_STREAMS
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
PushBufferDataSourceAdapter(javax.media.protocol.PullBufferDataSource dataSource)
          Initializes a new PushBufferDataSourceAdapter which is to implement PushBufferDataSource capabilities for a specific PullBufferDataSource.
 
Method Summary
 void disconnect()
          Implements DataSource.disconnect().
 javax.media.protocol.PushBufferStream[] getStreams()
          Implements PushBufferDataSource.getStreams().
 void start()
          Implements DataSource.start().
 void stop()
          Implements DataSource.start().
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.protocol.PushBufferDataSourceDelegate
connect, getContentType, getControl, getControls, getDataSource, getDuration, getLocator
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.protocol.CaptureDeviceDelegatePushBufferDataSource
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

PushBufferDataSourceAdapter

public PushBufferDataSourceAdapter(javax.media.protocol.PullBufferDataSource dataSource)
Initializes a new PushBufferDataSourceAdapter which is to implement PushBufferDataSource capabilities for a specific PullBufferDataSource.

Parameters:
dataSource - the PullBufferDataSource the new instance is to implement PushBufferDataSource capabilities for
Method Detail

disconnect

public void disconnect()
Implements DataSource.disconnect(). Disposes of the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.

Specified by:
disconnect in interface javax.media.protocol.CaptureDevice
Overrides:
disconnect in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>

start

public void start()
           throws IOException
Implements DataSource.start(). Starts the wrapped PullBufferDataSource and the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.

Specified by:
start in interface javax.media.protocol.CaptureDevice
Overrides:
start in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
Throws:
IOException - if anything wrong happens while starting the wrapped PullBufferDataSource or the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance

stop

public void stop()
          throws IOException
Implements DataSource.start(). Stops the wrapped PullBufferDataSource and the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance.

Specified by:
stop in interface javax.media.protocol.CaptureDevice
Overrides:
stop in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
Throws:
IOException - if anything wrong happens while stopping the wrapped PullBufferDataSource or the pushing from the PushBufferStreamAdapters which wrap the PullBufferStreams of the PullBufferDataSource wrapped by this instance

getStreams

public javax.media.protocol.PushBufferStream[] getStreams()
Implements PushBufferDataSource.getStreams(). Gets the PushBufferStreams through which this PushBufferDataSource gives access to its media data.

Specified by:
getStreams in class PushBufferDataSourceDelegate<javax.media.protocol.PullBufferDataSource>
Returns:
an array of PushBufferStreams through which this PushBufferDataSource gives access to its media data

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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