clutter-gst3.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. From 872fc2ed3d0339559e4023523fa0935f168f631a Mon Sep 17 00:00:00 2001
  2. From: Luis de Bethencourt <luis@debethencourt.com>
  3. Date: Tue, 28 Jul 2015 12:06:16 +0100
  4. Subject: clutter: upgrade to clutter-gst-3.0
  5. ---
  6. configure.ac | 4 ++--
  7. src/gst_engine.c | 2 +-
  8. src/gst_engine.h | 5 +++--
  9. src/snappy.c | 7 ++-----
  10. src/user_interface.h | 4 ++++
  11. 5 files changed, 12 insertions(+), 10 deletions(-)
  12. diff --git a/configure.ac b/configure.ac
  13. index b2986c6..75ffb8d 100644
  14. --- a/configure.ac
  15. +++ b/configure.ac
  16. @@ -35,7 +35,7 @@ AC_CANONICAL_HOST
  17. # keep one single GST_REQ, core/base should be same versions anyway
  18. GST_REQ=1.0.0
  19. CLUTTER_REQS=1.12.0
  20. -CLUTTER_GST_REQS=2.0.0
  21. +CLUTTER_GST_REQS=2.99.2
  22. CLUTTER_GTK_REQS=1.0.2
  23. GTK_REQS=3.5.0
  24. GIO_REQ=2.32
  25. @@ -55,7 +55,7 @@ PKG_CHECK_MODULES([CLUTTER],
  26. AC_SUBST(CLUTTER_CFLAGS)
  27. AC_SUBST(CLUTTER_LIBS)
  28. -PKG_CHECK_MODULES([CLUTTER_GST], [clutter-gst-2.0 >= $CLUTTER_GST_REQS])
  29. +PKG_CHECK_MODULES([CLUTTER_GST], [clutter-gst-3.0 >= $CLUTTER_GST_REQS])
  30. AC_SUBST(CLUTTER_GST_CFLAGS)
  31. AC_SUBST(CLUTTER_GST_LIBS)
  32. diff --git a/src/gst_engine.c b/src/gst_engine.c
  33. index 8fc16d4..431d77c 100644
  34. --- a/src/gst_engine.c
  35. +++ b/src/gst_engine.c
  36. @@ -724,7 +724,7 @@ cycle_streams (GstEngine * engine, guint streamid)
  37. /* Init GstEngine variables */
  38. gboolean
  39. -engine_init (GstEngine * engine, GstElement * sink)
  40. +engine_init (GstEngine * engine, ClutterGstVideoSink * sink)
  41. {
  42. engine->playing = FALSE;
  43. engine->direction_foward = TRUE;
  44. diff --git a/src/gst_engine.h b/src/gst_engine.h
  45. index 70dce63..1c044eb 100644
  46. --- a/src/gst_engine.h
  47. +++ b/src/gst_engine.h
  48. @@ -24,6 +24,7 @@
  49. #define __GST_ENGINE_H__
  50. #include <gst/gst.h>
  51. +#include <clutter-gst/clutter-gst.h>
  52. /* GStreamer Interfaces */
  53. #include <gst/video/navigation.h>
  54. @@ -50,7 +51,7 @@ struct _GstEngine
  55. gchar *uri;
  56. GstElement *player;
  57. - GstElement *sink;
  58. + ClutterGstVideoSink *sink;
  59. GstBus *bus;
  60. @@ -64,7 +65,7 @@ gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data);
  61. gboolean change_state (GstEngine * engine, gchar * state);
  62. gboolean check_missing_plugins_error (GstEngine * engine, GstMessage * msg);
  63. gboolean cycle_streams (GstEngine * engine, guint streamid);
  64. -gboolean engine_init (GstEngine * engine, GstElement * sink);
  65. +gboolean engine_init (GstEngine * engine, ClutterGstVideoSink * sink);
  66. gboolean engine_change_offset (GstEngine * engine, gint64 av_offest);
  67. gboolean engine_change_speed (GstEngine * engine, gdouble rate);
  68. void engine_load_uri (GstEngine * engine, gchar * uri);
  69. diff --git a/src/snappy.c b/src/snappy.c
  70. index c2bb2d0..c06fd10 100644
  71. --- a/src/snappy.c
  72. +++ b/src/snappy.c
  73. @@ -29,9 +29,6 @@
  74. #include <stdlib.h>
  75. #include <unistd.h>
  76. #include <string.h>
  77. -#include <clutter/clutter.h>
  78. -#include <clutter-gst/clutter-gst.h>
  79. -#include <clutter-gtk/clutter-gtk.h>
  80. #include "user_interface.h"
  81. @@ -160,7 +157,7 @@ main (int argc, char *argv[])
  82. UserInterface *ui = NULL;
  83. GstEngine *engine = NULL;
  84. ClutterActor *video_texture;
  85. - GstElement *sink;
  86. + ClutterGstVideoSink *sink;
  87. gboolean ok, blind = FALSE, fullscreen = FALSE, hide = FALSE, loop = FALSE;
  88. gboolean secret = FALSE, tags = FALSE;
  89. @@ -230,7 +227,7 @@ main (int argc, char *argv[])
  90. /* Gstreamer engine */
  91. engine = g_new (GstEngine, 1);
  92. - sink = gst_element_factory_make ("cluttersink", "video-sink");
  93. + sink = clutter_gst_video_sink_new ();
  94. if (sink == NULL) {
  95. g_print ("ERROR: Failed to create clutter-gst sink element\n");
  96. return FALSE;
  97. diff --git a/src/user_interface.h b/src/user_interface.h
  98. index 6fe43c5..b011da0 100644
  99. --- a/src/user_interface.h
  100. +++ b/src/user_interface.h
  101. @@ -23,6 +23,10 @@
  102. #ifndef __USER_INTERFACE_H__
  103. #define __USER_INTERFACE_H__
  104. +#include <clutter/clutter.h>
  105. +#include <clutter-gst/clutter-gst.h>
  106. +#include <clutter-gtk/clutter-gtk.h>
  107. +
  108. #include <gtk/gtk.h>
  109. #include "gst_engine.h"
  110. --
  111. cgit v0.11.2
  112. From f33f7a5e9424544884a37b264bf88ee1866a56ac Mon Sep 17 00:00:00 2001
  113. From: Luis de Bethencourt <luis@debethencourt.com>
  114. Date: Tue, 28 Jul 2015 14:02:44 +0100
  115. Subject: clutter: update method to create video texture
  116. ---
  117. src/snappy.c | 6 +++---
  118. 1 file changed, 3 insertions(+), 3 deletions(-)
  119. diff --git a/src/snappy.c b/src/snappy.c
  120. index c06fd10..94b6e5b 100644
  121. --- a/src/snappy.c
  122. +++ b/src/snappy.c
  123. @@ -222,8 +222,6 @@ main (int argc, char *argv[])
  124. ui->tags = tags;
  125. ui->data_dir = data_dir;
  126. interface_init (ui);
  127. - video_texture = g_object_new (CLUTTER_TYPE_TEXTURE, "disable-slicing", TRUE,
  128. - NULL);
  129. /* Gstreamer engine */
  130. engine = g_new (GstEngine, 1);
  131. @@ -232,7 +230,9 @@ main (int argc, char *argv[])
  132. g_print ("ERROR: Failed to create clutter-gst sink element\n");
  133. return FALSE;
  134. }
  135. - g_object_set (G_OBJECT (sink), "texture", video_texture, NULL);
  136. + video_texture = g_object_new (CLUTTER_TYPE_ACTOR, "content",
  137. + g_object_new (CLUTTER_GST_TYPE_CONTENT, "sink", sink, NULL),
  138. + "name", "texture", NULL);
  139. ok = engine_init (engine, sink);
  140. if (!ok)
  141. --
  142. cgit v0.11.2