Skip to main content

changing swing.volatileImageBufferEnabled dynamically?

1 reply [Last post]
Anonymous

Can this property be changed dynamically, ie, during program
execution? Or will it only be read once - at startup?

I have a media player application in Java, running on Windows, that
uses the Windows Media Player 9 SDK via JNI to play WMV files from a
a MMS (streaming) server. This has been working great in production
for quite a while.

I am now adding support for playing Quicktime movies, via Quicktime
for Java. However, I've been having major redraw issues (I'm using
the native QT widgets, not the Swing ones - ie, a QTComponent, not a
QTJComponent). Basically, if I move the window, or trigger some kind
of repaint/update on the playing window (like moving the JFrame or
clicking on another window, then clicking back on my main JFrame, the
video starts acting "weird", including pausing, artifacts, no longer
being centered, dropping frames, etc.

I have found through painful trial-and-error that if I set
swing.volatileImageBufferEnabled property to false in my main()
method, these redraw issues magically disappear when playing movies
using the Quicktime player component.

However, since the Windows Media files have been working fine for
some 2 years now, I don't want to blanket-disable this property. I
just want to set it to true when I'm displaying a Windows Media
component for playing video, and false when using the Quicktime
component.

Can I do this? If not by setting this property, is there some API
method I can call to dynamically change this value on the fly?

Thanks!

Rob Ross, Senior Software Engineer
E! Networks
rross@eentertainment.com
---------------------------------------------------
"Beware of he who would deny you access to information, for in his
heart he dreams himself your master." -- Commissioner Pravin Lal

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
grlea
Offline
Joined: 2004-05-26

I've asked about changing these kind of things (e.g. opengl -D settings) on the fly before, and the answer was "it's read once". I guess you can SET it dynamically, by reading a value from a Preferences objects or properties file in your main method and setting it before initialising any GUI components. But I generally get the idea that they can't be CHANGED dynamically.

G.