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 751876 - vaapipostproc: enable passthrough on same caps
vaapipostproc: enable passthrough on same caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Low enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-03 07:47 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-07-27 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapipostproc: enable passthrough on same caps (1.39 KB, patch)
2015-07-03 07:47 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapipostproc: add prefer-passthrough property (9.37 KB, patch)
2016-06-07 09:14 UTC, Hyunjun Ko
none Details | Review
vaapipostproc: Don't set filtering value always in transform operation (7.06 KB, patch)
2016-06-08 01:12 UTC, Hyunjun Ko
none Details | Review
vaapipostproc: make it enable/disable pass-through mode (12.73 KB, patch)
2016-06-10 08:19 UTC, Hyunjun Ko
none Details | Review
[PATCH 1/2] vaapipostproc: checking and updating filter parameter only when it's set (10.10 KB, patch)
2016-07-22 03:15 UTC, Hyunjun Ko
committed Details | Review
[PATCH 2/2] vaapipostproc: make it enable/disable pass-through mode (3.34 KB, patch)
2016-07-22 03:16 UTC, Hyunjun Ko
committed Details | Review

Description Víctor Manuel Jáquez Leal 2015-07-03 07:47:04 UTC
Enable passthrough on same caps feature. With it, the negotiation with
vaapisink is faster.
Comment 1 Víctor Manuel Jáquez Leal 2015-07-03 07:47:09 UTC
Created attachment 306680 [details] [review]
vaapipostproc: enable passthrough on same caps
Comment 2 Gwenole Beauchesne 2015-07-03 08:05:07 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #0)
> Enable passthrough on same caps feature. With it, the negotiation with
> vaapisink is faster.

Any measurement to share? Thanks. :)
Comment 3 Gwenole Beauchesne 2015-07-03 08:05:18 UTC
Review of attachment 306680 [details] [review]:

LGTM.
Comment 4 Víctor Manuel Jáquez Leal 2015-07-08 14:32:09 UTC
I haven't pushed this patch because I'm not sure about what if the caps are the same but some properties, such as denoise, sharpen, color-balance or ske, are enabled. It that case the passthrough shall not be enabled though the caps are the same.
Comment 5 sreerenj 2016-03-24 16:54:38 UTC
Moving to Product:GStreamer, Component:gstreamer-vaapi
Comment 6 Hyunjun Ko 2016-06-07 09:14:08 UTC
Created attachment 329245 [details] [review]
vaapipostproc: add prefer-passthrough property

One suggestion that
adding new property to enable passthrough for users who wants to passthrough,
if both caps are same.
This is referred to alpha element.
In this case, postproc ignores filtering values.
Comment 7 Hyunjun Ko 2016-06-07 09:14:43 UTC
(In reply to Hyunjun Ko from comment #6)
> Created attachment 329245 [details] [review] [review]
> vaapipostproc: add prefer-passthrough property
> 
> One suggestion that
> adding new property to enable passthrough for users who wants to passthrough,
> if both caps are same.
> This is referred to alpha element.
> In this case, postproc ignores filtering values.

And a small code optimization.
Comment 8 Víctor Manuel Jáquez Leal 2016-06-07 10:14:01 UTC
(In reply to Hyunjun Ko from comment #6)
> Created attachment 329245 [details] [review] [review]
> vaapipostproc: add prefer-passthrough property
> 
> One suggestion that
> adding new property to enable passthrough for users who wants to passthrough,
> if both caps are same.
> This is referred to alpha element.
> In this case, postproc ignores filtering values.

I don't think that this is the way to go. The user should not think on these issues, it is only matter of the postprocessor if it enables the passthrough or not.
Comment 9 Víctor Manuel Jáquez Leal 2016-06-07 12:13:24 UTC
Perhaps, you should split the patch it two, so we could discuss the property separated.
Comment 10 Hyunjun Ko 2016-06-08 01:12:42 UTC
Created attachment 329353 [details] [review]
vaapipostproc: Don't set filtering value always in transform operation

Patch splited.

I would suggest new suggestion for passthrough later, according to Victor's comment.
Comment 11 Hyunjun Ko 2016-06-08 03:37:09 UTC
Probably, we can enable passthrough by below
- if both caps are same, passthrough mode is enabled basically.
- once filtering value is set, it turns to non-passthrough mode.
- if (all) filtering value is set to default again, it can turn to passthrough mode.

To do this, something necessary is below.
- Basically, if both caps are same and no filter value set, passthrough mode enabled.
- call gst_base_transform_reconfigure_src when filtering value is set
- During reconfigure, we can set passthrough mode with sink/src caps and filter flag.
- code to reset flags when it turns to default value.
Comment 12 Hyunjun Ko 2016-06-10 08:19:17 UTC
Created attachment 329536 [details] [review]
vaapipostproc: make it enable/disable pass-through mode

See commit message.
Comment 13 Víctor Manuel Jáquez Leal 2016-07-21 12:02:53 UTC
Review of attachment 329536 [details] [review]:

@Hyunjun,

Sorry for the late review.

Overall, I like what a see. But two comments:

1\ I would split this patch in two: 1) improving the parameter settings, to avoid checking for them at every frame; and 2) the passthrough enable
2\ A couple comment on code style basically

::: gst/vaapi/gstvaapipostproc.c
@@ +1125,3 @@
+{
+  GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
+  gboolean ret = FALSE;

I would rename 'ret' as filters_updated, to be clearer

@@ +1130,3 @@
+    ret = update_filter (postproc);
+
+  if (!postproc->same_caps || (ret && check_filter_update (postproc))) {

I'd move 'ret && check_filter_update (postproc)' up, so the comparison will look clearer

if (!postproc->same_caps || filters_updated)

or better

if (postproc->same_caps && !filters_updated)

or better... perhaps...

gst_base_transofrm_set_passthrough (trans, posptroc->same_caps && !filters_updated);

@@ +1319,3 @@
+  else
+    postproc->same_caps = FALSE;
+

It is better, sometimes, to avoid branching. I would put this as

postproc->same_caps = gst_caps_is_equal (caps, out_caps)

@@ +1822,3 @@
   gst_video_info_init (&postproc->filter_pool_info);
+
+  postproc->same_caps = FALSE;

This is not required since gobject structures are always initialized with zero.
Comment 14 Hyunjun Ko 2016-07-22 03:15:32 UTC
Created attachment 331951 [details] [review]
[PATCH 1/2] vaapipostproc: checking and updating filter parameter only when it's set

patch splitted according to Victor's suggestion
Comment 15 Hyunjun Ko 2016-07-22 03:16:21 UTC
Created attachment 331952 [details] [review]
[PATCH 2/2] vaapipostproc: make it enable/disable pass-through mode

In case that sink caps and src caps are same, and no filtering parameter set,
pass-through mode is enabled.
If new filtering parameter is set during playback, it makes it reconfiguring,
so that pass-through mode is changed
 
In addition, updating filter is performed during reconfiguration, if needed.
Comment 16 Víctor Manuel Jáquez Leal 2016-07-22 14:53:57 UTC
Review of attachment 331951 [details] [review]:

Looks good, but you forgot to filter_update() when the colorbalance interface change. I'll post a patch above yours for this.