After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701095 - videomixer: Should implement pass-through and optimizations
videomixer: Should implement pass-through and optimizations
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-27 18:53 UTC by Nicolas Dufresne (ndufresne)
Modified: 2014-12-22 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] videomixer: Operate in pass-through mode if possible (1.37 KB, patch)
2013-05-28 04:00 UTC, Nicolas Dufresne (ndufresne)
needs-work Details | Review

Description Nicolas Dufresne (ndufresne) 2013-05-27 18:53:28 UTC
Currently videomixer could operate faster in certain conditions.

1) Passthrough If there is only 1 input, it could pass-through if the input has no alpha and is fullscreen
2) Passthrough If there is multiple inputs, but the top layer is fullscreen and has no alpha
3) Only fill/copy visible rectangle of each layer when a opaque color format is negotiated

This would allow having a videomixer around with very low cost.
Comment 1 Nicolas Dufresne (ndufresne) 2013-05-28 04:00:13 UTC
Created attachment 245426 [details] [review]
[PATCH] videomixer: Operate in pass-through mode if possible


Videomixer can do pass-through if the pad with highest zorder is opaque and fullscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=70109
---
 gst/videomixer/videomixer2.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 2 Sebastian Dröge (slomo) 2013-05-28 07:57:48 UTC
Review of attachment 245426 [details] [review]:

::: gst/videomixer/videomixer2.c
@@ +831,3 @@
+    if (top_pad->alpha == 1.0 && (top_pad->xpos + top_pad->ypos == 0)
+        && mix->info.width == top_pad->info.width
+        && mix->info.height == top_pad->info.height) {

This is not catching all cases. You could have a top pad that is larger than fullscreen, which could have negative x/y-pos and still fill the complete frame. Or could have negative x/y-pos and not fill the complete frame.
Comment 3 Nicolas Dufresne (ndufresne) 2013-05-28 13:46:37 UTC
(In reply to comment #2)
> This is not catching all cases. You could have a top pad that is larger than
> fullscreen, which could have negative x/y-pos and still fill the complete
> frame. Or could have negative x/y-pos and not fill the complete frame.

Great ! that's why I like reviews, I'll give it a second try later. Could it be something like:

(top_pad->alpha == 1.0
   && (top_pad->info.width - top_pad->xpos) > mix->info->width
   && (top_pad->info.height - top_pad->ypos) > mix->info->height)

Just throughing this, let me know if on have more cases.
Comment 4 Nicolas Dufresne (ndufresne) 2013-05-28 14:34:24 UTC
What I realized is that this patch cover case 1 and 2. Also, the previous case is slightly different. If there an opaque input that is larger then full output, we can ingore underneeth layers, but we need to crop it. Finally, I found a new pass-through case, if background is fully transparent and we have a single stream fullscreen with alpha, also we don't need to blend (just crop) in the same case where the single stream is bigger (but cover all) the output surface.

Update optimisation list:
1) Passthrough if top-layer is fullscreen and and opaque
2) Passthrough if there is only 1 fullscreen stream and background is transparent
3) Blit copy (crop) top layer, if top-layer is fullscreen and and opaque
4) Blit copy, if there is only 1 layer, background is transparent and covers the full surface of the output
And many many more !
Comment 5 Tim-Philipp Müller 2014-12-22 15:43:00 UTC
These all work now with videomixer or compositor?
Comment 6 Nicolas Dufresne (ndufresne) 2014-12-22 15:59:47 UTC
I have no idea, but it's a new code base. If it's still important to anyone to optimze these path they should re-open or create a new bug. It's been rotting here for a year and a half. For me, all these optimization are not very useful if I can use GL for mixing.