Android 4k vidoe render under mediacodec mode plus hardware decoder & display
#1
Hello guys
We are using Amlogic platform S812 and finding 4k 264 video can not display out as Aml decodes 4k video by hardware & display by their own video layer ,not OSD!

Now XBMC mediacodec mode using surfacetexture and render by GLES itself, Can XBMC pass the render handling to surfaceflinger? Aml deals the timestamp & OSD transparency by hwcomposer.

If 4K video display by OSD ,how should we deal with the performance? Thanks!
Reply
#2
Any one give me some suggestions? Thanks!
Reply
#3
For, nvidia shield, we are capable to display 4K on the GUI layer by using ANativeWindow_setBuffersGeometry with the hdmi resolution, even if the framebuffer itself is limited to 1080p.
We obviously need to know the hdmi resolution for this, and there is no standard api for this until Android M.

Assuming you are a box vendor, what's the point of using mediacodec rather than amlcodec?
Reply
#4
Oh Thanks a bunch for your reply ^_^,do you have a AML platform to reproduce the issue?
The reason we turn to mediacodec api is that android version above 5.0 with selinux has strict permission control to device access.
As you know we need to give many device 666 permission to using amlcodec.

For other APK using mediacodec api ,we send 4K video es streams to decode & display out under kernel level as amlcodec do. under XBMC'S mediacodec render method ,video is covered by OSD. maybe need do some transparency . For other APK, hwc_overlay_compose is handled by surface flinger, we did the transparency and video axis control here.

nvidia shield, you mentioned, does this means they scaled 4k video to 1080p and display out by OSD ?
Reply
#5
Well, I have aml devices but no 4K display, so I cannot really reproduce, unfortunately...
From which company are you (you can PM me the response)?

If what you say is confirmed, maybe some kind of fundraising amongst box vendors and amlogic might be organized so as to provide me with 4K hardware...
Reply
#6
er,It seems I have no permission to send private message to you. could you please give me you email address, then I can get you privately?
Reply
#7
Thanks very much, Koying. I have got your mail and sent one to you.
Reply
#8
Hi Koying ,have you got my mail? I still have no permision to end private message, so sad
Reply
#9
Could you do it in the public? Its really annoying to read that you have a conversation - but obviously noone can read what it is about. Either do it in the public - or do it in private entirely please. We are still an open source project - that includes discussions.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#10
Well,Memphiz, I do like very much to discuss with you guys----excellent XBMC contributors .
As some contains personal informations, so please understand & wish you a good mood.
Reply
#11
@Memphiz Right, nothing secret, let's do it here.

Here the backlog
Quote:Correct some thing

Best Regards
spike.liao

From: Spike liao
Date: 2015-06-09 18:04
To: Yvonne Chen; koying
CC: koying
Subject: Re: Re: Hi koying, I am Yvonne.chen ---http://forum.kodi.tv/showthread.php?tid=228739.mediacodec api render issue
Hi,Koying
Aml mediacodec API can display video on aml video layer,this will provide fully 4k quality.
We add a special GRALLOC_USAGE_xxx flag to decoder output graphic buffer,and this buffer will not fill with yuv data,but some info
when the buffer is render to native window,
if our surfaceflinger detect this flag,will not render data to fb0,just set the layer transparent.

This need application config mediacodec surface with SurfaceView,not a SurfaceTexture.

Best Regards
spike.liao

From: Yvonne Chen
Date: 2015-06-09 17:08
To: koying
CC: koying; Spike Liao
Subject: Re: Re: Hi koying, I am Yvonne.chen ---http://forum.kodi.tv/showthread.php?tid=228739.mediacodec api render issue

Hi Koying
Thanks for what you do with the issue. 1080P and below really works with mediacodec api and rendered on OSD using Aml platform.
For 4K , to improve performance and keep quality, we rendered it by videolayer under kernel level, no video frame filled on OSD , the mediabuffer render by APK only filled with timestamp info. to confirm this, just exec echo 1 > /sys/class/graphics/fb0/blank on s812 during 4K playing, then you will see video .
We do no think 4K is possible to be rendered by OSD. we did some research on other platforms , found low picture quality( maybe 4k is scaled to 1080p), or not smooth video with performance issue.

Using present XBMC render method , we found no way to do transparency to show video out.



yvonne.chen


From: Chris Browet
Date: 2015-06-09 16:29
To: Yvonne Chen
CC: koying; Spike Liao
Subject: Re: Hi koying, I am Yvonne.chen ---http://forum.kodi.tv/showthread.php?tid=228739.mediacodec api render issue
Hi Yvonne,

I do have a S812 (Minix) just no 4K TV.
I was able to reproduce, though.

However, the same code work for 4K on Shield, and 1080p and below has no issue with mediacodec on S812, either.

That seems to point to an issue with Amlogic's implementation of 4K.

Kodi works by asking mediacodec to render to a SurfaceTexture, attached to a GLES texture.
This GLES texture is then composited (via the OES extension) on the gui layer, which is the only surface Kodi actually uses.

Not sure what might be the issue. I saw that, even in mediacodec mode, video continues to be rendered by aml on fb1, though...

Regards
- Chris -
Reply
#12
Hi Koying
Have you got what AML did for fully 4K support?
And have you got any ideas for this issue? to change XBMC using surfaceview, let hwcomposer to composite using hwc_overaly?

Thanks
XBMC-lover & trouble-maker
Reply
#13
Not sure what you mean by "get".

If it's code from you, implementing SurfaceView, no, I didn't get it.

If it's the fact that we should implement it, yes, I will at some point if nobody else provide a PR.
Kodi not being my dayjob (and this not being an immediate requirement to any devices on the market), I cannot tell when, though.
Reply
#14
Like "I get it" means "I understand it" , "get" here means understand ^_^

What does "PR" means?^_^

Very glad to hear that you will at some point for this issue and the fact is that we really need you guys' help to implement it.

So, please help . Let kodi show really 4K video to the users asap^_^.

Thanks !
XBMC-lover & trouble-maker
Reply
#15
PR = Github Pull Request
Reply

Logout Mark Read Team Forum Stats Members Help
4k vidoe render under mediacodec mode plus hardware decoder & display1