public abstract class AbstractPushBufferCaptureDevice
extends javax.media.protocol.PushBufferDataSource
implements javax.media.protocol.CaptureDevice
Modifier | Constructor and Description |
---|---|
protected |
AbstractPushBufferCaptureDevice()
Initializes a new AbstractPushBufferCaptureDevice instance.
|
protected |
AbstractPushBufferCaptureDevice(javax.media.MediaLocator locator)
Initializes a new AbstractPushBufferCaptureDevice 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
AbstractPushBufferCaptureDevice.
|
protected abstract AbstractPushBufferStream<?> |
createStream(int streamIndex,
javax.media.control.FormatControl formatControl)
Create a new PushBufferStream which is to be at a specific
zero-based index in the list of streams of this
PushBufferDataSource.
|
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
DataSource.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 PushBufferStream at a specific zero-based index in the list of
streams of this PushBufferDataSource.
|
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.PushBufferStream[] |
getStreams()
Gets the PushBufferStreams through which this
PushBufferDataSource 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
PushBufferStream at a specific zero-based index in the list of
streams of this PushBufferDataSource.
|
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.
|
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 AbstractPushBufferCaptureDevice()
protected AbstractPushBufferCaptureDevice(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 AbstractPushBufferStream<?> createStream(int streamIndex, javax.media.control.FormatControl formatControl)
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 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()
DataSource.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 PushBufferStream
the Format of which is to be retrievedoldValue
- the last-known Format for the
PushBufferStream 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.PushBufferStream[] getStreams()
getStreams
in class javax.media.protocol.PushBufferDataSource
protected javax.media.Format[] getSupportedFormats(int streamIndex)
streamIndex
- the zero-based index of the PushBufferStream
for which the specified FormatControl is to report the list of
supported Formatsprotected javax.media.Format setFormat(int streamIndex, javax.media.Format oldValue, javax.media.Format newValue)
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 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.