public class TranscodingDataSource
extends javax.media.protocol.DataSource
Constructor and Description |
---|
TranscodingDataSource(javax.media.protocol.DataSource inputDataSource,
javax.media.Format outputFormat)
Initializes a new TranscodingDataSource instance to transcode
the tracks of a specific DataSource into a specific output
Format.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Implements
DataSource.connect() . |
void |
disconnect()
Implements
DataSource.disconnect() . |
java.lang.String |
getContentType()
Implements
DataSource.getContentType() . |
java.lang.Object |
getControl(java.lang.String controlType)
Implements
DataSource.getControl(String) . |
java.lang.Object[] |
getControls()
Implements
DataSource.getControls() . |
javax.media.Time |
getDuration()
Implements
DataSource.getDuration() . |
javax.media.protocol.SourceStream[] |
getStreams()
Gets the output streams that this instance provides.
|
javax.media.Processor |
getTranscodingProcessor()
Returns this instance's Processor object
|
void |
start()
Implements
DataSource.start() . |
void |
stop()
Implements
DataSource.stop() . |
public TranscodingDataSource(javax.media.protocol.DataSource inputDataSource, javax.media.Format outputFormat)
inputDataSource
- the DataSource which is to have its
tracks transcoded in a specific output FormatoutputFormat
- the Format in which the new instance is to
transcode the tracks of inputDataSourcepublic void connect() throws java.io.IOException
DataSource.connect()
. Sets up the very transcoding
process and just does not start it i.e. creates a Processor on
the inputDataSource, sets outputFormat on its tracks
(which support a Format compatible with outputFormat)
and connects to its output DataSource.connect
in class javax.media.protocol.DataSource
java.io.IOException
- if creating the transcoding Processor,
setting its Format or connecting to it failspublic void disconnect()
DataSource.disconnect()
. Stops and undoes the whole
setup of the very transcoding process i.e. disconnects from the output
DataSource of the transcodingProcessor and disposes of the
transcodingProcessor.disconnect
in class javax.media.protocol.DataSource
public java.lang.String getContentType()
DataSource.getContentType()
. Delegates to the actual
output of the transcoding.getContentType
in class javax.media.protocol.DataSource
public java.lang.Object getControl(java.lang.String controlType)
DataSource.getControl(String)
. Delegates to the actual
output of the transcoding.getControl
in interface javax.media.Controls
getControl
in class javax.media.protocol.DataSource
controlType
- a String value which names the type of the
control to be retrievedpublic java.lang.Object[] getControls()
DataSource.getControls()
. Delegates to the actual
output of the transcoding.getControls
in interface javax.media.Controls
getControls
in class javax.media.protocol.DataSource
public javax.media.Time getDuration()
DataSource.getDuration()
. Delegates to the actual
output of the transcoding.getDuration
in interface javax.media.Duration
getDuration
in class javax.media.protocol.DataSource
public javax.media.protocol.SourceStream[] getStreams()
public void start() throws java.io.IOException
DataSource.start()
. Starts the actual transcoding
process already set up with connect()
.start
in class javax.media.protocol.DataSource
java.io.IOException
- if starting the transcoding failspublic void stop() throws java.io.IOException
DataSource.stop()
. Stops the actual transcoding
process if it has already been set up with connect()
.stop
in class javax.media.protocol.DataSource
java.io.IOException
- if stopping the transcoding failspublic javax.media.Processor getTranscodingProcessor()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.