[libbluray-devel] JRE for Android part 3

Vitor Dall'Acqua veggav at gmail.com
Mon Feb 1 02:06:21 UTC 2021


Ok, spoke to some people. No chance to remove that GetDecoderFilterManager
from Kodi.

So I looked into the m2ts file that plays during the menu:

playing the menu file m2ts alone

INFO <general>: ffmpeg[0x3042539040X]:   Duration: 00:00:45.04, bitrate: N/A
INFO <general>: ffmpeg[0x3042539040X]:   Program 1
INFO <general>: ffmpeg[0x3042539040X]:     Stream #0:0[0x1011]: Video: hevc
(HDMV / 0x564D4448), none, 3840x2160, 90k tbn
INFO <general>: ffmpeg[0x3042539040X]:     Stream #0:1[0x1100]: Audio: ac3
(AC-3 / 0x332D4341), 0 channels
DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 0
DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 1
INFO <general>: Opening stream: 0 source: 256
INFO <general>: Creating video codec with codec id: 173
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open hints: Width 3840 x
Height 2160, Fpsrate 0 / Fpsscale 0, CodecID 173, Level -99, Profile -99,
PTS_invalid 0, Tag 1447904328, *Extradata-Size: 121*
CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.Nvidia.h265.decode),
colorFormat(21)
CDVDVideoCodecAndroidMediaCodec::InjectExtraData
CDVDVideoCodecAndroidMediaCodec:: width(3840), height(2160), stride(0),
slice-height(0), color-format(0)
CDVDVideoCodecAndroidMediaCodec:: crop-left(0), crop-top(0),
crop-right(3839), crop-bottom(2159)
CDVDVideoCodecAndroidMediaCodec:: Multi-Surface Rendering
CDVDVideoCodecAndroidMediaCodec:: Open Android MediaCodec
OMX.Nvidia.h265.decode


Playing the disc with menu:
INFO <general>: ffmpeg[0x30248dc040X]:   Duration: N/A, start: 600.000000,
bitrate: N/A
INFO <general>: ffmpeg[0x30248dc040X]:   Program 1
INFO <general>: ffmpeg[0x30248dc040X]:     Stream #0:0[0x1011]: Video: hevc
(Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084),
3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc
DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 0
INFO <general>: Opening stream: 0 source: 256
INFO <general>: Display resolution ADJUST : 3840x2160 @ 23.976025 - Full
Screen (27) (weight: 0.000)
INFO <general>: Creating video codec with codec id: 173
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open hints: Width 3840 x
Height 2160, Fpsrate 24000 / Fpsscale 1001, CodecID 173, Level 153, Profile
2, PTS_invalid 0, Tag 1447904328, *Extradata-Size: 114*
INFO <general>: CDVDVideoCodecAndroidMediaCodec::Open Testing
codec:OMX.Nvidia.h265.decode
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open
m_codecname(OMX.Nvidia.h265.decode), colorFormat(2135033992)
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open
m_codecname(OMX.Nvidia.h265.decode), colorFormat(21)
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::InjectExtraData
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: width(3840),
height(2160), stride(0), slice-height(0), color-format(0)
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: crop-left(0),
crop-top(0), crop-right(3839), crop-bottom(2159)
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: Multi-Surface Rendering
INFO <general>: CDVDVideoCodecAndroidMediaCodec:: Open Android MediaCodec
OMX.Nvidia.h265.decode
DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::UpdateFpsDuration
fpsRate:24000 fpsscale:1001, fpsDur:41708
DEBUG <general>: CVideoPlayerVideo::OpenStream - open stream with codec id:
173

there's a 7 bytes or bits, I don't know what extradata is.. missing.

Is this something that you know what is about, Petri?



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

> 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/d5632c72/attachment-0001.html>


More information about the libbluray-devel mailing list