Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
/**
* Implements {@link VideoMediaStream#getKeyFrameControl()}.
*
* {@inheritDoc}
* @see VideoMediaStream#getKeyFrameControl()
*/
public KeyFrameControl getKeyFrameControl()
{
if (keyFrameControl == null)
keyFrameControl = new KeyFrameControlAdapter();
return keyFrameControl;
}
/**
* Gets the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>.
*
* @return the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>
*/
public QualityControl getQualityControl()
{
return qualityControl;
}
/**
* Updates the <tt>QualityControl</tt> of this <tt>VideoMediaStream</tt>.
*
* @param advancedParams parameters of advanced attributes that may affect
* quality control
*/

Lyubomir Marinov
committed
public void updateQualityControl(Map<String, String> advancedParams)
{
for(Map.Entry<String, String> entry : advancedParams.entrySet())
{
if(entry.getKey().equals("imageattr"))
{
Dimension res[] = parseSendRecvResolution(entry.getValue());
if(res != null)
{
qualityControl.setRemoteSendMaxPreset(

Lyubomir Marinov
committed
new QualityPreset(res[0]));

Lyubomir Marinov
committed
qualityControl.setRemoteReceiveResolution(res[1]);

Lyubomir Marinov
committed
((VideoMediaDeviceSession)getDeviceSession())
.setOutputSize(outputSize);
}
}
}
}
/**
* Move origin of a partial desktop streaming <tt>MediaDevice</tt>.
*
* @param x new x coordinate origin
* @param y new y coordinate origin
*/
public void movePartialDesktopStreaming(int x, int y)
{

Lyubomir Marinov
committed
MediaDeviceImpl dev = (MediaDeviceImpl) getDevice();

Lyubomir Marinov
committed
if (!DeviceSystem.LOCATOR_PROTOCOL_IMGSTREAMING.equals(
dev.getCaptureDeviceInfoLocatorProtocol()))
{

Lyubomir Marinov
committed
}
DataSource captureDevice = getDeviceSession().getCaptureDevice();
Object imgStreamingControl
= captureDevice.getControl(ImgStreamingControl.class.getName());
if (imgStreamingControl == null)
return;
// Makes the screen detection with a point inside a real screen i.e.
// x and y are both greater than or equal to 0.

Lyubomir Marinov
committed
ScreenDevice screen
= NeomediaServiceUtils.getMediaServiceImpl().getScreenForPoint(
new Point((x < 0) ? 0 : x, (y < 0) ? 0 : y));
Rectangle bounds = ((ScreenDeviceImpl) screen).getBounds();
((ImgStreamingControl) imgStreamingControl).setOrigin(
0,
screen.getIndex(),
x - bounds.x, y - bounds.y);