Skip to main content

A question about SFAA test

8 replies [Last post]
nikkizeng
Offline
Joined: 2009-05-27
Points: 0

Hi,

I find that in the folder /xlets/tests/functional/SFAATest there are two versions of SFAADirector.Java
The version with SyncFrameAcurateAnimation class is not used. Is there any reason why SFAA test is not using the
SyncFrameAcurateAnimation class which is mentioned in the Sample code 17.12 of the HDCookbook book?

Thanks,
Nikki

Message was edited by: nikkizeng

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
Points: 0

> Hi,
>
> I find that in the folder
> /xlets/tests/functional/SFAATest there are two
> versions of SFAADirector.Java
> The version with SyncFrameAcurateAnimation class is
> not used.

Both are used...

The one under se_src is just there so the test will compile with GrinView. When I make an xlet, I always make a grinview version too, because it's so much easier to debug the GRIN show part that way.

the one under xlet_src is used - it's built with the xlet.

> Is there any reason why SFAA test is not
> using the
> SyncFrameAcurateAnimation class which is mentioned in
> the Sample code 17.12 of the HDCookbook book?

Well, the first reason would be that I forgot all about that sample code when I did the SFAA test xlet. But, if I had remembered I probably would have done the test the same way it is today. When the cookbook was written, the animation framework was much more primitive. The SFAA test xlet was written partly to test the SFAA support that's integrated into the animation framework. I'm sure it's the same basic code, but it's structured to fit in with how the code is organized now.

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27
Points: 0

Hi Bill,

Thank you very much for your reply. But I still don't get it... So you
mean that both SFAADirector.java files work at the same time?

Also, what is the relation between SFAAEngine and DirectDrawEngine in
the startSFAA method? If the test is for SFAA, why not just use
SFAAEngine to do all stuff?

Thank you so much!

billf
Offline
Joined: 2004-02-13
Points: 0

> Hi Bill,
>
> Thank you very much for your reply. But I still don't
> get it... So you
> mean that both SFAADirector.java files work at the
> same time?

No - the key is the build file that gets included from
xlets/GrinXlet/generic_build.xml. It defines a bunch
of targets, but two of interest: One for grinview (the Java SE
program that lets you run the show file on your desktop), and one
for the disc image. The grinview build target puts se_src in the path
for source files, and the disc image build target puts xlet_src in the path
for source files, so each build uses exactly one SFAADirector class.

Doing it this way is the trick that makes it easy to debug a show file on the
desktop where there are more debugging tools, without us having had to have
made an emulation of the BD-J platform. Instead, the app developer just makes
a version of the director that mostly stubs things out.

> Also, what is the relation between SFAAEngine and
> DirectDrawEngine in
> the startSFAA method? If the test is for SFAA, why
> not just use
> SFAAEngine to do all stuff?

You're talking about se_src/SFAADirector here. That one only runs on Java SE.
On Java SE, there is no SFAA API in the platform, so the grinview version just uses
direct draw to fake it. It's obviously not testing anything related to SFAA when it does
this, but it did let me get the program logic right on the desktop, without having to burn
a disc.

The real director that actually tests org.bluray.ui.SFAAmumble is the one in xlet_src,
and it doesn't mention DirectDrawEngine.

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27
Points: 0

Hi Bill,

Thank you so much! Now I understand.
May I ask you another question? If I want to use
ImageFrameAccurateAnimation class instead of
SyncFrameAccurateAnimation. How to use the images instead of a show?
The show seems to be integrated tightly, I couldn't figure out how to
change it. Thanks again!

Best regards,
Nikki

billf
Offline
Joined: 2004-02-13
Points: 0

Hi Nikki,

I confess, I've never really used IFAA :-) My understanding is that it's mostly for the presentation of a list of pre-rendered images. For that usage, there would be no real reason to integrate it with the animation framework, since there would be no programmatic drawing anyway.

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27
Points: 0

Hi Bill,

Thanks a lot for your quick response. You are right. No need to make IFAA so complicated. So I am trying to create an image, but there is always a strange error:

[xlets.javac] cannot find symbol : constructor BufferedImage(int,int,int)
[xlets.javac] location: class java.awt.image.BufferedImage
[xlets.javac] BufferedImage bimg = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);

I can't understand what is wrong....

Thanks,
Nikki

Message was edited by: nikkizeng

billf
Offline
Joined: 2004-02-13
Points: 0

> [xlets.javac] cannot find symbol : constructor
> BufferedImage(int,int,int)
> [xlets.javac] location: class
> java.awt.image.BufferedImage
> [xlets.javac] BufferedImage bimg = new
> BufferedImage(100, 100,
> BufferedImage.TYPE_INT_ARGB);
>
> I can't understand what is wrong....

I'm pretty sure that constructor isn't present in PBP. There's a factory method to create a BufferedImage, or you can use DVBBufferedImage.

Cheers,

Bill

nikkizeng
Offline
Joined: 2009-05-27
Points: 0

Hi Bill,

That's very helpful! I am using the DVBBufferedImage, figuring out how to show the images on the screen.

Thanks,
Nikki