public abstract class AbstractPullBufferCaptureDevice
extends javax.media.protocol.PullBufferDataSource
implements javax.media.protocol.CaptureDevice
Modifier | Constructor and Description |
---|---|
protected |
AbstractPullBufferCaptureDevice()
Initializes a new AbstractPullBufferCaptureDevice instance.
|
protected |
AbstractPullBufferCaptureDevice(javax.media.MediaLocator locator)
Initializes a new AbstractPullBufferCaptureDevice instance from
a specific MediaLocator.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Opens a connection to the media source specified by the
MediaLocator of this DataSource.
|
protected javax.media.control.FrameRateControl |
createFrameRateControl()
Creates a new FrameRateControl instance which is to allow the
getting and setting of the frame rate of this
AbstractPullBufferCaptureDevice.
|
protected abstract AbstractPullBufferStream<?> |
createStream(int streamIndex,
javax.media.control.FormatControl formatControl)
Creates a new PullBufferStream which is to be at a specific
zero-based index in the list of streams of this
PullBufferDataSource.
|
void |
disconnect()
Closes the connection to the media source specified by the
MediaLocator of this DataSource.
|
protected void |
doConnect()
Opens a connection to the media source specified by the
MediaLocator of this DataSource.
|
protected void |
doDisconnect()
Closes the connection to the media source specified by the
MediaLocator of this DataSource.
|
protected void |
doStart()
Starts the transfer of media data from this DataSource.
|
protected void |
doStop()
Stops the transfer of media data from this DataSource.
|
javax.media.CaptureDeviceInfo |
getCaptureDeviceInfo()
Gets the CaptureDeviceInfo of this CaptureDevice which
describes it.
|
java.lang.String |
getContentType()
Gets the content type of the media represented by this instance.
|
java.lang.Object |
getControl(java.lang.String controlType)
Gets the control of the specified type available for this instance.
|
java.lang.Object[] |
getControls()
Implements
Controls.getControls() . |
javax.media.Time |
getDuration()
Gets the duration of the media represented by this instance.
|
protected javax.media.Format |
getFormat(int streamIndex,
javax.media.Format oldValue)
Gets the Format to be reported by the FormatControl of
a PullBufferStream at a specific zero-based index in the list of
streams of this PullBufferDataSource.
|
javax.media.control.FormatControl[] |
getFormatControls()
Gets an array of FormatControl instances each one of which can
be used before
connect() to get and set the capture
Format of each one of the capture streams. |
javax.media.protocol.PullBufferStream[] |
getStreams()
Gets the PullBufferStreams through which this
PullBufferDataSource gives access to its media data.
|
protected java.lang.Object |
getStreamSyncRoot()
Gets the Object which is to synchronize the access to
streams() and its return value. |
protected javax.media.Format[] |
getSupportedFormats(int streamIndex)
Gets the Formats which are to be reported by a
FormatControl as supported formats for a
PullBufferStream at a specific zero-based index in the list of
streams of this PullBufferDataSource.
|
void |
setCaptureDeviceInfo(javax.media.CaptureDeviceInfo deviceInfo)
Sets a specific CaptureDeviceInfo on this
CaptureDevice.
|
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 PullBufferStream at a specific
zero-based index in the list of streams of this
PullBufferDataSource.
|
void |
start()
Starts the transfer of media data from this DataSource
|
void |
stop()
Stops the transfer of media data from this DataSource.
|
protected AbstractBufferStream<?>[] |
streams()
Gets the internal array of AbstractPushBufferStreams through
which this AbstractPushBufferCaptureDevice gives access to its
media data.
|
protected AbstractPullBufferCaptureDevice()
protected AbstractPullBufferCaptureDevice(javax.media.MediaLocator locator)
locator
- the MediaLocator to create the new instance frompublic void connect() throws java.io.IOException
connect
in interface javax.media.protocol.CaptureDevice
connect
in class javax.media.protocol.DataSource
java.io.IOException
- if anything goes wrong while opening the connection
to the media source specified by the MediaLocator of this
DataSourceprotected javax.media.control.FrameRateControl createFrameRateControl()
protected abstract AbstractPullBufferStream<?> createStream(int streamIndex, javax.media.control.FormatControl formatControl)
streamIndex
- the zero-based index of the PullBufferStream
in the list of streams of this PullBufferDataSourceformatControl
- the FormatControl which is to abstract the
Format-related information of the new instancepublic void disconnect()
disconnect
in interface javax.media.protocol.CaptureDevice
disconnect
in class javax.media.protocol.DataSource
protected void doConnect() throws java.io.IOException
java.io.IOException
- if anything goes wrong while opening the connection
to the media source specified by the MediaLocator of this
DataSourceprotected void doDisconnect()
protected void doStart() throws java.io.IOException
java.io.IOException
- if anything goes wrong while starting the transfer of
media data from this DataSourceprotected void doStop() throws java.io.IOException
java.io.IOException
- if anything goes wrong while stopping the transfer of
media data from this DataSourcepublic javax.media.CaptureDeviceInfo getCaptureDeviceInfo()
getCaptureDeviceInfo
in interface javax.media.protocol.CaptureDevice
public java.lang.String getContentType()
ContentDescriptor.RAW
.getContentType
in class javax.media.protocol.DataSource
public java.lang.Object getControl(java.lang.String controlType)
getControl
in interface javax.media.Controls
getControl
in class javax.media.protocol.DataSource
controlType
- the type of the control available for this instance to
be retrievedpublic java.lang.Object[] getControls()
Controls.getControls()
. Gets the controls
available for this instance.getControls
in interface javax.media.Controls
getControls
in class javax.media.protocol.DataSource
public javax.media.Time getDuration()
Duration.DURATION_UNBOUNDED
.getDuration
in interface javax.media.Duration
getDuration
in class javax.media.protocol.DataSource
protected javax.media.Format getFormat(int streamIndex, javax.media.Format oldValue)
streamIndex
- the zero-based index of the PullBufferStream
the Format of which is to be retrievedoldValue
- the last-known Format for the
PullBufferStream at the specified streamIndexpublic javax.media.control.FormatControl[] getFormatControls()
connect()
to get and set the capture
Format of each one of the capture streams.getFormatControls
in interface javax.media.protocol.CaptureDevice
connect()
to get and set the capture
Format of each one of the capture streamsprotected java.lang.Object getStreamSyncRoot()
streams()
and its return value.streams()
and its return valuepublic javax.media.protocol.PullBufferStream[] getStreams()
getStreams
in class javax.media.protocol.PullBufferDataSource
protected javax.media.Format[] getSupportedFormats(int streamIndex)
streamIndex
- the zero-based index of the PullBufferStream
for which the specified FormatControl is to report the list of
supported Formatspublic void setCaptureDeviceInfo(javax.media.CaptureDeviceInfo deviceInfo)
deviceInfo
- the CaptureDeviceInfo on this
CaptureDeviceprotected javax.media.Format setFormat(int streamIndex, javax.media.Format oldValue, javax.media.Format newValue)
streamIndex
- the zero-based index of the PullBufferStream
the Format of which is to be setoldValue
- the last-known Format for the
PullBufferStream at the specified streamIndexnewValue
- the Format which is to be setpublic void start() throws java.io.IOException
start
in interface javax.media.protocol.CaptureDevice
start
in class javax.media.protocol.DataSource
java.io.IOException
- if anything goes wrong while starting the transfer of
media data from this DataSourcepublic void stop() throws java.io.IOException
stop
in interface javax.media.protocol.CaptureDevice
stop
in class javax.media.protocol.DataSource
java.io.IOException
- if anything goes wrong while stopping the transfer of
media data from this DataSourceprotected AbstractBufferStream<?>[] streams()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.