Package org.jitsi.impl.neomedia.protocol
Class TranscodingDataSource
- java.lang.Object
-
- javax.media.protocol.DataSource
-
- org.jitsi.impl.neomedia.protocol.TranscodingDataSource
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.Duration,javax.media.protocol.Controls
public class TranscodingDataSource extends javax.media.protocol.DataSourceRepresents a DataSource which transcodes the tracks of a specific input DataSource into a specific output Format. The transcoding is attempted only for tracks which actually support it for the specified output Format.- Author:
- Lubomir Marinov
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()ImplementsDataSource.connect().voiddisconnect()ImplementsDataSource.disconnect().StringgetContentType()ImplementsDataSource.getContentType().ObjectgetControl(String controlType)ImplementsControls.getControl(String).Object[]getControls()ImplementsControls.getControls().javax.media.TimegetDuration()ImplementsDuration.getDuration().javax.media.protocol.SourceStream[]getStreams()Gets the output streams that this instance provides.javax.media.ProcessorgetTranscodingProcessor()Returns this instance's Processor objectvoidstart()ImplementsDataSource.start().voidstop()ImplementsDataSource.stop().
-
-
-
Constructor Detail
-
TranscodingDataSource
public 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.- Parameters:
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 inputDataSource
-
-
Method Detail
-
connect
public void connect() throws IOExceptionImplementsDataSource.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.- Specified by:
connectin classjavax.media.protocol.DataSource- Throws:
IOException- if creating the transcoding Processor, setting its Format or connecting to it fails
-
disconnect
public void disconnect()
ImplementsDataSource.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.- Specified by:
disconnectin classjavax.media.protocol.DataSource
-
getContentType
public String getContentType()
ImplementsDataSource.getContentType(). Delegates to the actual output of the transcoding.- Specified by:
getContentTypein classjavax.media.protocol.DataSource- Returns:
- a String value which describes the type of the content made available by this DataSource
-
getControl
public Object getControl(String controlType)
ImplementsControls.getControl(String). Delegates to the actual output of the transcoding.- Parameters:
controlType- a String value which names the type of the control to be retrieved- Returns:
- an Object which represents the control of this instance with the specified type if such a control is available; otherwise, null
-
getControls
public Object[] getControls()
ImplementsControls.getControls(). Delegates to the actual output of the transcoding.- Returns:
- an array of Objects which represent the controls available for this instance
-
getDuration
public javax.media.Time getDuration()
ImplementsDuration.getDuration(). Delegates to the actual output of the transcoding.- Returns:
- a Time value which describes the duration of the content made available by this instance
-
getStreams
public javax.media.protocol.SourceStream[] getStreams()
Gets the output streams that this instance provides. Some of them may be the result of transcoding the tracks of the input DataSource of this instance in the output Format of this instance.- Returns:
- an array of SourceStreams which represents the collection of output streams that this instance provides
-
start
public void start() throws IOExceptionImplementsDataSource.start(). Starts the actual transcoding process already set up withconnect().- Specified by:
startin classjavax.media.protocol.DataSource- Throws:
IOException- if starting the transcoding fails
-
stop
public void stop() throws IOExceptionImplementsDataSource.stop(). Stops the actual transcoding process if it has already been set up withconnect().- Specified by:
stopin classjavax.media.protocol.DataSource- Throws:
IOException- if stopping the transcoding fails
-
getTranscodingProcessor
public javax.media.Processor getTranscodingProcessor()
Returns this instance's Processor object- Returns:
- this instance's Processor object
-
-