Disable desktop streaming by default (need to pass --desktop-stream

argument).
cusax-fix
Sebastien Vincent 16 years ago
parent 42952fbcbe
commit 9ad4dc45fa

@ -20,16 +20,19 @@ public class ImageStreamingAuto
{
/**
* Add capture devices.
*
* @throws Exception if problem when adding capture devices
*/
public ImageStreamingAuto()
public ImageStreamingAuto() throws Exception
{
String name = "DesktopStreaming";
String name = "Desktop streaming";
CaptureDeviceInfo devInfo = new CaptureDeviceInfo(name,
new MediaLocator(ImageStreamingUtils.LOCATOR_PREFIX + name),
DataSource.getFormats());
/* add to JMF device manager */
CaptureDeviceManager.addDevice(devInfo);
CaptureDeviceManager.commit();
}
}

@ -184,8 +184,24 @@ private void detectCaptureDevices()
}
/* Desktop capture */
/* it should not throw exception */
new ImageStreamingAuto();
/* for the moment desktop streaming is disabled by default,
* user needs to add --desktop-stream argument:
* ant run -Dargs=--desktop-stream
*/
String allowDs = System.getProperty("net.java.sip.communicator.impl.neomedia.imgstreaming");
if(allowDs != null && allowDs.equals("true"))
{
try
{
new ImageStreamingAuto();
}
catch(Throwable exc)
{
logger.debug("No desktop streaming available: " + exc.getMessage(), exc);
}
}
}
/**

@ -249,6 +249,11 @@ else if (args[i].equals("--multiple") || args[i].equals("-m"))
returnAction = ACTION_CONTINUE_LOCK_DISABLED;
continue;
}
else if (args[i].equals("--desktop-stream") || args[i].equals("-s"))
{
handleDesktopStreaming();
break;
}
//if this is the last arg and it's not an option then it's probably
//an URI
else if ( i == args.length - 1
@ -288,6 +293,14 @@ private void handleIPv4Enforcement()
System.setProperty("java.net.preferIPv6Addresses", "false");
}
/**
* Allows to use desktop streaming as video device.
*/
private void handleDesktopStreaming()
{
System.setProperty("net.java.sip.communicator.impl.neomedia.imgstreaming", "true");
}
/**
* Passes <tt>uriArg</tt> to our uri manager for handling.
*
@ -444,6 +457,7 @@ public void handleHelpArg()
System.out.println(" -m, --multiple do not ensure single instance");
System.out.println(" -6, --ipv6 prefer IPv6 addresses where possible only");
System.out.println(" -4, --ipv4 forces use of IPv4 only");
System.out.println(" -s, --desktop-stream use desktop streaming");
System.out.println(" -v, --version display the current version and exit");
}

Loading…
Cancel
Save