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 720376 - vaapipostproc: add support for GstColorBalance interface
vaapipostproc: add support for GstColorBalance interface
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
0.5.8
Other Windows
: Normal enhancement
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 743569
 
 
Reported: 2013-12-13 06:34 UTC by Zhao, Halley
Modified: 2015-06-16 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0005-vaapipostproc-add-colorbalance-filters-hue-saturatio (5.26 KB, patch)
2013-12-13 06:35 UTC, Zhao, Halley
committed Details | Review
0006-vaapipostproc-add-GstColorBalance-interface (8.80 KB, patch)
2013-12-13 06:35 UTC, Zhao, Halley
needs-work Details | Review
vaapipostproc: add color balance interface (7.55 KB, patch)
2015-06-11 16:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapipostproc: add color balance interface (7.83 KB, patch)
2015-06-12 17:23 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Zhao, Halley 2013-12-13 06:34:16 UTC
add GstColorBalance support: hue/saturation/brightness/contrast
Comment 1 Zhao, Halley 2013-12-13 06:34:59 UTC
patches base on the ones in: https://bugzilla.gnome.org/show_bug.cgi?id=720375
Comment 2 Zhao, Halley 2013-12-13 06:35:25 UTC
Created attachment 264122 [details] [review]
0005-vaapipostproc-add-colorbalance-filters-hue-saturatio
Comment 3 Zhao, Halley 2013-12-13 06:35:44 UTC
Created attachment 264123 [details] [review]
0006-vaapipostproc-add-GstColorBalance-interface
Comment 4 Gwenole Beauchesne 2013-12-19 10:26:39 UTC
Review of attachment 264122 [details] [review]:

OK
Comment 5 sreerenj 2015-01-27 15:00:14 UTC
Hmm, sorry for the long delay! I will push this for next release (0.5.11).
Comment 6 Gwenole Beauchesne 2015-06-08 09:42:26 UTC
Review of attachment 264122 [details] [review]:

Pushed with minor changes for a while now. :)
Comment 7 Gwenole Beauchesne 2015-06-08 09:43:40 UTC
Review of attachment 264123 [details] [review]:

This needs to be reworked in a way comparable to what is "now" implemented in vaapisink.
Comment 8 Víctor Manuel Jáquez Leal 2015-06-08 14:01:43 UTC
(In reply to Gwenole Beauchesne from comment #7)
> Review of attachment 264123 [details] [review] [review]:
> 
> This needs to be reworked in a way comparable to what is "now" implemented
> in vaapisink.

I can do that if that's OK for Zhao.
Comment 9 Víctor Manuel Jáquez Leal 2015-06-10 12:53:18 UTC
For sake of completion, I'm adding color balance support to gst-player: 

https://github.com/sdroege/gst-player/pull/57
Comment 10 Víctor Manuel Jáquez Leal 2015-06-11 16:34:02 UTC
Created attachment 305088 [details] [review]
vaapipostproc: add color balance interface
Comment 11 Víctor Manuel Jáquez Leal 2015-06-11 17:12:28 UTC
I have setup a branch for gst-player to play with vaapipostproc controls using gtk ui:

https://github.com/ceyusa/gst-player/tree/vaapipostproc

The interesting thing is, if I enable the STE, and then play with the color balance channels, I got a crash:

gen75_picture_process.c:169: VAStatus gen75_proc_picture(VADriverContextP, VAProfile, union codec_state *, struct hw_context *): Assertion `pipeline_param->num_filters <= 4' failed.
Aborted

Perpahs we need to handle this. Perhaps the fix belongs to libva-driver-intel.
Comment 12 Víctor Manuel Jáquez Leal 2015-06-11 17:13:12 UTC
By the way, the color balance support in gst-player has been merged \o/
Comment 13 Gwenole Beauchesne 2015-06-12 13:32:14 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #11)
> I have setup a branch for gst-player to play with vaapipostproc controls
> using gtk ui:
> 
> https://github.com/ceyusa/gst-player/tree/vaapipostproc
> 
> The interesting thing is, if I enable the STE, and then play with the color
> balance channels, I got a crash:
> 
> gen75_picture_process.c:169: VAStatus gen75_proc_picture(VADriverContextP,
> VAProfile, union codec_state *, struct hw_context *): Assertion
> `pipeline_param->num_filters <= 4' failed.
> Aborted
> 
> Perpahs we need to handle this. Perhaps the fix belongs to
> libva-driver-intel.

The fix indeed belongs to libva-intel-driver. Thanks.
Comment 14 Gwenole Beauchesne 2015-06-12 13:44:39 UTC
Review of attachment 305088 [details] [review]:

::: gst/vaapi/gstvaapipostproc.c
@@ +1652,3 @@
+  postproc->saturation = DEFAULT_SATURATION;
+  postproc->brightness = DEFAULT_BRIGHTNESS;
+  postproc->contrast = DEFAULT_CONTRAST;

You can get the default values from the filter_ops pspec.

@@ +1731,3 @@
+
+  for (i = 0; i < G_N_ELEMENTS (cb_channels); i++) {
+    if (g_strcmp0 (channel->label, cb_channels[i].name) == 0)

I believe the common usage is to delegate that to g_ascii_strcasecmp(). Check e.g. vaapisink. :)

@@ +1737,3 @@
+  return 0;
+}
+

You can add a cb_get_value_ptr() that returns a pointer to the gfloat, or NULL if not found. Then use that in set/get to set the final value. Besides, if you follow the H/S/B/C order, then setting up, or clearing, the relevant GST_VAAPI_POSTPROC_FLAG_xxx can be easily based upon GST_VAAPI_POSTPROC_FLAG_HUE + i where i = (op - GST_VAAPI_FILTER_OP_HUE).
Comment 15 Víctor Manuel Jáquez Leal 2015-06-12 17:23:34 UTC
Created attachment 305170 [details] [review]
vaapipostproc: add color balance interface
Comment 16 Víctor Manuel Jáquez Leal 2015-06-16 13:26:50 UTC
Attachment 305170 [details] pushed as cbc2d15 - vaapipostproc: add color balance interface