Skip to main content

AWTVideoSizeControl

5 replies [Last post]
hooligancat
Offline
Joined: 2009-10-20

Hi,

I am using this control to resize the player to 1/2 resolution (960x540). This works great. When resizing from 1/2 resolution back to full screen, the resize works but i also get an error thrown on the PS3. So the question is when resizing back to full screen is the source rectangle = 0,0,1920,1080 (which works on TMT), or is the source x,y,960,540 (which doesn't work in TMT).

The code is:

((AWTVideoSizeControl) m_player
.getControl(AWTVideoSizeControl.class.getName()))
.setSize(new AWTVideoSize(src, dst));

Alternatively is there another method which can resize the player to 1/2 res and back again?

Thanks for any advice

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billf
Offline
Joined: 2004-02-13

The thing about Color.BLACK not being present is specified, and the PS/3 did exactly what it's supposed to do, and what all BD players are mandated to do. You must be looking at documentation for desktop Java, and compiling against desktop Java.

BD-J uses Personal Basis Profile, and only guarantees the APIs present in PBP 1.0. In PBP 1.0, some of fat that was trimmed from desktop Java were the duplicate color constants.

To avoid this kind of problem, you should adjust your compilation path so that you're building against the right platform. See the examples in the cookbook project -- they all get this right -- and see also http://wiki.java.net/bin/view/Mobileandembedded/BDJPlatformDefinition

hooligancat
Offline
Joined: 2009-10-20

billf,

Thanks for the heads up. I thought my dev environment was correct, I guess not.

I am using Eclipse, and compiling against JDK compliance level 1.3, with the following compliance settings:

generated .class file compatability = 1.1
source compatability = 1.3

Is this correct?

Thanks

jkinzer
Offline
Joined: 2006-04-18

When using the AWTVideoSize, the source is always the input video size. The destination is always the desired on-screen size.

One caveat: don't rely upon VideoPresentationControl.getInputVideoSize(). This will not work across all players in all of the required states (this is Blu-ray, after all).

You could also look into using the BackgroundVideoPresentationControl.setVideoTransformation() which actually has a nicer API. However, I have not spent any time proving that the simple case works across all players. I have certainly seen that certain spec-mandated cases do not work on some players, using this control.

What exception is being thrown on the PS3?

Good luck and watch out for the BD-J compatibility pot holes!

Jeff

hooligancat
Offline
Joined: 2009-10-20

Thanks for the suggestion. After further examination, I discovered that it was not this control that was causing the problem.

After resizing, I was also setting the background color to black (it was showing a jpg image). Astonishingly the PS3 crashed on java.awt.Color.BLACK When i changed it to java.awt.Color.black (NB the lowecase black), it worked fine.

This is the 2nd time I have been caught out using uppercase Colors. Even though they have the same RGB values, uppercase appears to be a no-no. I presume this is one of your pot-holes :)

If you would care to share your pot holes, I am certain there will be a lot of thankful people in this forum, me for one.

Regards

jkinzer
Offline
Joined: 2006-04-18

hooligan,

Glad to hear you got it figured out. While I would love to share all of the issues in Blu-ray, it would take a book, and probably wouldn't make the manufacturers very happy. :) Besides, an unfortunate number of these issues really have no workaround.

As always, I am happy to answer questions as I can in the forums.

Take care,
Jeff