Skip to main content

BDLocator Problem

13 replies [Last post]
blackmage
Offline
Joined: 2007-08-28

I really do not get why error is occuring. I'm using XletView to run xlets and I'm getting this error:

<br />
java.lang.NoClassDefFoundError: org/bluray/net/BDLocator<br />
        at MainMenu.setHScence(MainMenu.java:87)<br />
        at MainMenu.run(MainMenu.java:58)<br />
        at java.lang.Thread.run(Thread.java:619)<br />
>>>>> error <<<<<<br />

But I compiled the classes in jars like the code below. And I checked in the jar making sure that the BDLocator class is in the correct location, and it is in org/bluray/net. The code compiled correctly like below.

<br />
devin@devin-laptop:~/Desktop/HaviExamples$ ls<br />
background.png    HaviBackgroundController.class  mainvideo.avi<br />
BDJ.jar           HaviBackgroundController.java   message.txt<br />
Containers.class  HaviExample.class               MySecondXlet.java<br />
Containers.java   HaviExample.java                SimpleXlet.class<br />
Debug.class       MainMenu.class                  SimpleXlet.java<br />
Debug.java        MainMenu.java<br />
foreground.png    MainMenu.java~<br />
devin@devin-laptop:~/Desktop/HaviExamples$ javac -classpath ~/Desktop/HaviExamples/BDJ.jar MainMenu.java Containers.java Debug.java<br />
devin@devin-laptop:~/Desktop/HaviExamples$<br />

Line 87 is

<br />
containers=new Containers();<br />

And in that class, there is an import

<br />
import org.bluray.net.BDLocator;<br />

which I think is causing the problem, or it could be something else. And I know its the Container class, because when I comment it out, the code works fine. Any help would be REALLY appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joe Rice

As an aside, the
parameter of activate_segment doesn't appear
to be documented at https://hdcookbook.dev.java.net/javadocs/grin/com/hdcookbook/grin/doc-fi...

Cheers,
Joe

On Nov 14, 2007, at 1:08 AM, bd-j-dev@mobileandembedded.org wrote:

> Hi Bill, Joe,
>
> Just by reading the code, it seems to me that the only way to push
> the current segment before activating a new one is to add
to
> the activate_segment command in the script, like below.
> ActivateSegmentCommand.execute() doesn't push the current segment by
> default, since the "push" boolean that seems to control this
> behavior is false most of the time, including the one for
> Segment.cmdToActivate field.
>
> activate_segment S:BonusShowing
;
>
> Maybe I'm missing something, but perhaps there was a reason not to
> record segment by default, for memory etc?
>
> Chihiro
> [Message sent by forum member 'chihiro_saito' (chihiro_saito)]
>
> http://forums.java.net/jive/thread.jspa?messageID=245348
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Joe Rice

Hi -

Could someone run down the conditions under which a segment gets
pushed to the segment stack?

I was using activateSegment(null) as a quick way to grab the last
segment for display, but this would sometimes throw a null pointer
exception (even though a segment had been previously activated and
deactivated). I'd thought that as long as a segment was displayed it
would get pushed to the stack when the next segment was activated, but
perhaps this is overly simplistic thinking.

Does a segment get pushed both when being activated from the
controlling Xlet using activateSegment(Segment) and when using
activate_segment from within the show script?

Thanks,
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Bill Foote

Joe Rice wrote:
> Hi -
>
> Could someone run down the conditions under which a segment gets pushed
> to the segment stack?
>
> I was using activateSegment(null) as a quick way to grab the last
> segment for display, but this would sometimes throw a null pointer
> exception (even though a segment had been previously activated and
> deactivated). I'd thought that as long as a segment was displayed it
> would get pushed to the stack when the next segment was activated, but
> perhaps this is overly simplistic thinking.
>
> Does a segment get pushed both when being activated from the controlling
> Xlet using activateSegment(Segment) and when using activate_segment from
> within the show script?

Yes, it should. Indeed, here's the implementation of activateSegment:

public void activateSegment(Segment seg) {
if (seg == null) {
runCommand(popSegmentCommand);
} else {
runCommand(seg.cmdToActivate);
}
}

In other words, activateSegment(non-null value) works by running
an activate_segment command internally.

I'm not sure what's going on with the NPE - you could probably figure
this out pretty quickly by adding a println to both Show.pushCurrentSegment()
and Show.popSegmentStack(), and see what the pattern is.

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

chihiro_saito
Offline
Joined: 2006-11-08

Hi Bill, Joe,

Just by reading the code, it seems to me that the only way to push the current segment before activating a new one is to add
to the activate_segment command in the script, like below. ActivateSegmentCommand.execute() doesn't push the current segment by default, since the "push" boolean that seems to control this behavior is false most of the time, including the one for Segment.cmdToActivate field.

activate_segment S:BonusShowing
;

Maybe I'm missing something, but perhaps there was a reason not to record segment by default, for memory etc?

Chihiro

Bill Foote

bd-j-dev@mobileandembedded.org wrote:
> Hi Bill, Joe,
>
> Just by reading the code, it seems to me that the only way to push the current segment before activating a new one is to add
to the activate_segment command in the script, like below. ActivateSegmentCommand.execute() doesn't push the current segment by default, since the "push" boolean that seems to control this behavior is false most of the time, including the one for Segment.cmdToActivate field.
>
> activate_segment S:BonusShowing
;
>
> Maybe I'm missing something, but perhaps there was a reason not to record segment by default, for memory etc?
>
> Chihiro

Oh, right! Thanks for pointing that out. I had forgotten that
a "push" is explicit... I guess I was a bit too much in BDA
meeting mode :-)

Right, push has to be explicit. That wasn't done for memory
reasons - indeed, the rule with the push stack is like that
of an HP calculator, where the stack is fixed size, and when
something gets pushed off the top, it just disappears.

The reason it's explicit was so that the author could call out
a point to return to. A really common pattern is to have a
segment that represents the beginning of an animation (like
menu roll-out), and then that automatically transitions to
another segment (like menus visible). The idea with push
was to be able to return to a fairly coarsely grained point
in a show.

It's used in the HD cookbook's menu. By using push/pop, I was
able to re-use much of the same menu infrastructure for both
the pop-up and the main menu. For that menu, the pattern of
push/pop is pretty simple -- a stack one deep was enough.

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

chihiro_saito
Offline
Joined: 2006-11-08

Oh, that explains what segment_stack_depth_setting is for. I wasn't exactly sure how that works. Thanks!

But if stack is fixed size, Joe's interpretation feels more straightforward to me - that the segment is recorded unless explicitly stated otherwise. If we want to return to a particular point for menuxlet, couldn't we have other ways of somehow associating one segment with another... ?

Chihiro

Bill Foote

bd-j-dev@mobileandembedded.org wrote:
> Oh, that explains what segment_stack_depth_setting is for. I wasn't exactly sure how that works. Thanks!
>
> But if stack is fixed size, Joe's interpretation feels more straightforward to me - that the segment is recorded unless explicitly stated otherwise. If we want to return to a particular point for menuxlet, couldn't we have other ways of somehow associating one segment with another... ?

Well... Yes, other ways of getting the same result are possible.
Indeed, to go all the way to the other extreme, with (say) FX/Script,
it'd be easy to create your own stack as just a data member
of a GRIN show, for example, and explicitly push/pop it in script
code. And yes, if you think in terms of
having a push operation, and having a pop operation, then I can
see how it's reasonable to make the push explicit.

The thing is, push/pop wasn't added for the purpose of having a
generic push/pop. It was really driven by a requirement to return
to a certain, well-defined, stable point in a "calling" segment.
It was the minimally complex way I could think of to achieve that
goal; the fact that it came out as a stack was sort of incidental.

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Joe Rice

Thanks to Chihiro's digging, I now understand the use of the
parameter in activate_segment. If I'm activating segments in BD-J via
activateSegment(), and I want to push the current segment first, it
looks like I call pushCurrentSegment() first. Is that right?

Cheers,
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Bill Foote

Joe Rice wrote:
> Thanks to Chihiro's digging, I now understand the use of the
> parameter in activate_segment. If I'm activating segments in BD-J via
> activateSegment(), and I want to push the current segment first, it
> looks like I call pushCurrentSegment() first. Is that right?
>
> Cheers,
> Joe

Not quite. It'd probably work, put pushCurrentSegment() has two issues:

* It's specified as being only for the use of the ActivateSegmentCommand
* It's synchronized, so you'd have to convince yourself that deadlock
is impossible. The methods that you normally call (like activateSegment())
were intentionally written to make sure they are always deadlock-free.

This bit about deadlocks is why activateSegment() posts a command to activate
the segment, rather than trying to do it itself -- using commands this way
greatly simplifies the multithreading model.

So, how do you programmatically activate a segment with a push? Use
activateSegment(Segment, boolean). Which you don't have yet, because
I just wrote it -- putback coming :-)

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

shinnawy
Offline
Joined: 2007-04-08

As you may see in the implementation status page (http://xletview.sourceforge.net/status/status-current.html) on XletView's webpage org.bluray.* is not implemented therefore, the XletView engine is unable to load this class from its stub library.

You might want to try out this code on a software player (PowerDVD, WinDVD, etc.)

blackmage
Offline
Joined: 2007-08-28

Are there any free ones that may be able to run on Linux on Mac? I'm doing this as a school project so I really don't have a budget or commerical sponsors.

shinnawy
Offline
Joined: 2007-04-08

One solution for this problem that I might think of is, writing a wrapper to the BDLocator class using only the xletView supported MediaTracker class.

Bill Foote

For the narrow problem of BDLocator, you can use the
factory method javax.tv.locator.LocatorFactory.createLocator().

With that said, there may be other APIs that aren't
implemented in xletView that are important -- and there's
the whole matter of working with video. I don't want to
discourage experimentation with xletView, but just be aware
that you'll probably bump up against limitations.

Unfortunately, the only PC players of BD I know of today run
on Windows.

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net