[sip-comm-dev] Re: svn commit: r6871 - trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java


#1

Hi,

Now it works well on Windows, Linux and Mac OS X :).

···

--
Seb

lubomir_m@dev.java.net a écrit :

Author: lubomir_m
Date: 2010-03-11 11:30:11+0000
New Revision: 6871

Modified:
   trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java

Log:
Attempts to fix the problem with r6870 reported by Sebastien Vincent as "On Windows I have 3/4 of the display screen black :frowning: and the last quarter looks bad (like my previous image I sent yesterday)" in the dev mailing list thread "[sip-comm-dev] Re: svn commit: r6869 - trunk/src/net/java/sip/communicator/impl: gui/main/call gui/main/menus neomedia neomedia/codec/video."

Modified: trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java?view=diff&rev=6871&p1=trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java&p2=trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java&r1=6870&r2=6871

--- trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java (original)
+++ trunk/src/net/java/sip/communicator/impl/neomedia/codec/video/SwScaler.java 2010-03-11 11:30:11+0000
@@ -123,19 +123,31 @@
         if (outputFormat instanceof RGBFormat)
         {
             RGBFormat rgbOutputFormat = (RGBFormat) outputFormat;
-
+ Class<?> dataType = outputFormat.getDataType();
+ int bitsPerPixel = rgbOutputFormat.getBitsPerPixel();
+ int pixelStride = rgbOutputFormat.getPixelStride();
+
+ if ((pixelStride == Format.NOT_SPECIFIED)
+ && (dataType != null)
+ && (bitsPerPixel != Format.NOT_SPECIFIED))
+ pixelStride
+ = dataType.equals(Format.byteArray)
+ ? (bitsPerPixel / 8)
+ : 1;
             setOutputFormat(
                 new RGBFormat(
                         size,
                         Format.NOT_SPECIFIED,
- outputFormat.getDataType(),
+ dataType,
                         outputFormat.getFrameRate(),
- rgbOutputFormat.getBitsPerPixel(),
+ bitsPerPixel,
                         rgbOutputFormat.getRedMask(),
                         rgbOutputFormat.getGreenMask(),
                         rgbOutputFormat.getBlueMask(),
- rgbOutputFormat.getPixelStride(),
- size.width, // lineStride
+ pixelStride,
+ (pixelStride == Format.NOT_SPECIFIED)
+ ? Format.NOT_SPECIFIED
+ : (pixelStride * size.width), // lineStride
                         rgbOutputFormat.getFlipped(),
                         rgbOutputFormat.getEndian()));
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net