Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.jmfext.media.protocol
Class AbstractVideoPullBufferStream

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.control.AbstractControls
      extended by net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractBufferStream
          extended by net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractPullBufferStream
              extended by net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractVideoPullBufferStream
All Implemented Interfaces:
javax.media.Controls, javax.media.protocol.PullBufferStream, javax.media.protocol.SourceStream
Direct Known Subclasses:
ImageStream, Video4Linux2Stream

public abstract class AbstractVideoPullBufferStream
extends AbstractPullBufferStream

Provides a base implementation of PullBufferStream for video in order to facilitate implementers by taking care of boilerplate in the most common cases.

Author:
Lyubomir Marinov

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractBufferStream
dataSource, formatControl
 
Fields inherited from interface javax.media.protocol.SourceStream
LENGTH_UNKNOWN
 
Constructor Summary
protected AbstractVideoPullBufferStream(javax.media.protocol.PullBufferDataSource dataSource, javax.media.control.FormatControl formatControl)
          Initializes a new AbstractVideoPullBufferStream instance which is to have its Format-related information abstracted by a specific FormatControl.
 
Method Summary
protected abstract  void doRead(javax.media.Buffer buffer)
          Blocks and reads into a Buffer from this PullBufferStream.
 void read(javax.media.Buffer buffer)
          Blocks and reads into a Buffer from this PullBufferStream.
 void start()
          Starts the transfer of media data from this AbstractBufferStream.
 void stop()
          Stops the transfer of media data from this AbstractBufferStream.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractPullBufferStream
willReadBlock
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractBufferStream
close, doGetFormat, doSetFormat, endOfStream, getContentDescriptor, getContentLength, getControls, getFormat, internalGetFormat, internalSetFormat
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.control.AbstractControls
getControl, getControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.protocol.PullBufferStream
getFormat
 
Methods inherited from interface javax.media.protocol.SourceStream
endOfStream, getContentDescriptor, getContentLength
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Constructor Detail

AbstractVideoPullBufferStream

protected AbstractVideoPullBufferStream(javax.media.protocol.PullBufferDataSource dataSource,
                                        javax.media.control.FormatControl formatControl)
Initializes a new AbstractVideoPullBufferStream instance which is to have its Format-related information abstracted by a specific FormatControl.

Parameters:
dataSource - the PullBufferDataSource which is creating the new instance so that it becomes one of its streams
formatControl - the FormatControl which is to abstract the Format-related information of the new instance
Method Detail

doRead

protected abstract void doRead(javax.media.Buffer buffer)
                        throws IOException
Blocks and reads into a Buffer from this PullBufferStream.

Parameters:
buffer - the Buffer this PullBufferStream is to read into
Throws:
IOException - if an I/O error occurs while this PullBufferStream reads into the specified Buffer

read

public void read(javax.media.Buffer buffer)
          throws IOException
Blocks and reads into a Buffer from this PullBufferStream.

Parameters:
buffer - the Buffer this PullBufferStream is to read into
Throws:
IOException - if an I/O error occurs while this PullBufferStream reads into the specified Buffer

start

public void start()
           throws IOException
Starts the transfer of media data from this AbstractBufferStream.

Overrides:
start in class AbstractBufferStream
Throws:
IOException - if anything goes wrong while starting the transfer of media data from this AbstractBufferStream
See Also:
AbstractBufferStream.start()

stop

public void stop()
          throws IOException
Stops the transfer of media data from this AbstractBufferStream.

Overrides:
stop in class AbstractBufferStream
Throws:
IOException - if anything goes wrong while stopping the transfer of media data from this AbstractBufferStream
See Also:
AbstractBufferStream.stop()

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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