Class DataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- javax.media.protocol.PushBufferDataSource
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.AbstractPushBufferCaptureDevice
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.AbstractVideoPushBufferCaptureDevice
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.quicktime.DataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.CaptureDevice,javax.media.protocol.Controls
public class DataSource extends AbstractVideoPushBufferCaptureDevice
Implements a PushBufferDataSource and CaptureDevice using QuickTime/QTKit.- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description DataSource()Initializes a new DataSource instance.DataSource(javax.media.MediaLocator locator)Initializes a new DataSource instance from a specific MediaLocator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.media.control.FrameRateControlcreateFrameRateControl()OverridesAbstractVideoPushBufferCaptureDevice.createFrameRateControl()to provide a FrameRateControl which gets and sets the frame rate of the QTCaptureDecompressedVideoOutput represented by the QuickTimeStream made available by this DataSource.protected QuickTimeStreamcreateStream(int streamIndex, javax.media.control.FormatControl formatControl)Creates a new PushBufferStream which is to be at a specific zero-based index in the list of streams of this PushBufferDataSource.protected voiddoConnect()Opens a connection to the media source specified by the MediaLocator of this DataSource.protected voiddoDisconnect()Closes the connection to the media source specified by the MediaLocator of this DataSource.protected voiddoStart()Starts the transfer of media data from this DataSource.protected voiddoStop()Stops the transfer of media data from this DataSource.protected javax.media.Format[]getSupportedFormats(int streamIndex)Gets the Formats which are to be reported by a FormatControl as supported formats for a PushBufferStream at a specific zero-based index in the list of streams of this PushBufferDataSource.protected javax.media.FormatsetFormat(int streamIndex, javax.media.Format oldValue, javax.media.Format newValue)Attempts to set the Format to be reported by the FormatControl of a PushBufferStream at a specific zero-based index in the list of streams of this PushBufferDataSource.voidsetLocator(javax.media.MediaLocator locator)Sets the MediaLocator which specifies the media source of this DataSource.-
Methods inherited from class org.jitsi.impl.neomedia.jmfext.media.protocol.AbstractPushBufferCaptureDevice
connect, disconnect, getCaptureDeviceInfo, getContentType, getControl, getControls, getDuration, getFormat, getFormatControls, getStreams, getStreamSyncRoot, start, stop, streams
-
-
-
-
Method Detail
-
createFrameRateControl
protected javax.media.control.FrameRateControl createFrameRateControl()
OverridesAbstractVideoPushBufferCaptureDevice.createFrameRateControl()to provide a FrameRateControl which gets and sets the frame rate of the QTCaptureDecompressedVideoOutput represented by the QuickTimeStream made available by this DataSource. Creates a new FrameRateControl instance which is to allow the getting and setting of the frame rate of this AbstractVideoPushBufferCaptureDevice.- Overrides:
createFrameRateControlin classAbstractVideoPushBufferCaptureDevice- Returns:
- a new FrameRateControl instance which is to allow the getting and setting of the frame rate of this AbstractVideoPushBufferCaptureDevice
- See Also:
AbstractVideoPushBufferCaptureDevice.createFrameRateControl()
-
createStream
protected QuickTimeStream createStream(int streamIndex, javax.media.control.FormatControl formatControl)
Creates a new PushBufferStream which is to be at a specific zero-based index in the list of streams of this PushBufferDataSource. The Format-related information of the new instance is to be abstracted by a specific FormatControl.- Specified by:
createStreamin classAbstractPushBufferCaptureDevice- Parameters:
streamIndex- the zero-based index of the PushBufferStream in the list of streams of this PushBufferDataSourceformatControl- the FormatControl which is to abstract the Format-related information of the new instance- Returns:
- a new PushBufferStream which is to be at the specified streamIndex in the list of streams of this PushBufferDataSource and which has its Format-related information abstracted by the specified formatControl
- See Also:
AbstractPushBufferCaptureDevice.createStream(int, FormatControl)
-
doConnect
protected void doConnect() throws IOExceptionOpens a connection to the media source specified by the MediaLocator of this DataSource.- Overrides:
doConnectin classAbstractPushBufferCaptureDevice- Throws:
IOException- if anything goes wrong while opening the connection to the media source specified by the MediaLocator of this DataSource- See Also:
AbstractPushBufferCaptureDevice.doConnect()
-
doDisconnect
protected void doDisconnect()
Closes the connection to the media source specified by the MediaLocator of this DataSource.- Overrides:
doDisconnectin classAbstractPushBufferCaptureDevice- See Also:
AbstractPushBufferCaptureDevice.doDisconnect()
-
doStart
protected void doStart() throws IOExceptionStarts the transfer of media data from this DataSource.- Overrides:
doStartin classAbstractPushBufferCaptureDevice- Throws:
IOException- if anything goes wrong while starting the transfer of media data from this DataSource- See Also:
AbstractPushBufferCaptureDevice.doStart()
-
doStop
protected void doStop() throws IOExceptionStops the transfer of media data from this DataSource.- Overrides:
doStopin classAbstractPushBufferCaptureDevice- Throws:
IOException- if anything goes wrong while stopping the transfer of media data from this DataSource- See Also:
AbstractPushBufferCaptureDevice.doStop()
-
getSupportedFormats
protected javax.media.Format[] getSupportedFormats(int streamIndex)
Gets the Formats which are to be reported by a FormatControl as supported formats for a PushBufferStream at a specific zero-based index in the list of streams of this PushBufferDataSource.- Overrides:
getSupportedFormatsin classAbstractPushBufferCaptureDevice- Parameters:
streamIndex- the zero-based index of the PushBufferStream for which the specified FormatControl is to report the list of supported Formats- Returns:
- an array of Formats to be reported by a FormatControl as the supported formats for the PushBufferStream at the specified streamIndex in the list of streams of this PushBufferDataSource
- See Also:
AbstractPushBufferCaptureDevice.getSupportedFormats(int)
-
setFormat
protected javax.media.Format setFormat(int streamIndex, javax.media.Format oldValue, javax.media.Format newValue)Attempts to set the Format to be reported by the FormatControl of a PushBufferStream at a specific zero-based index in the list of streams of this PushBufferDataSource. The PushBufferStream does not exist at the time of the attempt to set its Format.- Overrides:
setFormatin classAbstractPushBufferCaptureDevice- Parameters:
streamIndex- the zero-based index of the PushBufferStream the Format of which is to be setoldValue- the last-known Format for the PushBufferStream at the specified streamIndexnewValue- the Format which is to be set- Returns:
- the Format to be reported by the FormatControl of the PushBufferStream at the specified streamIndex in the list of streams of this PushBufferStream or null if the attempt to set the Format did not success and any last-known Format is to be left in effect
- See Also:
AbstractPushBufferCaptureDevice.setFormat(int, Format, Format)
-
setLocator
public void setLocator(javax.media.MediaLocator locator)
Sets the MediaLocator which specifies the media source of this DataSource.- Overrides:
setLocatorin classjavax.media.protocol.DataSource- Parameters:
locator- the MediaLocator which specifies the media source of this DataSource- See Also:
DataSource.setLocator(MediaLocator)
-
-