Enables to move the desktop sharing region.

cusax-fix
Vincent Lucas 14 years ago
parent ec7d85d643
commit 38542d5142

@ -522,12 +522,9 @@ public void actionPerformed(ActionEvent e)
sharingRegionHeight = sharingRegion.getHeight() + cropY;
int y = location.y - cropY;
DisplayMode dm = sharingRegion
.getGraphicsConfiguration()
.getDevice()
.getDisplayMode();
int maxWidth = dm.getWidth() - x;
int maxHeight = dm.getHeight() - y;
Rectangle rectangle = ScreenInformation.getScreenBounds();
int maxWidth = rectangle.width - x;
int maxHeight = rectangle.height - y;
// Checks that the region sharing does not go outside the
// right border of the current screen.
if(sharingRegionWidth > maxWidth)
@ -541,18 +538,23 @@ public void actionPerformed(ActionEvent e)
sharingRegionHeight = maxHeight;
}
// Moves and resizes the sharing region to corresponds to
// the true shared region.
//sharingRegion.setBounds(x, y, sharingRegionWidth, sharingRegionHeight);
frame.dispose();
if (call != null)
CallManager.enableRegionDesktopSharing(
call, x, y, sharingRegionWidth, sharingRegionHeight);
call,
x,
y,
sharingRegionWidth,
sharingRegionHeight);
else
CallManager.createRegionDesktopSharing(
protocolProvider, contact, x, y, sharingRegionWidth, sharingRegionHeight);
protocolProvider,
contact,
x,
y,
sharingRegionWidth,
sharingRegionHeight);
}
});
}

@ -1088,9 +1088,13 @@ public void movePartialDesktopStreaming(int x, int y)
ds = ds2.getWrappedDataSource();
}
// Makes the screen detection with a point inside a real screen:
// (x and y > 0).
int tmpX = (x < 0)? 0: x;
int tmpY = (y < 0)? 0: y;
ScreenDevice screen =
NeomediaActivator.getMediaServiceImpl().getScreenForPoint(
new Point(x, y));
new Point(tmpX, tmpY));
ScreenDevice currentScreen = screen;
if(screen == null)

@ -8,8 +8,12 @@
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
@ -21,12 +25,20 @@
*/
public class DataSource
extends AbstractVideoPullBufferCaptureDevice
implements MuteDataSource,
SourceCloneable
{
/**
* Stream created.
*/
private ImageStream stream = null;
/**
* The cloneable representation of this DataSource.
*/
private CloneableCaptureDevicePullBufferDataSource cloneableDataSource
= null;
/**
* Initializes a new <tt>DataSource</tt> instance.
*/
@ -111,4 +123,46 @@ protected AbstractPullBufferStream createStream(
this.stream = stream;
return stream;
}
/**
* 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).
*
* @return <tt>true</tt> since this <tt>DataSource</tt> is always mute.
*/
public boolean isMute()
{
return true;
}
/**
* Sets the mute state of this <tt>DataSource</tt>.
*
* 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.
*/
public javax.media.protocol.DataSource createClone()
{
if(this.cloneableDataSource == null)
{
this.cloneableDataSource
= new CloneableCaptureDevicePullBufferDataSource(this);
}
return this.cloneableDataSource.createClone();
}
}

@ -293,8 +293,7 @@ public boolean isPartialStreaming(Call call)
* @param x new x coordinate origin
* @param y new y coordinate origin
*/
public void movePartialDesktopStreaming(Call call, int x,
int y)
public void movePartialDesktopStreaming(Call call, int x, int y)
{
CallJabberImpl callImpl = (CallJabberImpl)call;
VideoMediaStream videoStream = (VideoMediaStream)

Loading…
Cancel
Save