BD-J Support

Thanks for the reply, Sam.

Is that a limitation of OpenJDK or of Kodi’s BD-J implementation?

How do blu-ray players do BD-J menus if Java can’t use hardware acceleration?

Those players are licensed and they are members of the Blu-Ray disc association.

Yes, obviously. Are you saying that their version of Java supports hardware acceleration?

Or is it not about the JVM but that their BD-J implementation is more complete than the open-source one? Or is it that Kodi hasn’t connected all the plumbing necessary to support hardware acceleration when using BD-J?

I’m trying to figure out where I should work on contributing a fix.

Yes – they will have hardware acceleration.

Not to belabor the point, but where is the missing link in Kodi? Does OpenJDK need fixing to allow for hardware acceleration? Or does BD-J? Or does Kodi’s use of BD-J?

You need a JVM which supports hardware acceleration (in the case of Vero, AMCodec) with EGL surface rendering.

Thank you!

Since last week I’ve been looking into libbluray, VLC (since it’s home to libbluray), and Kodi. Currently libbluray renders the BDJ menus to ARGB data, which it then passes upstream via callback.

VLC doesn’t seem to be using any hardware acceleration in its rendering pipeline after that.

Kodi, on the other hand, does seem to be converting overlay image data to GL surfaces for rendering. Since such raster overlays are used elsewhere in VideoPlayer with HW acceleration, BDJ’s use of raster data doesn’t seem like it would be the underlying problem.

This seems at odds with the discussion last April, where @Acadia said “the menus can’t be HW accelerated” and “VideoPlayer can’t switch decoding method,” suggesting that somehow the use of BDJ menus disables hardware decoding. But I’m not seeing anywhere within Kodi or libbluray where the use of BDJ has any effect on the video decoding method: it’s just rendering overlays.

But @MASHtm said “hardware decoding…fails after selecting a menu option.” That makes me wonder whether the issue has to do with the way BDJ menus control which video stream to render or title to play? Something that’s causing Kodi to fall over?

Does this sound like I’m on the right path, or have I missed something?

I don’t think there is any mechanism to get video in to a HW accelerated pathway.

I don’t think the video stream is touched by the JVM, though. Title and playlist changes are communicated via events, so Kodi (or VLC) should be able to respond and play the appropriate video. For the video stream, libbluray only parses the video files and returns the compressed stream to the caller to decompress and render.

Maybe Kodi isn’t handling those events properly? If it’s making assumptions and properly handling only the first or longest playlist, it might not be handling playlist changes correctly.