-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable dirty regions for full screen video #6090
Conversation
When watching LiveTV in preview window - there is no picture at all. When switching over to fullscreen it works as expected, when switching back - the last image stays on screen not updated. |
@fritsch VideoControl is fixed now. |
Yeah, I expected a one liner - works as expected. Btw. did you check with intel_gpu_top or something that we get measurable results? E.g. reduced gpu usage? More throughput? Btw. @smallint wants to contact you for some specialities the cubox (and most likely other hw) will need, having a high performance fb on fb1 and another one fb0 which needs quite heavy operations to swap and sync. |
Wait, something else. The first channel after a "stop" does not show a picture. When switching to fullscreen and back, picture is there. Subsequent channels work if you don't press stop between them. |
fixed again. |
I checked this PR and it seems to work regarding eglSwapBuffers which is not called anymore in fullscreen if nothing is visible. I incorporated the change needed in CLinuxRendererGLES::HasFrame() as discussed with @FernetMenta. But if I press enter and the OSD should show up only the currenly updated controls are visible. Same is true for 'o'. Since the renderer calls glClear all controls are removed but not the onces currently dirty. Furthermore m_rotatedDestCoords in RenderIMXMAPTexture are somehow wrong? In LiveTV I get now values like "0 1082726400 0 1080074240" for "x0 y0 x1 y1" if displayed not fullscreen. In fullscreen I get always "0 0 0 0". EDIT: Regarding m_rotatedDestCoords: my fault, I used the wrong printf specifier ;) It works as usual. |
what dirty regions algo did you choose? in general we render all controls if there is only a single one dirty because there is no preserve back buffer. |
|
If I open the OSD and move with left and right through the buttons I can see only the currently updated buttons but all others are cleared. |
@FernetMenta: The last squash patch needs #ifdef HAS_VIDEO_PLAYBACK 2015-01-02 13:10 GMT+01:00 smallint notifications@github.com:
Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B |
@FernetMenta Might be, but it does not link without that :-) I did not care about the semantics. |
it links here. |
Okay, try make clean and full make again, then you might see. 2015-01-02 13:27 GMT+01:00 Rainer Hochecker notifications@github.com:
Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B |
@FernetMenta Actually the system has back buffer preserve. I checked it with another application and also the log does not tell otherwise. The renderer always calls glClear, doesn't it? And that destroys the back buffer anyhow. I tried with "3" and it works that all controls are rendered if invalidated. But the next frame will remove them again completely (glClear?). |
I could fix it for me with
Then it is working with both algos. |
@FernetMenta We do enable back buffer preserve (#3021) and the Pi certainly respects that flag. |
seems to work normal for osx and ios (just tested the osd controls and dialogs ...) |
@smallint where were you adding that code? |
@popcornmix CGUIWindowFullScreen::FrameMove() |
@popcornmix In GUIWindowFullScreen.cpp:555 |
Now playback with and without GUI works very well and with almost full performance (no GUI). Next small issue is overlay rendering such as teletext. It only updates were OSD controls are dirty. EDIT: Also 'o' does not remove the stats overlay completely. m_bHasRendered should take into account that the overlay was hidden to force clearing the back buffer. Probably there are some other controls which need such tracking? |
@smallint do videos with black bars clear background correctly? |
@popcornmix Yes. E.g. videos with 4:3 ratio do show correctly. I must admit that I am clearing the background manually if the cropping rect changes. With "background" I refer to another framebuffer device than the GL context uses. It is probably similar to the Pi hardware layering. In the GL context I just cut a hole with alpha=0 into the paint area if not fullscreen. |
@smallint does the teletext dialog set its dirty flag? Maybe you need to override the DoProcess method and call MarkDirtyRegion when something has changed. |
Where is the teletext dialog implemented? I will check that. |
Found it. Indeed, it does not set the dirty flag. Doing that helps but "esc" for hiding it has then a very high latency then. I need to press esc twice to make it disappear after a couple of seconds. |
how did you set it? dependent on m_TextDecoder.NeedRendering()? |
Yes, but I forgot to check m_bClose in DoProcess. Now it is working. |
where exactly do you read this from? please point me to the lines in the log |
Not from this logs. I just read it previously. Here it another log where the first number after "r:" is the buffer index: http://xbmclogs.com/show.php?id=399113. |
I captured now two cases and logged the RenderManager states as well: http://xbmclogs.com/show.php?id=399132. Just for completeness. It seems to only happen if FrameWait is triggered. |
what exactly do you mean by "if FrameWait is triggered" ? |
I mean the event wait:
|
the sequence is as follows:
so if you see the same buffer rendered twice this condition is not true could you verify this? |
I added an output if !next and this output is not there. Actually flip is only triggered if next is true and the previous log has flips.
Is that Render call between READY and FLIP normal? |
it is hard for me to follow because I don't see where you placed the logs. it should only render the same buffer twice if the timestamp of the next frame is too far in the future.
not sure what you mean. those are meant to be discrete states which have no "between". |
OK, I agree that it is hard to follow. I placed the logs where the new state is assigned. I see now that only RenderEx calls g_renderManager.Render() and will try to track that path with more logging. I come back to you when I found something. |
I think I know the reason. The sequence is wrong. After FrameWait we would need FrameMove to switch to the next buffer. |
… RendererHandlesPresent returned always true
Need to do more tests but yeah, looks good. You are the man! |
I could not reproduce the wrong sequence anymore: so we found a bug? ;) Thanks a lot! |
thanks to you! hopefully this fixes the issue on the Pi too. |
I add this patch to my tree and will credit you for it of course. Once I rebase onto baseline it will be removed. |
…, FrameMove, Render
b8ef805
to
f43059b
Compare
jenkins build this please |
Build error on win unrelated |
enable dirty regions for full screen video
Moves video rendering (fullscreen) from application to GUIWindowFullScreen. By doing this dirty regions work on fullscreen mode and the platform has separate layers for video and ui.
@popcornmix iirc you still need some options to limit fps of gui, right?