diff options
5 files changed, 45 insertions, 22 deletions
diff --git a/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java b/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java index 8d06969..58adc41 100644 --- a/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java +++ b/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java @@ -415,7 +415,7 @@ public class SwScaler if ((inFlags & Buffer.FLAG_SYSTEM_TIME) != 0) outFlags |= Buffer.FLAG_SYSTEM_TIME; output.setFlags(outFlags); - + return BUFFER_PROCESSED_OK; } diff --git a/src/net/java/sip/communicator/impl/neomedia/device/DirectShowAuto.java b/src/net/java/sip/communicator/impl/neomedia/device/DirectShowAuto.java index df80d65..7162754 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/DirectShowAuto.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/DirectShowAuto.java @@ -65,11 +65,11 @@ public class DirectShowAuto }
else
{
- logger.warn("No support for this webcam: " +
+ logger.warn("No support for this webcam: " +
devices[i].getName() + "(no format supported)");
continue;
}
-
+
CaptureDeviceInfo device
= new CaptureDeviceInfo(devices[i].getName(),
new MediaLocator(LOCATOR_PROTOCOL + ':' + devices[i].
@@ -82,7 +82,7 @@ public class DirectShowAuto CaptureDeviceManager.addDevice(device);
captureDeviceInfoIsAdded = true;
}
-
+
if (captureDeviceInfoIsAdded)
CaptureDeviceManager.commit();
diff --git a/src/net/java/sip/communicator/impl/neomedia/device/MediaDeviceSession.java b/src/net/java/sip/communicator/impl/neomedia/device/MediaDeviceSession.java index 58d2c4e..39cfcaf 100644 --- a/src/net/java/sip/communicator/impl/neomedia/device/MediaDeviceSession.java +++ b/src/net/java/sip/communicator/impl/neomedia/device/MediaDeviceSession.java @@ -685,13 +685,11 @@ public class MediaDeviceSession } /** - * Gets the <tt>MediaFormat</tt> in which this instance captures media from - * its associated <tt>MediaDevice</tt>. + * Gets the JMF <tt>Format</tt> in which this instance captures media. * - * @return the <tt>MediaFormat</tt> in which this instance captures media - * from its associated <tt>MediaDevice</tt> + * @return the JMF <tt>Format</tt> in which this instance captures media. */ - public MediaFormat getFormat() + public Format getProcessorFormat() { Processor processor = getProcessor(); @@ -706,17 +704,40 @@ public class MediaDeviceSession if (!trackControl.isEnabled()) continue; - MediaFormat format - = MediaFormatImpl.createInstance(trackControl.getFormat()); + Format jmfFormat = trackControl.getFormat(); + MediaType type = jmfFormat instanceof VideoFormat + ? MediaType.VIDEO : MediaType.AUDIO; - if ((format != null) && format.getMediaType().equals(mediaType)) - return format; + if(mediaType.equals((type))) + { + return jmfFormat; + } } } return null; } /** + * Gets the <tt>MediaFormat</tt> in which this instance captures media from + * its associated <tt>MediaDevice</tt>. + * + * @return the <tt>MediaFormat</tt> in which this instance captures media + * from its associated <tt>MediaDevice</tt> + */ + public MediaFormat getFormat() + { + Format jmfFormat = getProcessorFormat(); + + if(jmfFormat != null) + { + MediaFormat format + = MediaFormatImpl.createInstance(jmfFormat); + return format; + } + return null; + } + + /** * Gets the <tt>MediaType</tt> of the media captured and played back by this * instance. It is the same as the <tt>MediaType</tt> of its associated * <tt>MediaDevice</tt>. @@ -1236,8 +1257,10 @@ public class MediaDeviceSession setProcessorFormat(processor, this.format); else if (processorIsPrematurelyClosed || ((processorState > Processor.Configured) - && !format.equals(getFormat()))) + && !this.format.equals(getProcessorFormat()))) + { setProcessor(null); + } } } diff --git a/src/net/java/sip/communicator/impl/neomedia/format/MediaFormatFactoryImpl.java b/src/net/java/sip/communicator/impl/neomedia/format/MediaFormatFactoryImpl.java index 0552df6..dd86bcc 100644 --- a/src/net/java/sip/communicator/impl/neomedia/format/MediaFormatFactoryImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/format/MediaFormatFactoryImpl.java @@ -250,7 +250,7 @@ public class MediaFormatFactoryImpl = new VideoMediaFormatImpl( videoMediaFormatImpl.getFormat(), videoMediaFormatImpl.getClockRate(), - null, + formatParameters, advancedParameters); break; default: diff --git a/src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java b/src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java index bd28128..9c06cdf 100644 --- a/src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java +++ b/src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java @@ -6,11 +6,9 @@ */ package net.java.sip.communicator.impl.netaddr; -import java.net.*; - /** - * Class to retrieve local address to use for a - * specific destination. + * Class to retrieve local address to use for a specific destination. + * This class works only on Microsoft Windows system. * * @author Sebastien Vincent */ @@ -30,11 +28,13 @@ public class Win32LocalhostRetriever } /** - * Native function to retrieve source address to use for a specific destination. + * Native method to retrieve source address to use for a specific + * destination. + * * @param dst destination address * @return source address or null if error - * @note This function is only implemented for Microsoft Windows (>= XP SP1). - * Do not try to call it from another OS. + * @note This function is only implemented for Microsoft Windows + * (>= XP SP1). Do not try to call it from another OS. */ public native static byte[] getSourceForDestination(byte[] dst); } |