1 From f19e83a1a69a3dbbeb16dc4bcee3fb87317bb65b Mon Sep 17 00:00:00 2001
2 From: Song Bing <b06498@freescale.com>
3 Date: Mon, 11 Jan 2016 14:51:17 +0800
4 Subject: [PATCH] MMFMWK-7030 [Linux_MX6QP_ARD]IMXCameraApp:When Enabled "save
5 time to image" item, preview, find the time can not display
8 As IPU need 8 pixels alignment, add one workaround in base text overlay
9 to generate 8 pixels alignment text video buffer. The side effect should
10 cause all text a little smaller.
12 Upstream-Status: Inappropriate [i.MX specific]
14 Signed-off-by: Song Bing b06498@freescale.com
16 ext/pango/gstbasetextoverlay.c | 12 ++++++++++--
17 1 file changed, 10 insertions(+), 2 deletions(-)
19 diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c
20 index 3e98aa1..de64c92 100755
21 --- a/ext/pango/gstbasetextoverlay.c
22 +++ b/ext/pango/gstbasetextoverlay.c
23 @@ -1545,7 +1545,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
24 gint unscaled_width, unscaled_height;
26 gboolean full_width = FALSE;
27 - double scalef = 1.0;
28 + double scalef = 1.0, scalefx, scalefy;
30 gdouble shadow_offset = 0.0;
31 gdouble outline_offset = 0.0;
32 @@ -1673,6 +1673,14 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
33 height = ceil (height * overlay->render_scale);
34 scalef *= overlay->render_scale;
36 + /* i.MX special, will cause text a little small */
37 + scalefx = scalef * ((gdouble)GST_ROUND_DOWN_8 (width)) / width;
38 + scalefy = scalef * ((gdouble)GST_ROUND_DOWN_8 (height)) / height;
39 + width = GST_ROUND_DOWN_8 (width);
40 + height = GST_ROUND_DOWN_8 (height);
41 + GST_DEBUG_OBJECT (overlay, "Rendering with width %d and height %d "
44 if (width <= 0 || height <= 0) {
45 g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock);
46 GST_DEBUG_OBJECT (overlay,
47 @@ -1689,7 +1697,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
48 /* Prepare the transformation matrix. Note that the transformation happens
49 * in reverse order. So for horizontal text, we will translate and then
50 * scale. This is important to understand which scale shall be used. */
51 - cairo_matrix_init_scale (&cairo_matrix, scalef, scalef);
52 + cairo_matrix_init_scale (&cairo_matrix, scalefx, scalefy);
54 if (overlay->use_vertical_render) {