From ad381381cf71dc1d71e526d6279ca0ff884ee79e Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Fri, 15 Jan 2010 21:03:27 +0000 Subject: [PATCH] Disables the local video display in calls when the QTKit CaptureDevice on Mac OS X is used in order to allow its testing, especially on Snow Leopard where CIVIL does not work. --- .../device/VideoMediaDeviceSession.java | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java b/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java index 38141c525..1f50400ae 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/VideoMediaDeviceSession.java @@ -86,10 +86,35 @@ public void addVideoListener(VideoListener listener) @Override protected DataSource createCaptureDevice() { - /* create our DataSource as Cloneable so we can both use it - * to display local video and stream to remote peer + /* + * Create our DataSource as SourceCloneable so we can use it to both + * display local video and stream to remote peer. + */ + /* + * FIXME By overriding the super implementation, we have disabled muting + * support. */ - DataSource captureDevice = Manager.createCloneableDataSource(getDevice().createOutputDataSource()); + DataSource captureDevice = getDevice().createOutputDataSource(); + + if (captureDevice != null) + { + MediaLocator locator = captureDevice.getLocator(); + + /* + * FIXME There is no video in calls when using the QuickTime/QTKit + * CaptureDevice so the local video support is disabled for it now. + */ + if ((locator == null) + || !QuickTimeAuto.LOCATOR_PROTOCOL + .equals(locator.getProtocol())) + { + DataSource cloneableDataSource + = Manager.createCloneableDataSource(captureDevice); + + if (cloneableDataSource != null) + captureDevice = cloneableDataSource; + } + } return captureDevice; } @@ -180,7 +205,11 @@ protected boolean fireVideoEvent( */ private Player getLocalPlayer() { - DataSource dataSource = ((SourceCloneable)getCaptureDevice()).createClone(); + DataSource captureDevice = getCaptureDevice(); + DataSource dataSource + = (captureDevice instanceof SourceCloneable) + ? ((SourceCloneable) captureDevice).createClone() + : null; /* create local player */ if (localPlayer == null && dataSource != null) @@ -219,9 +248,9 @@ public void controllerUpdate(ControllerEvent event) /** * Gets notified about ControllerEvents generated by - * {@link #player}. + * {@link #localPlayer}. * - * @param event the ControllerEvent specifying the + * @param controllerEvent the ControllerEvent specifying the * Controller which is the source of the event and the very type of * the event */