[libbluray-devel] JRE for Android part 3

Vitor Dall'Acqua veggav at gmail.com
Sun Jan 31 18:26:49 UTC 2021


Well.. at least now I know exactly what caused the problems:

This line has to go from inside BD_EVENT_STILL_TIME on videoplayer.cpp
 m_dvd.state = DVDSTATE_STILL;

and this check has to go:
if (!CServiceBroker::GetDecoderFilterManager()->isValid(m_codecname,
m_hints))
  continue;

So we can use hardware acceleration.
The background video will play just fine in HDR but all the 2d assets like
the interactive menu is rendered in HDR.

I don't know if you would like to tackle this, Petri, but
https://github.com/xbmc/xbmc/commit/892df0b3d04e2cc4808bd34199f6fb3034cbb47f

There is the math needed to get SDR content into HDR.
This actually solves another problem in Kodi that is, when it goes in HDR
all the menu is over saturated.
Here what is going on is that when you start the menu of a uhd bluray, the
2d content is dessaturated.

I would be really nice to have this but not the most needed feature on
libbluray.

On Sun, Jan 31, 2021 at 2:52 PM Vitor Dall'Acqua <veggav at gmail.com> wrote:

> Ok, while I work on why it's not rendering the menu in HDR..
>
> Petri, libnet.so that needs to be loaded before libjvm.so I have to pack
> it with Kodi (while it is already inside JAVA_HOME)
>
> I'm loading it like this:
>
> static const char         libnet[]  = "libnet";
>     dl_dlopen(libnet, NULL);
>
> how do I write in C to load it but load from inside JAVA_HOME/lib/aarch64/
> ?
>
> On Sun, Jan 31, 2021 at 1:53 PM Vitor Dall'Acqua <veggav at gmail.com> wrote:
>
>> FIXED IT:
>>
>>       case BD_EVENT_STILL_TIME:
>>  /*     {
>>         if (m_dvd.state != DVDSTATE_STILL)
>>         {
>>           // else notify the player we have received a still frame
>>
>>           m_dvd.iDVDStillTime = *static_cast<int*>(pData);
>>           m_dvd.iDVDStillStartTime = XbmcThreads::SystemClockMillis();
>>
>>           if (m_dvd.iDVDStillTime != 0)
>>             m_dvd.iDVDStillTime *= 1000;
>>
>>           /* adjust for the output delay in the video queue
>>           unsigned int time = 0;
>>           if (m_CurrentVideo.stream && m_dvd.iDVDStillTime > 0)
>>           {
>>             time = (unsigned int)(m_VideoPlayerVideo->GetOutputDelay() /
>> (DVD_TIME_BASE / 1000));
>>             if (time < 10000 && time > 0)
>>               m_dvd.iDVDStillTime += time;
>>           }
>>           m_dvd.state = DVDSTATE_STILL;
>>           CLog::Log(LOGDEBUG, "BD_EVENT_STILL_TIME - waiting %i sec, with
>> delay of %d sec",
>>                     m_dvd.iDVDStillTime, time / 1000);
>>         }
>>       }*/
>>
>> I had to comment this and now video plays fine.
>> But... for some reason.. the menu isn't rendered in HDR.
>>
>>
>> On Sun, Jan 31, 2021 at 12:58 PM Vitor Dall'Acqua <veggav at gmail.com>
>> wrote:
>>
>>> I think the other changes I did are not needed if you preload the
>>> libraries (those were required to get it loaded in Ubuntu / x86_64).
>>>
>>> the only library I'm preloading is libnet.so that is used by libnio.so,
>>> or else it says it's not possible to find it.
>>> I'm not using that snip you made to preload every lib and it's working.
>>>
>>> Just to let you know.
>>>
>>> On Sun, Jan 31, 2021 at 12:50 PM Petri Hintukainen <
>>> phintuka at users.sourceforge.net> wrote:
>>>
>>>> la, 2021-01-30 kello 14:27 -0300, Vitor Dall'Acqua kirjoitti:
>>>> > Also, Petri, do you think you could share the changes you made
>>>> > on JRE to allow it to run without JAVA_HOME?
>>>>
>>>> Attached.
>>>>
>>>> Source tree was from:
>>>> git clone --depth 1
>>>> https://github.com/PojavLauncherTeam/openjdk-aarch64-jdk8u openjdk
>>>>
>>>> I think the other changes I did are not needed if you preload the
>>>> libraries (those were required to get it loaded in Ubuntu / x86_64).
>>>>
>>>> Preloading is weird and quite hacky. And those libraries are never
>>>> closed. I don't know if it belongs to libbluray. Maybe if it was just
>>>> one, consistent library. But definetely not blindly all libraries in
>>>> lib/ folder.
>>>>
>>>> If JVM doesn't find the libraries, it cold be fixable with -
>>>> Djava.library.path (or simliar) or LD_LIBRARY_PATH. If JVM doesn't try
>>>> loading those, it is bug in java files.
>>>>
>>>> If we can't get it loading properly, preloading could be done in Kodi
>>>> or in libjvm.so wrapper library. It is specific to this one JVM and/or
>>>> configuration.
>>>>
>>>> > And did you create a make file to compile it? Or did it by hand?
>>>>
>>>> There are build scripts in
>>>> https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch.git
>>>>
>>>> > And finally, the changes needed on libbluray are just a few lines of
>>>> > code on bdj.c.
>>>> > Do you think a #ifdef android would be a good idea?
>>>>
>>>> For generic, android specific parts, yes.
>>>> If there are some App / Kodi specific things (like paths), we need to
>>>> add some way to configure those build-time and/or runtime.
>>>>
>>>> > I believe that even VLC could play full disks on Android too.
>>>>
>>>> Depends on the device. This requires some kind of keyboard or remote
>>>> controller (BD-J can't be used with touch screen). In "normal" phone or
>>>> tablet the user would be stuck in the first BD-J menu.
>>>> So we need some kind of virtual remote controller for those devices.
>>>> Either on-screen "keypad", or translating gestures to key events.
>>>>
>>>> (almost all HDMV menus should be usable with touch screen / mouse).
>>>>
>>>>
>>>> _______________________________________________
>>>> libbluray-devel mailing list
>>>> libbluray-devel at videolan.org
>>>> https://mailman.videolan.org/listinfo/libbluray-devel
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20210131/8ff47bb4/attachment.html>


More information about the libbluray-devel mailing list