javax.media.rtp
Class RTPPushDataSource

java.lang.Object
  |
  +--javax.media.protocol.DataSource
        |
        +--javax.media.protocol.PushDataSource
              |
              +--javax.media.rtp.RTPPushDataSource
Direct Known Subclasses:
RTPSocket

public class RTPPushDataSource
extends PushDataSource

This is an abstraction for a RTP data handler. The source allows the underlying network/transport protocol to be abstracted from the RTP handler. The source is a TWO WAY datasource in that it has an output data stream (PushSourceStream) as well as an input data stream (OutputDataStream). RTPDataSocket extends javax.media.protocol.DataSource. Data flowing out of or in to this source is a stream of bytes in the form of a RTP packet and does not contain any information dependant on the network/transport protocol that will be used to transmit these bytes. Note: an RTPPushDataSource can either handle the DataChannel of an RTP session or the control channel of an RTP session. An RTPPushDataSource that handles the data channel of an RTP session must implement the interface defined in javax.media.rtp.DataChannel.

See Also:
DataChannel

Constructor Summary
RTPPushDataSource()
           
 
Method Summary
 void connect()
          Set the boolean to true and dont do anything else in connect for now
 void disconnect()
          Set the boolean to false and dont do anything else in connect for now
 java.lang.String getContentType()
          Implementation of javax.media.protocol.DataSource.getContentType()
 java.lang.Object getControl(java.lang.String controlName)
          Returns null because no controls are implemented.
 java.lang.Object[] getControls()
          Returns an zero length array because no controls are supported.
 Time getDuration()
          Returns null since the duration of the streams of this datasource are not known
 OutputDataStream getInputStream()
          Method to retrieve the input stream of this two way data source
 PushSourceStream getOutputStream()
          Method to retrive the output stream of this two way data source
 PushSourceStream[] getStreams()
          Get the collection of streams that this source manages.
protected  void initCheck()
          This two way data source does not have any medialocator and datasource will throw an Uninitialized DataSource error incase initCheck() is called on this datasource.
 boolean isStarted()
          Method to find out if the source had been started
 void setChild(DataSource source)
           
 void setContentType(java.lang.String contentType)
          Method used to set the content type of this two way data source
 void setInputStream(OutputDataStream inputstream)
          Method to set the input stream of this two way data source
 void setOutputStream(PushSourceStream outputstream)
          Method to set the output stream of this two way data source
 void start()
          Initiates data-transfer.
 void stop()
          Stops data-transfer.
 
Methods inherited from class javax.media.protocol.DataSource
getLocator, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPPushDataSource

public RTPPushDataSource()
Method Detail

setChild

public void setChild(DataSource source)

getOutputStream

public PushSourceStream getOutputStream()
Method to retrive the output stream of this two way data source

getInputStream

public OutputDataStream getInputStream()
Method to retrieve the input stream of this two way data source

setOutputStream

public void setOutputStream(PushSourceStream outputstream)
Method to set the output stream of this two way data source

setInputStream

public void setInputStream(OutputDataStream inputstream)
Method to set the input stream of this two way data source

getContentType

public java.lang.String getContentType()
Implementation of javax.media.protocol.DataSource.getContentType()
Overrides:
getContentType in class DataSource
Tags copied from class: DataSource
Returns:
The name that describes the media content.

setContentType

public void setContentType(java.lang.String contentType)
Method used to set the content type of this two way data source

connect

public void connect()
             throws java.io.IOException
Set the boolean to true and dont do anything else in connect for now
Overrides:
connect in class DataSource
Tags copied from class: DataSource
Throws:
java.io.IOException - Thrown if there are IO problems when connect is called.

disconnect

public void disconnect()
Set the boolean to false and dont do anything else in connect for now
Overrides:
disconnect in class DataSource

initCheck

protected void initCheck()
This two way data source does not have any medialocator and datasource will throw an Uninitialized DataSource error incase initCheck() is called on this datasource. So, here this method is overrident to esnure that no errors are thrown and in the absence of a MediaLocator, nothing is done for now
Overrides:
initCheck in class DataSource

start

public void start()
           throws java.io.IOException
Initiates data-transfer. Start must be called before data is available. Connect must be called before start.
Overrides:
start in class DataSource
Throws:
java.io.IOException - thrown if the source has IO trouble at startup time.

stop

public void stop()
          throws java.io.IOException
Stops data-transfer. If the source has not already been connected and started, stop does nothing.
Overrides:
stop in class DataSource

isStarted

public boolean isStarted()
Method to find out if the source had been started

getControls

public java.lang.Object[] getControls()
Returns an zero length array because no controls are supported.
Returns:
a zero length Object array.

getControl

public java.lang.Object getControl(java.lang.String controlName)
Returns null because no controls are implemented.
Returns:
null.

getDuration

public Time getDuration()
Returns null since the duration of the streams of this datasource are not known
Tags copied from interface: Duration
Returns:
A Time object representing the duration or DURATION_UNKNOWN.

getStreams

public PushSourceStream[] getStreams()
Description copied from class: PushDataSource
Get the collection of streams that this source manages. The collection of streams is entirely content dependent. The ContentDescriptor of this DataSource provides the only indication of what streams can be available on this connection.
Overrides:
getStreams in class PushDataSource
Tags copied from class: PushDataSource
Returns:
The collection of streams for this source.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.