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 795850 - textoverlay: add background-color property
textoverlay: add background-color property
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Mac OS
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 797112 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-05-06 11:02 UTC by Philippe Normand
Modified: 2018-11-03 12:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.33 KB, patch)
2018-05-06 11:04 UTC, Philippe Normand
needs-work Details | Review
0001-subtitleoverlay-Add-background-color-property.patch (3.76 KB, patch)
2018-05-06 16:12 UTC, Philippe Normand
none Details | Review
0002-playsink-Add-subtitle-background-color-property.patch (6.94 KB, patch)
2018-05-06 16:13 UTC, Philippe Normand
none Details | Review
0003-playbin-Add-subtitle-background-color-property.patch (2.55 KB, patch)
2018-05-06 16:13 UTC, Philippe Normand
none Details | Review
0004-playbin3-Add-subtitle-background-color-property.patch (3.43 KB, patch)
2018-05-06 16:14 UTC, Philippe Normand
none Details | Review

Description Philippe Normand 2018-05-06 11:02:56 UTC
.
Comment 1 Philippe Normand 2018-05-06 11:04:15 UTC
Created attachment 371743 [details] [review]
patch
Comment 2 Nicolas Dufresne (ndufresne) 2018-05-06 13:34:05 UTC
Review of attachment 371743 [details] [review]:

Looks good to me.
Comment 3 Philippe Normand 2018-05-06 16:12:53 UTC
Created attachment 371757 [details] [review]
0001-subtitleoverlay-Add-background-color-property.patch
Comment 4 Philippe Normand 2018-05-06 16:13:25 UTC
Created attachment 371758 [details] [review]
0002-playsink-Add-subtitle-background-color-property.patch
Comment 5 Philippe Normand 2018-05-06 16:13:52 UTC
Created attachment 371759 [details] [review]
0003-playbin-Add-subtitle-background-color-property.patch
Comment 6 Philippe Normand 2018-05-06 16:14:19 UTC
Created attachment 371760 [details] [review]
0004-playbin3-Add-subtitle-background-color-property.patch
Comment 7 Philippe Normand 2018-05-08 08:47:21 UTC
Ideally though, I would also like to be able to configure the font color from GstPlayer, that would mean more properties duplicated :(

Perhaps textoverlay could handle a special configuration GstEvent? That event could be sent by GstPlayer and thus reduce the property churn... Any thoughts on this?
Comment 8 Philippe Normand 2018-06-16 13:49:06 UTC
(In reply to Philippe Normand from comment #7)
> Ideally though, I would also like to be able to configure the font color
> from GstPlayer, that would mean more properties duplicated :(
> 
> Perhaps textoverlay could handle a special configuration GstEvent? That
> event could be sent by GstPlayer and thus reduce the property churn... Any
> thoughts on this?

Thibault suggested to have a new "subtitle format" property in GstPlayer and playbin(3) that would describe:

- fg color
- bg color
- font
- what else? :)

Any thoughts about that idea?

Regardless, can someone please review the textoverlay patch?
Comment 9 Víctor Manuel Jáquez Leal 2018-06-18 11:14:28 UTC
I wonder what happen when the subtitles themselves defines their fg/bg color

Another subtitle properties I'd like to see is position and subtitle delay.
Comment 10 Philippe Normand 2018-06-18 11:23:25 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #9)
> I wonder what happen when the subtitles themselves defines their fg/bg color
> 

Right now subparse doesn't support this, afaik.
Comment 11 Nicolas Dufresne (ndufresne) 2018-09-10 13:25:53 UTC
*** Bug 797112 has been marked as a duplicate of this bug. ***
Comment 12 Sebastian Dröge (slomo) 2018-09-10 13:33:53 UTC
Review of attachment 371743 [details] [review]:

::: ext/pango/gstbasetextoverlay.c
@@ +2020,3 @@
+  cairo_set_source_rgba (cr, r / 255.0, g / 255.0, b / 255.0, a / 255.0);
+  cairo_rectangle (cr, ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height);
+  cairo_fill (cr);

It would be better to just do this as part of the clearing of the surface in the very beginning. Use the SOURCE instead of CLEAR operator for that then.

Also the ink rectangle is suboptimal. See the docs of pango_layout_get_extents():

> Computes the logical and ink extents of layout . Logical extents are usually what you want for
> positioning things. Note that both extents may have non-zero x and y. You may want to use those to
> offset where you render the layout. Not doing that is a very typical bug that shows up as right-to-
> left layouts not being correctly positioned in a layout with a set width.
Comment 13 GStreamer system administrator 2018-11-03 12:06:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/450.