@ -8,13 +8,10 @@
import javax.media.* ;
import javax.media.control.* ;
import javax.media.protocol.* ;
import net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.* ;
import net.java.sip.communicator.impl.neomedia.protocol.* ;
import net.sf.fmj.media.protocol.* ;
/ * *
* Implements < tt > CaptureDevice < / tt > and < tt > DataSource < / tt > for the purposes of
* image and desktop streaming .
@ -25,20 +22,13 @@
* /
public class DataSource
extends AbstractVideoPullBufferCaptureDevice
implements MuteDataSource ,
SourceCloneable
implements Controls
{
/ * *
* Stream created .
* /
private ImageStream stream = null ;
/ * *
* The cloneable representation of this DataSource .
* /
private CloneableCaptureDevicePullBufferDataSource cloneableDataSource
= null ;
/ * *
* Initializes a new < tt > DataSource < / tt > instance .
* /
@ -125,44 +115,54 @@ protected AbstractPullBufferStream createStream(
}
/ * *
* Determines whether this < tt > DataSource < / tt > is mute .
*
* An image / desktop sharing does not send any
* sounds . Thus it is always mute ( returns always true ) .
* Implements { @link Controls # getControl ( String ) } . Invokes
* { @link # getControls ( ) } and then looks for a control of the specified type
* in the returned array of controls .
*
* @return < tt > true < / tt > since this < tt > DataSource < / tt > is always mute .
* @param controlType a < tt > String < / tt > value naming the type of the control
* of this instance to be retrieved
* @return an < tt > Object < / tt > which represents the control of this instance
* with the specified type
* /
public boolean isMute ( )
public Object getControl ( String controlType )
{
return true ;
if ( controlType = = this . getClass ( ) . getName ( ) )
{
return this ;
}
else
{
return super . getControl ( controlType ) ;
}
}
/ * *
* Sets the mute state of this < tt > DataSource < / tt > .
* Implements { @link Controls # getControl ( String ) } . Invokes
* { @link # getControls ( ) } and then looks for a control of the specified type
* in the returned array of controls .
*
* Does not change anything , since image /
* desktop sharing does not send any sounds . Thus it is always mute .
*
* @param mute < tt > true < / tt > to mute this < tt > DataSource < / tt > ; otherwise ,
* < tt > false < / tt >
* /
public void setMute ( boolean mute )
{
}
/ * *
* Based on JMF testing , the clone is in the same state as the original
* ( opened and connected if the original is ) , but at the beginning of the
* media , not whatever position the original is .
* @param controlType a < tt > String < / tt > value naming the type of the control
* of this instance to be retrieved
* @return an < tt > Object < / tt > which represents the control of this instance
* with the specified type
* /
public javax. media . protocol . DataSource createClone ( )
public Object [ ] getControls ( )
{
if ( this . cloneableDataSource = = null )
Object [ ] thisControls ;
Object [ ] superControls = super . getControls ( ) ;
if ( superControls ! = null )
{
this . cloneableDataSource
= new CloneableCaptureDevicePullBufferDataSource ( this ) ;
thisControls = new Object [ superControls . length + 1 ] ;
System . arraycopy (
superControls , 0 ,
thisControls , 0 ,
superControls . length ) ;
thisControls [ superControls . length ] = this ;
}
return this . cloneableDataSource . createClone ( ) ;
else
{
thisControls = new Object [ ] { this } ;
}
return thisControls ;
}
}