<div dir="ltr">Ok, spoke to some people. No chance to remove that GetDecoderFilterManager from Kodi.<div><br></div><div>So I looked into the m2ts file that plays during the menu:</div><div><br></div><div>playing the menu file m2ts alone<br><br>INFO <general>: ffmpeg[0x3042539040X]: Duration: 00:00:45.04, bitrate: N/A<br>INFO <general>: ffmpeg[0x3042539040X]: Program 1 <br>INFO <general>: ffmpeg[0x3042539040X]: Stream #0:0[0x1011]: Video: hevc (HDMV / 0x564D4448), none, 3840x2160, 90k tbn<br>INFO <general>: ffmpeg[0x3042539040X]: Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 0 channels<br>DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 0<br>DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 1<br>INFO <general>: Opening stream: 0 source: 256<br>INFO <general>: Creating video codec with codec id: 173<br>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, <b>Extradata-Size: 121</b><br>CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.Nvidia.h265.decode), colorFormat(21)<br>CDVDVideoCodecAndroidMediaCodec::InjectExtraData<br>CDVDVideoCodecAndroidMediaCodec:: width(3840), height(2160), stride(0), slice-height(0), color-format(0)<br>CDVDVideoCodecAndroidMediaCodec:: crop-left(0), crop-top(0), crop-right(3839), crop-bottom(2159)<br>CDVDVideoCodecAndroidMediaCodec:: Multi-Surface Rendering<br>CDVDVideoCodecAndroidMediaCodec:: Open Android MediaCodec OMX.Nvidia.h265.decode<br><br><br>Playing the disc with menu:<br>INFO <general>: ffmpeg[0x30248dc040X]: Duration: N/A, start: 600.000000, bitrate: N/A<br>INFO <general>: ffmpeg[0x30248dc040X]: Program 1 <br>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<br>DEBUG <general>: CDVDDemuxFFmpeg::AddStream ID: 0<br>INFO <general>: Opening stream: 0 source: 256<br>INFO <general>: Display resolution ADJUST : 3840x2160 @ 23.976025 - Full Screen (27) (weight: 0.000)<br>INFO <general>: Creating video codec with codec id: 173<br>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, <b>Extradata-Size: 114</b><br>INFO <general>: CDVDVideoCodecAndroidMediaCodec::Open Testing codec:OMX.Nvidia.h265.decode<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.Nvidia.h265.decode), colorFormat(2135033992)<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::Open m_codecname(OMX.Nvidia.h265.decode), colorFormat(21)<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::InjectExtraData<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: width(3840), height(2160), stride(0), slice-height(0), color-format(0)<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: crop-left(0), crop-top(0), crop-right(3839), crop-bottom(2159)<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec:: Multi-Surface Rendering<br>INFO <general>: CDVDVideoCodecAndroidMediaCodec:: Open Android MediaCodec OMX.Nvidia.h265.decode<br>DEBUG <general>: CDVDVideoCodecAndroidMediaCodec::UpdateFpsDuration fpsRate:24000 fpsscale:1001, fpsDur:41708<br>DEBUG <general>: CVideoPlayerVideo::OpenStream - open stream with codec id: 173<br></div><div><br></div><div>there's a 7 bytes or bits, I don't know what extradata is.. missing.</div><div><br></div><div>Is this something that you know what is about, Petri? </div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 31, 2021 at 3:26 PM Vitor Dall'Acqua <<a href="mailto:veggav@gmail.com">veggav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Well.. at least now I know exactly what caused the problems:<div><br></div><div>This line has to go from inside BD_EVENT_STILL_TIME on videoplayer.cpp</div><div> m_dvd.state = DVDSTATE_STILL;<br></div><div><br></div><div>and this check has to go:</div><div>if (!CServiceBroker::GetDecoderFilterManager()->isValid(m_codecname, m_hints))<br> continue;<br></div><div><br></div><div>So we can use hardware acceleration.</div><div>The background video will play just fine in HDR but all the 2d assets like the interactive menu is rendered in HDR.</div><div><br></div><div>I don't know if you would like to tackle this, Petri, but</div><div><a href="https://github.com/xbmc/xbmc/commit/892df0b3d04e2cc4808bd34199f6fb3034cbb47f" target="_blank">https://github.com/xbmc/xbmc/commit/892df0b3d04e2cc4808bd34199f6fb3034cbb47f</a><br></div><div><br></div><div>There is the math needed to get SDR content into HDR. </div><div>This actually solves another problem in Kodi that is, when it goes in HDR all the menu is over saturated. </div><div>Here what is going on is that when you start the menu of a uhd bluray, the 2d content is dessaturated. </div><div><br></div><div>I would be really nice to have this but not the most needed feature on libbluray.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 31, 2021 at 2:52 PM Vitor Dall'Acqua <<a href="mailto:veggav@gmail.com" target="_blank">veggav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Ok, while I work on why it's not rendering the menu in HDR..<div><br></div><div>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) </div><div><br></div><div>I'm loading it like this:</div><div><br></div><div>static const char libnet[] = "libnet";<br> dl_dlopen(libnet, NULL);<br></div><div><br></div><div>how do I write in C to load it but load from inside JAVA_HOME/lib/aarch64/ ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 31, 2021 at 1:53 PM Vitor Dall'Acqua <<a href="mailto:veggav@gmail.com" target="_blank">veggav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">FIXED IT:<div><br></div><div> case BD_EVENT_STILL_TIME:<br> /* {<br> if (m_dvd.state != DVDSTATE_STILL)<br> {<br> // else notify the player we have received a still frame<br><br> m_dvd.iDVDStillTime = *static_cast<int*>(pData);<br> m_dvd.iDVDStillStartTime = XbmcThreads::SystemClockMillis();<br><br> if (m_dvd.iDVDStillTime != 0)<br> m_dvd.iDVDStillTime *= 1000;<br><br> /* adjust for the output delay in the video queue <br> unsigned int time = 0;<br> if (m_CurrentVideo.stream && m_dvd.iDVDStillTime > 0)<br> {<br> time = (unsigned int)(m_VideoPlayerVideo->GetOutputDelay() / (DVD_TIME_BASE / 1000));<br> if (time < 10000 && time > 0)<br> m_dvd.iDVDStillTime += time;<br> }<br> m_dvd.state = DVDSTATE_STILL;<br> CLog::Log(LOGDEBUG, "BD_EVENT_STILL_TIME - waiting %i sec, with delay of %d sec",<br> m_dvd.iDVDStillTime, time / 1000);<br> }<br> }*/<br></div><div><br></div><div>I had to comment this and now video plays fine. </div><div>But... for some reason.. the menu isn't rendered in HDR. </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 31, 2021 at 12:58 PM Vitor Dall'Acqua <<a href="mailto:veggav@gmail.com" target="_blank">veggav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I think the other changes I did are not needed if you preload the<br>libraries (those were required to get it loaded in Ubuntu / x86_64).<br><div><br></div><div>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. </div><div>I'm not using that snip you made to preload every lib and it's working. </div><div><br></div><div>Just to let you know.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 31, 2021 at 12:50 PM Petri Hintukainen <<a href="mailto:phintuka@users.sourceforge.net" target="_blank">phintuka@users.sourceforge.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">la, 2021-01-30 kello 14:27 -0300, Vitor Dall'Acqua kirjoitti:<br>
> Also, Petri, do you think you could share the changes you made<br>
> on JRE to allow it to run without JAVA_HOME?<br>
<br>
Attached.<br>
<br>
Source tree was from:<br>
git clone --depth 1<br>
<a href="https://github.com/PojavLauncherTeam/openjdk-aarch64-jdk8u" rel="noreferrer" target="_blank">https://github.com/PojavLauncherTeam/openjdk-aarch64-jdk8u</a> openjdk<br>
<br>
I think the other changes I did are not needed if you preload the<br>
libraries (those were required to get it loaded in Ubuntu / x86_64).<br>
<br>
Preloading is weird and quite hacky. And those libraries are never<br>
closed. I don't know if it belongs to libbluray. Maybe if it was just<br>
one, consistent library. But definetely not blindly all libraries in<br>
lib/ folder.<br>
<br>
If JVM doesn't find the libraries, it cold be fixable with -<br>
Djava.library.path (or simliar) or LD_LIBRARY_PATH. If JVM doesn't try<br>
loading those, it is bug in java files.<br>
<br>
If we can't get it loading properly, preloading could be done in Kodi<br>
or in libjvm.so wrapper library. It is specific to this one JVM and/or<br>
configuration.<br>
<br>
> And did you create a make file to compile it? Or did it by hand?<br>
<br>
There are build scripts in<br>
<a href="https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch.git" rel="noreferrer" target="_blank">https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch.git</a><br>
<br>
> And finally, the changes needed on libbluray are just a few lines of<br>
> code on bdj.c.<br>
> Do you think a #ifdef android would be a good idea?<br>
<br>
For generic, android specific parts, yes.<br>
If there are some App / Kodi specific things (like paths), we need to<br>
add some way to configure those build-time and/or runtime.<br>
<br>
> I believe that even VLC could play full disks on Android too.<br>
<br>
Depends on the device. This requires some kind of keyboard or remote<br>
controller (BD-J can't be used with touch screen). In "normal" phone or<br>
tablet the user would be stuck in the first BD-J menu.<br>
So we need some kind of virtual remote controller for those devices.<br>
Either on-screen "keypad", or translating gestures to key events.<br>
<br>
(almost all HDMV menus should be usable with touch screen / mouse).<br>
<br>
<br>
_______________________________________________<br>
libbluray-devel mailing list<br>
<a href="mailto:libbluray-devel@videolan.org" target="_blank">libbluray-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libbluray-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>