Fields Summary |
---|
PushSourceStream | outputstreamThe output stream of this socket. Implements
javax.media.protocol.PushSourceStream. Data on this stream is
transferrred to the SourceTransferHandler |
OutputDataStream | inputstreamThe input stream of this socket. Data on this stream is sent
out on the wire using the underlying network/transport protocol
Implements javax.media.rtp.OutputDataStream |
String | contentTypeThe content type of this socket. needs to be set by the
creator of this datasocket before a player can be created for
this datasource. |
private boolean | connectedUsed to ensure that DataSource methods like getContentType()
cannot be called till this datasource has been connected. |
private boolean | startedUsed to check if the datasource has been started. This will
initiate data transfer to and from this data source |
DataSource | childsrcThe actual datasource created by the RTPSM and passed to the handler |
private RTPControl | rtpcontrolThe RTPControl interface that is exported by this datasource
and will be used to configure information for this datasource |
Methods Summary |
---|
public void | connect()Set the boolean to true and dont do anything else in connect for now
connected = true;
if (childsrc != null)
childsrc.connect();
|
public void | disconnect()Set the boolean to false and dont do anything else in connect
for now
connected = false;
if (childsrc != null)
childsrc.disconnect();
|
public java.lang.String | getContentType()Implementation of javax.media.protocol.DataSource.getContentType()
if (!connected){
System.err.println("Error: DataSource not connected");
return null;
}
return ContentDescriptor.mimeTypeToPackageName(contentType);
|
public java.lang.Object | getControl(java.lang.String controlName)Returns null because no controls are implemented.
if (controlName.equals("javax.media.rtp.RTPControl"))
return rtpcontrol;
return null;
|
public java.lang.Object[] | getControls()Returns an zero length array because no controls
are supported.
// return a one element array of rtpcontrol object
RTPControl[] controls = new RTPControl[1];
controls[0] = rtpcontrol;
return controls;
|
public javax.media.Time | getDuration()Returns null since the duration of the streams of this
datasource are not known
return null;
|
public javax.media.rtp.OutputDataStream | getInputStream()Method to retrieve the input stream of this two way data source
return inputstream;
|
public javax.media.protocol.PushSourceStream | getOutputStream()Method to retrive the output stream of this two way data source
return outputstream;
|
public javax.media.protocol.PushSourceStream[] | getStreams()
PushSourceStream[] outstream = new PushSourceStream[1];
outstream[0]= outputstream;
return outstream;
|
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
|
public boolean | isStarted()Method to find out if the source had been started
return started;
|
public void | setChild(javax.media.protocol.DataSource source)
childsrc = source;
|
public void | setContentType(java.lang.String contentType)Method used to set the content type of this two way data source
this.contentType = contentType;
|
public void | setInputStream(javax.media.rtp.OutputDataStream inputstream)Method to set the input stream of this two way data source
this.inputstream = inputstream;
|
public void | setOutputStream(javax.media.protocol.PushSourceStream outputstream)Method to set the output stream of this two way data source
this.outputstream = outputstream;
|
public void | start()Initiates data-transfer. Start must be called before
data is available. Connect must be called before start.
if (!connected)
return;
started = true;
if (childsrc != null)
childsrc.start();
|
public void | stop()Stops data-transfer.
If the source has not already been connected and started,
stop does nothing.
if ((!connected) && (!started))
return;
started = false;
if (childsrc != null)
childsrc.stop();
|