[9] review request: 8131888: Deliver javafx.swt as a modular jar in JDK 9

2016-05-25 Thread Kevin Rushforth

Please review the following:

https://bugs.openjdk.java.net/browse/JDK-8131888
http://cr.openjdk.java.net/~kcr/8131888/webrev.00/

This adds support for the javafx.embed.swt package back into the JDK, 
which will be delivered as an automatic module in 
$JAVA_HOME/lib/javafx-swt.jar (final location is TBD).


Details are in JBS.

-- Kevin



Re: OSX+Radeon crash VideoDataBuffer.convert YCbCr_422 -> BGRA_PRE

2016-05-25 Thread Chris Newland
Thanks Kevin, filed RFE with Review ID: JI-9038459.

I've found this was a really powerful way to do things like real-time
chroma keying (green screening) in JavaFX so will keep an OpenJFX snapshot
around to preserve this functionality.

Will be releasing another JavaFX tech demo soon :)

Cheers,

Chris

On Wed, May 25, 2016 13:29, Kevin Rushforth wrote:
> I'm not surprised this causes problems, as it is almost certainly not
> thread-safe.
>
> FWIW, this impl_ method is already inaccessible in JDK 9 because it
> returns a type that is not exported from the javafx.media module. Further,
> this methods will go away very soon as part of the ongoing encapsulation
> of all impl_ methods.
>
> Can you file an RFE for a public API to do this? We can consider it for
> a future version of JavaFX.
>
> -- Kevin
>
>
>
> Chris Newland wrote:
>
>> Hi,
>>
>>
>> This is really just an FYI as I'm doing funky stuff with multiple
>> MediaPlayers and using the deprecated impl_getLatestFrame() method to
>> grab frames.
>>
>> I can grab frames fine with a single MediaPlayer instance but when I
>> use multiple MediaPlayer objects each with an AnimationTimer calling
>> this code:
>>
>>
>> public void snapshotVideo() {
>> VideoDataBuffer buf = player.impl_getLatestFrame();
>>
>>
>> if (buf != null) {
>> VideoFormat newFormat = VideoFormat.BGRA_PRE;
>> buf = buf.convertToFormat(newFormat);
>>
>> ByteBuffer bb =
>> buf.getBufferForPlane(VideoDataBuffer.PACKED_FORMAT_PLANE);
>>
>> int pixel = 0;
>>
>> int max = bb.remaining() / 4;
>>
>> for (int i = 0; i < max; i++) {
>> rawFrameData[pixel++] = bb.getInt(); }
>>
>>
>> buf.releaseFrame(); }
>> }
>>
>>
>> then it crashes hard on OSX El Capitan with AMD Radeon HD 6970M with
>> this dump:
>> https://gist.github.com/chriswhocodes/5516d24078205dc218dead870853e018
>>
>>
>> I'm guessing the native frame conversion from YCbCr_422 to BGRA_PRE is
>> not thread-safe but some naive attempts to lock around this haven't
>> solved the problem.
>>
>> This same code + videos works fine on a MacBook Pro with Intel Iris
>> graphics so it's a tiny hardware+OS corner case but thought it might be
>> worth a mention.
>>
>> The only thing I'd add is that I'd love to have an official API for
>> grabbing single frames from video. I've been doing some cool real-time
>> video effects in JavaFX and it's a shame to have to use a deprecated
>> method which will probably go away.
>>
>> Cheers,
>>
>>
>> Chris
>>
>>
>>
>




Memory Leak in Ubuntu 16.04

2016-05-25 Thread Herrmann Maier

Good day,

I run Ubuntu 16.04 in 64 bit, with free Radeon graphics driver (AMD Radeon HD 
6450 graphics card), and with Oracle's JDK version 1.8.0_92 .


When I run JavaFX applications, like the JDK's Ensemble demo or my own 
programs, there's a memory leak when FX shows some "action" like animated or 
otherwise active FX components. Firstly, FX's animation loop doesn't run with 
60 but 120 fps, and secondly the needed memory for the Java task grows until 
my physical RAM size is reached, then the system starts to swap memory until 
it stalls.


The memory leak only appears when the FX application does do something, e.g. 
when there's a JavaFX animation loop or when I click a FX  button. When I 
just start the Ensemble demo and don't press any key or mouse button, the 
memory is OK.


Also Swing and other Java programs work fine on the same system.

When I manually invoke "System.gc() at the end of my FX's animation loop, the 
memory gets released, i.e. no memory leak. But the downside is that the FX 
program then runs very slow because of the manual gc() at each frame.


I also tried to use different garbage collection parameters with "java 
-X...", but it didn't help.


How can I encircle the problem, please? Thanks in advance.

Regards,
Herrmann



Re: OSX+Radeon crash VideoDataBuffer.convert YCbCr_422 -> BGRA_PRE

2016-05-25 Thread Kevin Rushforth
I'm not surprised this causes problems, as it is almost certainly not 
thread-safe.


FWIW, this impl_ method is already inaccessible in JDK 9 because it 
returns a type that is not exported from the javafx.media module. 
Further, this methods will go away very soon as part of the ongoing 
encapsulation of all impl_ methods.


Can you file an RFE for a public API to do this? We can consider it for 
a future version of JavaFX.


-- Kevin


Chris Newland wrote:

Hi,

This is really just an FYI as I'm doing funky stuff with multiple
MediaPlayers and using the deprecated impl_getLatestFrame() method to grab
frames.

I can grab frames fine with a single MediaPlayer instance but when I use
multiple MediaPlayer objects each with an AnimationTimer calling this
code:

public void snapshotVideo()
{
VideoDataBuffer buf = player.impl_getLatestFrame();

if (buf != null)
{
VideoFormat newFormat = VideoFormat.BGRA_PRE;
buf = buf.convertToFormat(newFormat);

ByteBuffer bb =
buf.getBufferForPlane(VideoDataBuffer.PACKED_FORMAT_PLANE);

int pixel = 0;

int max = bb.remaining() / 4;

for (int i = 0; i < max; i++)
{
rawFrameData[pixel++] = bb.getInt();
}

buf.releaseFrame();
}
}

then it crashes hard on OSX El Capitan with AMD Radeon HD 6970M with this
dump:
https://gist.github.com/chriswhocodes/5516d24078205dc218dead870853e018

I'm guessing the native frame conversion from YCbCr_422 to BGRA_PRE is not
thread-safe but some naive attempts to lock around this haven't solved the
problem.

This same code + videos works fine on a MacBook Pro with Intel Iris
graphics so it's a tiny hardware+OS corner case but thought it might be
worth a mention.

The only thing I'd add is that I'd love to have an official API for
grabbing single frames from video. I've been doing some cool real-time
video effects in JavaFX and it's a shame to have to use a deprecated
method which will probably go away.

Cheers,

Chris

  


Review request for JDK-8141385

2016-05-25 Thread Andrey Rusakov
Hello, Everyone. Please look at my fix for JDK-8141385 
:

http://cr.openjdk.java.net/~arusakov/8141385/webrev.00

Actually, that is Jonathan's bug, I've occasionally meet it during 
testing and decided to fix it.


OSX+Radeon crash VideoDataBuffer.convert YCbCr_422 -> BGRA_PRE

2016-05-25 Thread Chris Newland
Hi,

This is really just an FYI as I'm doing funky stuff with multiple
MediaPlayers and using the deprecated impl_getLatestFrame() method to grab
frames.

I can grab frames fine with a single MediaPlayer instance but when I use
multiple MediaPlayer objects each with an AnimationTimer calling this
code:

public void snapshotVideo()
{
VideoDataBuffer buf = player.impl_getLatestFrame();

if (buf != null)
{
VideoFormat newFormat = VideoFormat.BGRA_PRE;
buf = buf.convertToFormat(newFormat);

ByteBuffer bb =
buf.getBufferForPlane(VideoDataBuffer.PACKED_FORMAT_PLANE);

int pixel = 0;

int max = bb.remaining() / 4;

for (int i = 0; i < max; i++)
{
rawFrameData[pixel++] = bb.getInt();
}

buf.releaseFrame();
}
}

then it crashes hard on OSX El Capitan with AMD Radeon HD 6970M with this
dump:
https://gist.github.com/chriswhocodes/5516d24078205dc218dead870853e018

I'm guessing the native frame conversion from YCbCr_422 to BGRA_PRE is not
thread-safe but some naive attempts to lock around this haven't solved the
problem.

This same code + videos works fine on a MacBook Pro with Intel Iris
graphics so it's a tiny hardware+OS corner case but thought it might be
worth a mention.

The only thing I'd add is that I'd love to have an official API for
grabbing single frames from video. I've been doing some cool real-time
video effects in JavaFX and it's a shame to have to use a deprecated
method which will probably go away.

Cheers,

Chris