summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch
blob: ea881200741a726e845dcf62292728e5627d0cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 6cf42c468e93b0aaa171961e059bc3e2fb915889 Mon Sep 17 00:00:00 2001
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date: Fri, 28 Apr 2017 14:35:19 +0300
Subject: [PATCH] gtk-play: Disable visualizations

This is a workaround for [YOCTO #11410] (audio playback is broken in
mediaplayer if vaapi is used). It disables visualizations and makes
sure we clear the window (otherwise nothing does that and result is
very ugly).

This patch should be removed when 11410 is fixed.

Upstream-Status: Inappropriate [bug workaround]
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 gtk/gtk-play.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
index 8ae0fea..63b9bb0 100644
--- a/gtk/gtk-play.c
+++ b/gtk/gtk-play.c
@@ -1401,6 +1401,15 @@ get_child_position (GtkOverlay * overlay, GtkWidget * widget,
   return TRUE;
 }
 
+/* Hack to make sure something gets drawn if visualizations are disabled */
+static gboolean
+draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data)
+{
+  cairo_set_source_rgb (cr, 0, 0, 0);
+  cairo_paint (cr);
+  return FALSE;
+}
+
 static void
 create_ui (GtkPlay * play)
 {
@@ -1431,6 +1440,8 @@ create_ui (GtkPlay * play)
     play->video_area = gtk_drawing_area_new ();
     g_signal_connect (play->video_area, "realize",
         G_CALLBACK (video_area_realize_cb), play);
+    g_signal_connect (play->video_area, "draw",
+        G_CALLBACK (draw_cb), NULL);
   }
   gtk_widget_set_events (play->video_area, GDK_EXPOSURE_MASK
       | GDK_LEAVE_NOTIFY_MASK
@@ -1753,7 +1764,7 @@ gtk_play_constructor (GType type, guint n_construct_params,
 
   /* enable visualization (by default playbin uses goom) */
   /* if visualization is enabled then use the first element */
-  gst_player_set_visualization_enabled (self->player, TRUE);
+  gst_player_set_visualization_enabled (self->player, FALSE);
 
   g_signal_connect (G_OBJECT (self), "show", G_CALLBACK (show_cb), NULL);
 
-- 
2.1.4