Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.quicktime
Class QuickTimeStream

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.AbstractPushBufferStream
              extended by net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.quicktime.QuickTimeStream
All Implemented Interfaces:
javax.media.Controls, javax.media.protocol.PushBufferStream, javax.media.protocol.SourceStream

public class QuickTimeStream
extends AbstractPushBufferStream

Implements a PushBufferStream using QuickTime/QTKit.

Author:
Lyubomir Marinov

Field Summary
(package private)  QTCaptureDecompressedVideoOutput captureOutput
          The QTCaptureOutput represented by this SourceStream.
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractPushBufferStream
transferHandler
 
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
QuickTimeStream(DataSource dataSource, javax.media.control.FormatControl formatControl)
          Initializes a new QuickTimeStream instance which is to have its Format-related information abstracted by a specific FormatControl.
 
Method Summary
 void close()
          Releases the resources used by this instance throughout its existence and makes it available for garbage collection.
protected  javax.media.Format doGetFormat()
          Gets the Format of this PushBufferStream as directly known by it.
 float getFrameRate()
          Gets the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream.
 void read(javax.media.Buffer buffer)
          Reads media data from this PushBufferStream into a specific Buffer without blocking.
 float setFrameRate(float frameRate)
          Sets the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream.
 void start()
          Starts the transfer of media data from this PushBufferStream.
 void stop()
          Stops the transfer of media data from this PushBufferStream.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractPushBufferStream
setTransferHandler
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.AbstractBufferStream
doSetFormat, endOfStream, getContentDescriptor, getContentLength, getControls, getFormat
 
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.PushBufferStream
getFormat
 
Methods inherited from interface javax.media.protocol.SourceStream
endOfStream, getContentDescriptor, getContentLength
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Field Detail

captureOutput

final QTCaptureDecompressedVideoOutput captureOutput
The QTCaptureOutput represented by this SourceStream.

Constructor Detail

QuickTimeStream

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

Parameters:
dataSource - the DataSource 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

close

public void close()
Releases the resources used by this instance throughout its existence and makes it available for garbage collection. This instance is considered unusable after closing.

Overrides:
close in class AbstractBufferStream
See Also:
AbstractBufferStream.close()

doGetFormat

protected javax.media.Format doGetFormat()
Gets the Format of this PushBufferStream as directly known by it.

Overrides:
doGetFormat in class AbstractBufferStream
Returns:
the Format of this PushBufferStream as directly known by it or null if this PushBufferStream does not directly know its Format and it relies on the PushBufferDataSource which created it to report its Format

getFrameRate

public float getFrameRate()
Gets the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream.

Returns:
the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream

read

public void read(javax.media.Buffer buffer)
          throws IOException
Reads media data from this PushBufferStream into a specific Buffer without blocking.

Parameters:
buffer - the Buffer in which media data is to be read from this PushBufferStream
Throws:
IOException - if anything goes wrong while reading media data from this PushBufferStream into the specified buffer

setFrameRate

public float setFrameRate(float frameRate)
Sets the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream.

Parameters:
frameRate - the output frame rate to be set on the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream
Returns:
the output frame rate of the QTCaptureDecompressedVideoOutput represented by this QuickTimeStream

start

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

Overrides:
start in class AbstractBufferStream
Throws:
IOException - if anything goes wrong while starting the transfer of media data from this PushBufferStream

stop

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

Overrides:
stop in class AbstractBufferStream
Throws:
IOException - if anything goes wrong while stopping the transfer of media data from this PushBufferStream

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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