pidgin-port-to-gst-1.0.patch 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. # HG changeset patch
  2. # User David Woodhouse <David.Woodhouse@intel.com>
  3. # Date 1426073959 0
  4. # Node ID 2415067473ba10a2090d6130b93204a3b537b05c
  5. # Parent 6b4576edf2a694ab55d0d06d3643c44601a75b15
  6. Support GStreamer 1.x and resync with trunk
  7. Index: pidgin-2.10.11/configure.ac
  8. ===================================================================
  9. --- pidgin-2.10.11.orig/configure.ac
  10. +++ pidgin-2.10.11/configure.ac
  11. @@ -741,42 +741,115 @@ AM_GCONF_SOURCE_2
  12. dnl #######################################################################
  13. dnl # Check for GStreamer
  14. dnl #######################################################################
  15. -dnl
  16. -dnl TODO: Depend on gstreamer >= 0.10.10, and remove the conditional use of
  17. -dnl gst_registry_fork_set_enabled.
  18. AC_ARG_ENABLE(gstreamer,
  19. - [AC_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
  20. + [AS_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
  21. enable_gst="$enableval", enable_gst="yes")
  22. +AC_ARG_WITH(gstreamer, [AS_HELP_STRING([--with-gstreamer=<version>],
  23. + [compile with GStreamer 0.10 or 1.0 interface (default: auto)])],
  24. + with_gstreamer="$withval", with_gstreamer="auto")
  25. if test "x$enable_gst" != "xno"; then
  26. - PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
  27. - AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
  28. - AC_SUBST(GSTREAMER_CFLAGS)
  29. - AC_SUBST(GSTREAMER_LIBS)
  30. - AC_CHECK_LIB(gstreamer-0.10, gst_registry_fork_set_enabled,
  31. - [ AC_DEFINE(GST_CAN_DISABLE_FORKING, [],
  32. - [Define if gst_registry_fork_set_enabled exists])],
  33. - [], [$GSTREAMER_LIBS])
  34. - ], [
  35. - AC_MSG_RESULT(no)
  36. - enable_gst="no"
  37. - if test "x$force_deps" = "xyes" ; then
  38. - AC_MSG_ERROR([
  39. + if test "x$with_gstreamer" == "xauto"; then
  40. + PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0], [
  41. + AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
  42. + with_gstreamer="1.0"
  43. + AC_SUBST(GSTREAMER_CFLAGS)
  44. + AC_SUBST(GSTREAMER_LIBS)
  45. + dnl Check whether forking stuff is required for this version.
  46. + ], [
  47. + PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
  48. + AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
  49. + with_gstreamer="0.10"
  50. + AC_SUBST(GSTREAMER_CFLAGS)
  51. + AC_SUBST(GSTREAMER_LIBS)
  52. + ], [
  53. + AC_MSG_RESULT(no)
  54. + enable_gst="no"
  55. + if test "x$force_deps" = "xyes" ; then
  56. + AC_MSG_ERROR([
  57. GStreamer development headers not found.
  58. Use --disable-gstreamer if you do not need GStreamer (sound) support.
  59. ])
  60. - fi])
  61. + fi
  62. + ])
  63. + ])
  64. + elif test "x$with_gstreamer" == "x1.0"; then
  65. + PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0], [
  66. + AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer 1.0 for playing sounds])
  67. + AC_SUBST(GSTREAMER_CFLAGS)
  68. + AC_SUBST(GSTREAMER_LIBS)
  69. + ], [
  70. + AC_MSG_RESULT(no)
  71. + enable_gst="no"
  72. + if test "x$force_deps" = "xyes" ; then
  73. + AC_MSG_ERROR([
  74. +GStreamer development headers not found.
  75. +Use --disable-gstreamer if you do not need GStreamer (sound) support.
  76. +])
  77. + fi
  78. + ])
  79. + elif test "x$with_gstreamer" == "x0.10"; then
  80. + PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
  81. + AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer 0.10 for playing sounds])
  82. + AC_SUBST(GSTREAMER_CFLAGS)
  83. + AC_SUBST(GSTREAMER_LIBS)
  84. + ], [
  85. + AC_MSG_RESULT(no)
  86. + enable_gst="no"
  87. + if test "x$force_deps" = "xyes" ; then
  88. + AC_MSG_ERROR([
  89. +GStreamer development headers not found.
  90. +Use --disable-gstreamer if you do not need GStreamer (sound) support.
  91. +])
  92. + fi
  93. + ])
  94. + else
  95. + AC_MSG_ERROR([--with-gstreamer must specify one of 0.10, 1.0 or auto.])
  96. + fi
  97. +fi
  98. +
  99. +if test "x$with_gtk" == "x3" -a "x$with_gstreamer" == "x0.10"; then
  100. + AC_MSG_ERROR([WebKitGTK+ 3.0 cannot be mixed with GStreamer 0.10.
  101. +Please switch to WebKitGTK+ 2.0 or GStreamer 1.0.])
  102. +elif test "x$with_gtk" == "x2" -a "x$with_gstreamer" == "x1.0"; then
  103. + AC_MSG_ERROR([WebKitGTK+ 2.0 cannot be mixed with GStreamer 1.0.
  104. +Please switch to WebKitGTK+ 3.0 or GStreamer 0.10.])
  105. +fi
  106. +if test "x$with_gstreamer" == "x0.10" -o "x$with_gstreamer" == "x1.0"; then
  107. + AC_SUBST(GSTREAMER_VER, [$with_gstreamer])
  108. +else
  109. + AC_SUBST(GSTREAMER_VER, "")
  110. +fi
  111. +
  112. +dnl #######################################################################
  113. +dnl # Check for GStreamer Video
  114. +dnl #######################################################################
  115. +if test "x$enable_gst" != "xno" -a "x$with_gstreamer" == "x1.0"; then
  116. + AC_ARG_ENABLE(gstreamer-video,
  117. + [AS_HELP_STRING([--disable-gstreamer-video], [compile without GStreamer 1.0 Video Overlay support])],
  118. + enable_gstvideo="$enableval", enable_gstvideo="yes")
  119. + if test "x$enable_gstvideo" != "xno"; then
  120. + PKG_CHECK_MODULES(GSTVIDEO, [gstreamer-video-1.0], [
  121. + AC_DEFINE(USE_GSTVIDEO, 1, [Use GStreamer Video Overlay support])
  122. + AC_SUBST(GSTVIDEO_CFLAGS)
  123. + AC_SUBST(GSTVIDEO_LIBS)
  124. + ], [
  125. + enable_gstvideo="no"
  126. + ])
  127. + fi
  128. +else
  129. + enable_gstvideo="no"
  130. fi
  131. dnl #######################################################################
  132. dnl # Check for GStreamer Interfaces
  133. dnl #######################################################################
  134. -if test "x$enable_gst" != "xno"; then
  135. +if test "x$enable_gst" != "xno" -a "x$with_gstreamer" == "x0.10"; then
  136. AC_ARG_ENABLE(gstreamer-interfaces,
  137. - [AC_HELP_STRING([--disable-gstreamer-interfaces], [compile without GStreamer interface support])],
  138. + [AS_HELP_STRING([--disable-gstreamer-interfaces], [compile without GStreamer 0.10 interface support])],
  139. enable_gstinterfaces="$enableval", enable_gstinterfaces="yes")
  140. if test "x$enable_gstinterfaces" != "xno"; then
  141. PKG_CHECK_MODULES(GSTINTERFACES, [gstreamer-interfaces-0.10], [
  142. - AC_DEFINE(USE_GSTINTERFACES, 1, [Use GStreamer interfaces for X overlay support])
  143. + AC_DEFINE(USE_GSTINTERFACES, 1, [Use GStreamer 0.10 interfaces for X overlay support])
  144. AC_SUBST(GSTINTERFACES_CFLAGS)
  145. AC_SUBST(GSTINTERFACES_LIBS)
  146. ], [
  147. @@ -791,32 +864,43 @@ dnl ####################################
  148. dnl # Check for Farstream
  149. dnl #######################################################################
  150. AC_ARG_ENABLE(farstream,
  151. - [AC_HELP_STRING([--disable-farstream], [compile without farstream support])],
  152. + [AS_HELP_STRING([--disable-farstream], [compile without farstream support])],
  153. enable_farstream="$enableval", enable_farstream="yes")
  154. if test "x$enable_farstream" != "xno"; then
  155. - PKG_CHECK_MODULES(FARSTREAM, [farstream-0.1], [
  156. - AC_SUBST(FARSTREAM_CFLAGS)
  157. - AC_SUBST(FARSTREAM_LIBS)
  158. - ], [
  159. - # Try farsight.
  160. - PKG_CHECK_MODULES(FARSTREAM, [farsight2-0.10 >= 0.0.9], [
  161. - AC_DEFINE(HAVE_FARSIGHT, 1, [Use Farsight instead of Farstream])
  162. + if test "x$with_gstreamer" == "x1.0"; then
  163. + PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2], [
  164. AC_SUBST(FARSTREAM_CFLAGS)
  165. AC_SUBST(FARSTREAM_LIBS)
  166. ], [
  167. enable_farstream="no"
  168. ])
  169. - ])
  170. - fi
  171. + else
  172. + PKG_CHECK_MODULES(FARSTREAM, [farstream-0.1], [
  173. + AC_SUBST(FARSTREAM_CFLAGS)
  174. + AC_SUBST(FARSTREAM_LIBS)
  175. + ], [
  176. + # Try farsight.
  177. + PKG_CHECK_MODULES(FARSTREAM, [farsight2-0.10 >= 0.0.9], [
  178. + AC_DEFINE(HAVE_FARSIGHT, 1, [Use Farsight instead of Farstream])
  179. + AC_SUBST(FARSTREAM_CFLAGS)
  180. + AC_SUBST(FARSTREAM_LIBS)
  181. + ], [
  182. + enable_farstream="no"
  183. + ])
  184. + ])
  185. + fi
  186. +fi
  187. dnl #######################################################################
  188. dnl # Check for Voice and Video support
  189. dnl #######################################################################
  190. AC_ARG_ENABLE(vv,
  191. - [AC_HELP_STRING([--disable-vv], [compile without voice and video support])],
  192. + [AS_HELP_STRING([--disable-vv], [compile without voice and video support])],
  193. enable_vv="$enableval", enable_vv="yes")
  194. if test "x$enable_vv" != "xno"; then
  195. - if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno"; then
  196. + if test "x$enable_gst" != "xno" -a "x$with_gstreamer" == "x1.0" -a "x$enable_gstvideo" != "xno" -a "x$enable_farstream" != "xno"; then
  197. + AC_DEFINE(USE_VV, 1, [Use voice and video])
  198. + elif test "x$enable_gst" != "xno" -a "x$with_gstreamer" == "x0.10" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno"; then
  199. AC_DEFINE(USE_VV, 1, [Use voice and video])
  200. else
  201. enable_vv="no"
  202. @@ -829,7 +913,7 @@ Or use --disable-vv if you do not need v
  203. fi
  204. fi
  205. fi
  206. -AM_CONDITIONAL(USE_VV, test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno")
  207. +AM_CONDITIONAL(USE_VV, test "x$enable_vv" != "xno")
  208. dnl #######################################################################
  209. dnl # Check for Internationalized Domain Name support
  210. @@ -2619,6 +2703,7 @@ echo Protocols to build dynamically : $D
  211. echo Protocols to link statically.. : $STATIC_PRPLS
  212. echo
  213. echo Build with GStreamer support.. : $enable_gst
  214. +echo Build for GStreamer version... : $with_gstreamer
  215. echo Build with D-Bus support...... : $enable_dbus
  216. echo Build with voice and video.... : $enable_vv
  217. if test "x$enable_dbus" = "xyes" ; then
  218. Index: pidgin-2.10.11/finch/Makefile.am
  219. ===================================================================
  220. --- pidgin-2.10.11.orig/finch/Makefile.am
  221. +++ pidgin-2.10.11/finch/Makefile.am
  222. @@ -73,6 +73,7 @@ finch_LDADD = \
  223. $(LIBXML_LIBS) \
  224. $(GNT_LIBS) \
  225. $(GSTREAMER_LIBS) \
  226. + $(GSTVIDEO_LIBS) \
  227. ./libgnt/libgnt.la \
  228. $(top_builddir)/libpurple/libpurple.la
  229. Index: pidgin-2.10.11/libpurple/Makefile.am
  230. ===================================================================
  231. --- pidgin-2.10.11.orig/libpurple/Makefile.am
  232. +++ pidgin-2.10.11/libpurple/Makefile.am
  233. @@ -313,6 +313,7 @@ libpurple_la_LIBADD = \
  234. $(INTLLIBS) \
  235. $(FARSTREAM_LIBS) \
  236. $(GSTREAMER_LIBS) \
  237. + $(GSTVIDEO_LIBS) \
  238. $(GSTINTERFACES_LIBS) \
  239. $(IDN_LIBS) \
  240. ciphers/libpurple-ciphers.la \
  241. @@ -329,6 +330,7 @@ AM_CPPFLAGS = \
  242. $(LIBXML_CFLAGS) \
  243. $(FARSTREAM_CFLAGS) \
  244. $(GSTREAMER_CFLAGS) \
  245. + $(GSTVIDEO_CFLAGS) \
  246. $(GSTINTERFACES_CFLAGS) \
  247. $(IDN_CFLAGS) \
  248. $(NETWORKMANAGER_CFLAGS) \
  249. Index: pidgin-2.10.11/libpurple/data/purple.pc.in
  250. ===================================================================
  251. --- pidgin-2.10.11.orig/libpurple/data/purple.pc.in
  252. +++ pidgin-2.10.11/libpurple/data/purple.pc.in
  253. @@ -5,6 +5,7 @@ includedir=@includedir@
  254. datarootdir=@datarootdir@
  255. datadir=@datadir@
  256. sysconfdir=@sysconfdir@
  257. +gstreamer=@GSTREAMER_VER@
  258. plugindir=${libdir}/purple-@PURPLE_MAJOR_VERSION@
  259. Index: pidgin-2.10.11/libpurple/example/Makefile.am
  260. ===================================================================
  261. --- pidgin-2.10.11.orig/libpurple/example/Makefile.am
  262. +++ pidgin-2.10.11/libpurple/example/Makefile.am
  263. @@ -8,6 +8,7 @@ nullclient_LDADD = \
  264. $(INTLLIBS) \
  265. $(GLIB_LIBS) \
  266. $(LIBXML_LIBS) \
  267. + $(GSTVIDEO_LIBS) \
  268. $(top_builddir)/libpurple/libpurple.la
  269. AM_CPPFLAGS = \
  270. Index: pidgin-2.10.11/libpurple/media/backend-fs2.c
  271. ===================================================================
  272. --- pidgin-2.10.11.orig/libpurple/media/backend-fs2.c
  273. +++ pidgin-2.10.11/libpurple/media/backend-fs2.c
  274. @@ -41,6 +41,7 @@
  275. #include <farstream/fs-conference.h>
  276. #include <farstream/fs-element-added-notifier.h>
  277. #include <farstream/fs-utils.h>
  278. +#include <gst/gststructure.h>
  279. #endif
  280. /** @copydoc _PurpleMediaBackendFs2Class */
  281. @@ -242,9 +243,17 @@ purple_media_network_protocol_from_fs(Fs
  282. g_return_val_if_reached(PURPLE_MEDIA_NETWORK_PROTOCOL_TCP);
  283. }
  284. +#if GST_CHECK_VERSION(1,0,0)
  285. +static GstPadProbeReturn
  286. +event_probe_cb(GstPad *srcpad, GstPadProbeInfo *info, gpointer unused)
  287. +#else
  288. static gboolean
  289. event_probe_cb(GstPad *srcpad, GstEvent *event, gboolean release_pad)
  290. +#endif
  291. {
  292. +#if GST_CHECK_VERSION(1,0,0)
  293. + GstEvent *event = GST_PAD_PROBE_INFO_EVENT(info);
  294. +#endif
  295. if (GST_EVENT_TYPE(event) == GST_EVENT_CUSTOM_DOWNSTREAM
  296. && gst_event_has_name(event, "purple-unlink-tee")) {
  297. @@ -252,22 +261,40 @@ event_probe_cb(GstPad *srcpad, GstEvent
  298. gst_pad_unlink(srcpad, gst_pad_get_peer(srcpad));
  299. +#if GST_CHECK_VERSION(1,0,0)
  300. + gst_pad_remove_probe(srcpad,
  301. + g_value_get_ulong(gst_structure_get_value(s, "handler-id")));
  302. +#else
  303. gst_pad_remove_event_probe(srcpad,
  304. g_value_get_uint(gst_structure_get_value(s, "handler-id")));
  305. +#endif
  306. if (g_value_get_boolean(gst_structure_get_value(s, "release-pad")))
  307. gst_element_release_request_pad(GST_ELEMENT_PARENT(srcpad), srcpad);
  308. +#if GST_CHECK_VERSION(1,0,0)
  309. + return GST_PAD_PROBE_DROP;
  310. +#else
  311. return FALSE;
  312. +#endif
  313. }
  314. +#if GST_CHECK_VERSION(1,0,0)
  315. + return GST_PAD_PROBE_OK;
  316. +#else
  317. return TRUE;
  318. +#endif
  319. }
  320. static void
  321. unlink_teepad_dynamic(GstPad *srcpad, gboolean release_pad)
  322. {
  323. +#if GST_CHECK_VERSION(1,0,0)
  324. + gulong id = gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
  325. + event_probe_cb, NULL, NULL);
  326. +#else
  327. guint id = gst_pad_add_event_probe(srcpad, G_CALLBACK(event_probe_cb), NULL);
  328. +#endif
  329. if (GST_IS_GHOST_PAD(srcpad))
  330. srcpad = gst_ghost_pad_get_target(GST_GHOST_PAD(srcpad));
  331. @@ -276,7 +303,11 @@ unlink_teepad_dynamic(GstPad *srcpad, gb
  332. gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM,
  333. gst_structure_new("purple-unlink-tee",
  334. "release-pad", G_TYPE_BOOLEAN, release_pad,
  335. +#if GST_CHECK_VERSION(1,0,0)
  336. + "handler-id", G_TYPE_ULONG, id,
  337. +#else
  338. "handler-id", G_TYPE_UINT, id,
  339. +#endif
  340. NULL)));
  341. }
  342. @@ -859,15 +890,31 @@ gst_msg_db_to_percent(GstMessage *msg, g
  343. gdouble value_db;
  344. gdouble percent;
  345. - list = gst_structure_get_value(
  346. - gst_message_get_structure(msg), value_name);
  347. + list = gst_structure_get_value(gst_message_get_structure(msg), value_name);
  348. +#if GST_CHECK_VERSION(1,0,0)
  349. +G_GNUC_BEGIN_IGNORE_DEPRECATIONS
  350. + value = g_value_array_get_nth(g_value_get_boxed(list), 0);
  351. +G_GNUC_END_IGNORE_DEPRECATIONS
  352. +#else
  353. value = gst_value_list_get_value(list, 0);
  354. +#endif
  355. value_db = g_value_get_double(value);
  356. percent = pow(10, value_db / 20);
  357. return (percent > 1.0) ? 1.0 : percent;
  358. }
  359. static void
  360. +purple_media_error_fs(PurpleMedia *media, const gchar *error,
  361. + const GstStructure *fs_error)
  362. +{
  363. + const gchar *error_msg = gst_structure_get_string(fs_error, "error-msg");
  364. +
  365. + purple_media_error(media, "%s%s%s", error,
  366. + error_msg ? _("\n\nMessage from Farsight: ") : "",
  367. + error_msg ? error_msg : "");
  368. +}
  369. +
  370. +static void
  371. gst_handle_message_element(GstBus *bus, GstMessage *msg,
  372. PurpleMediaBackendFs2 *self)
  373. {
  374. @@ -875,11 +922,12 @@ gst_handle_message_element(GstBus *bus,
  375. PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self);
  376. GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
  377. static guint level_id = 0;
  378. + const GstStructure *structure = gst_message_get_structure(msg);
  379. if (level_id == 0)
  380. level_id = g_signal_lookup("level", PURPLE_TYPE_MEDIA);
  381. - if (gst_structure_has_name(msg->structure, "level")) {
  382. + if (gst_structure_has_name(structure, "level")) {
  383. GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
  384. gchar *name;
  385. gchar *participant = NULL;
  386. @@ -934,31 +982,63 @@ gst_handle_message_element(GstBus *bus,
  387. return;
  388. #ifdef HAVE_FARSIGHT
  389. - if (gst_structure_has_name(msg->structure, "farsight-error")) {
  390. + if (gst_structure_has_name(structure, "farsight-error")) {
  391. #else
  392. - if (gst_structure_has_name(msg->structure, "farstream-error")) {
  393. + if (gst_structure_has_name(structure, "farstream-error")) {
  394. #endif
  395. FsError error_no;
  396. - gst_structure_get_enum(msg->structure, "error-no",
  397. + gboolean error_emitted = FALSE;
  398. + gst_structure_get_enum(structure, "error-no",
  399. FS_TYPE_ERROR, (gint*)&error_no);
  400. switch (error_no) {
  401. + case FS_ERROR_CONSTRUCTION:
  402. + purple_media_error_fs(priv->media,
  403. + _("Error initializing the call. "
  404. + "This probably denotes problem in "
  405. +#ifdef HAVE_FARSIGHT
  406. + "installation of GStreamer or Farsight."),
  407. +#else
  408. + "installation of GStreamer or Farstream."),
  409. +#endif
  410. + structure);
  411. + error_emitted = TRUE;
  412. + break;
  413. + case FS_ERROR_NETWORK:
  414. + purple_media_error_fs(priv->media, _("Network error."),
  415. + structure);
  416. + error_emitted = TRUE;
  417. + purple_media_end(priv->media, NULL, NULL);
  418. + break;
  419. + case FS_ERROR_NEGOTIATION_FAILED:
  420. + purple_media_error_fs(priv->media,
  421. + _("Codec negotiation failed. "
  422. + "This problem might be resolved by installing "
  423. + "more GStreamer codecs."),
  424. + structure);
  425. + error_emitted = TRUE;
  426. + purple_media_end(priv->media, NULL, NULL);
  427. + break;
  428. case FS_ERROR_NO_CODECS:
  429. - purple_media_error(priv->media, _("No codecs"
  430. - " found. Install some"
  431. - " GStreamer codecs found"
  432. - " in GStreamer plugins"
  433. - " packages."));
  434. + purple_media_error(priv->media,
  435. + _("No codecs found. "
  436. + "Install some GStreamer codecs found "
  437. + "in GStreamer plugins packages."));
  438. + error_emitted = TRUE;
  439. purple_media_end(priv->media, NULL, NULL);
  440. break;
  441. #ifdef HAVE_FARSIGHT
  442. case FS_ERROR_NO_CODECS_LEFT:
  443. - purple_media_error(priv->media, _("No codecs"
  444. - " left. Your codec"
  445. - " preferences in"
  446. - " fs-codecs.conf are too"
  447. - " strict."));
  448. + purple_media_error(priv->media,
  449. + _("No codecs left. Your codec preferences "
  450. + "in fs-codecs.conf are too strict."));
  451. + error_emitted = TRUE;
  452. purple_media_end(priv->media, NULL, NULL);
  453. break;
  454. + case FS_ERROR_CONNECTION_FAILED:
  455. + purple_media_error(priv->media,
  456. + _("Could not connect to the remote party"));
  457. + error_emitted = TRUE;
  458. + break;
  459. case FS_ERROR_UNKNOWN_CNAME:
  460. /*
  461. * Unknown CName is only a problem for the
  462. @@ -975,22 +1055,22 @@ gst_handle_message_element(GstBus *bus,
  463. "farstream-error: %i: %s\n",
  464. #endif
  465. error_no,
  466. - gst_structure_get_string(
  467. - msg->structure, "error-msg"));
  468. + gst_structure_get_string(structure, "error-msg"));
  469. break;
  470. }
  471. if (FS_ERROR_IS_FATAL(error_no)) {
  472. + if (!error_emitted)
  473. #ifdef HAVE_FARSIGHT
  474. - purple_media_error(priv->media, _("A non-recoverable "
  475. - "Farsight2 error has occurred."));
  476. + purple_media_error(priv->media,
  477. + _("A non-recoverable Farsight2 error has occurred."));
  478. #else
  479. - purple_media_error(priv->media, _("A non-recoverable "
  480. - "Farstream error has occurred."));
  481. + purple_media_error(priv->media,
  482. + _("A non-recoverable Farstream error has occurred."));
  483. #endif
  484. purple_media_end(priv->media, NULL, NULL);
  485. }
  486. - } else if (gst_structure_has_name(msg->structure,
  487. + } else if (gst_structure_has_name(structure,
  488. #ifdef HAVE_FARSIGHT
  489. "farsight-new-local-candidate")) {
  490. #else
  491. @@ -1005,9 +1085,9 @@ gst_handle_message_element(GstBus *bus,
  492. PurpleMediaBackendFs2Stream *media_stream;
  493. gchar *name;
  494. - value = gst_structure_get_value(msg->structure, "stream");
  495. + value = gst_structure_get_value(structure, "stream");
  496. stream = g_value_get_object(value);
  497. - value = gst_structure_get_value(msg->structure, "candidate");
  498. + value = gst_structure_get_value(structure, "candidate");
  499. local_candidate = g_value_get_boxed(value);
  500. session = get_session_from_fs_stream(self, stream);
  501. @@ -1029,7 +1109,7 @@ gst_handle_message_element(GstBus *bus,
  502. g_signal_emit_by_name(self, "new-candidate",
  503. session->id, name, candidate);
  504. g_object_unref(candidate);
  505. - } else if (gst_structure_has_name(msg->structure,
  506. + } else if (gst_structure_has_name(structure,
  507. #ifdef HAVE_FARSIGHT
  508. "farsight-local-candidates-prepared")) {
  509. #else
  510. @@ -1041,7 +1121,7 @@ gst_handle_message_element(GstBus *bus,
  511. PurpleMediaBackendFs2Session *session;
  512. gchar *name;
  513. - value = gst_structure_get_value(msg->structure, "stream");
  514. + value = gst_structure_get_value(structure, "stream");
  515. stream = g_value_get_object(value);
  516. session = get_session_from_fs_stream(self, stream);
  517. @@ -1051,7 +1131,7 @@ gst_handle_message_element(GstBus *bus,
  518. g_signal_emit_by_name(self, "candidates-prepared",
  519. session->id, name);
  520. - } else if (gst_structure_has_name(msg->structure,
  521. + } else if (gst_structure_has_name(structure,
  522. #ifdef HAVE_FARSIGHT
  523. "farsight-new-active-candidate-pair")) {
  524. #else
  525. @@ -1066,13 +1146,11 @@ gst_handle_message_element(GstBus *bus,
  526. PurpleMediaCandidate *lcandidate, *rcandidate;
  527. gchar *name;
  528. - value = gst_structure_get_value(msg->structure, "stream");
  529. + value = gst_structure_get_value(structure, "stream");
  530. stream = g_value_get_object(value);
  531. - value = gst_structure_get_value(msg->structure,
  532. - "local-candidate");
  533. + value = gst_structure_get_value(structure, "local-candidate");
  534. local_candidate = g_value_get_boxed(value);
  535. - value = gst_structure_get_value(msg->structure,
  536. - "remote-candidate");
  537. + value = gst_structure_get_value(structure, "remote-candidate");
  538. remote_candidate = g_value_get_boxed(value);
  539. g_object_get(stream, "participant", &participant, NULL);
  540. @@ -1089,7 +1167,7 @@ gst_handle_message_element(GstBus *bus,
  541. g_object_unref(lcandidate);
  542. g_object_unref(rcandidate);
  543. - } else if (gst_structure_has_name(msg->structure,
  544. + } else if (gst_structure_has_name(structure,
  545. #ifdef HAVE_FARSIGHT
  546. "farsight-recv-codecs-changed")) {
  547. #else
  548. @@ -1099,7 +1177,7 @@ gst_handle_message_element(GstBus *bus,
  549. GList *codecs;
  550. FsCodec *codec;
  551. - value = gst_structure_get_value(msg->structure, "codecs");
  552. + value = gst_structure_get_value(structure, "codecs");
  553. codecs = g_value_get_boxed(value);
  554. codec = codecs->data;
  555. @@ -1110,7 +1188,7 @@ gst_handle_message_element(GstBus *bus,
  556. "farstream-recv-codecs-changed: %s\n",
  557. #endif
  558. codec->encoding_name);
  559. - } else if (gst_structure_has_name(msg->structure,
  560. + } else if (gst_structure_has_name(structure,
  561. #ifdef HAVE_FARSIGHT
  562. "farsight-component-state-changed")) {
  563. #else
  564. @@ -1121,9 +1199,9 @@ gst_handle_message_element(GstBus *bus,
  565. guint component;
  566. const gchar *state;
  567. - value = gst_structure_get_value(msg->structure, "state");
  568. + value = gst_structure_get_value(structure, "state");
  569. fsstate = g_value_get_enum(value);
  570. - value = gst_structure_get_value(msg->structure, "component");
  571. + value = gst_structure_get_value(structure, "component");
  572. component = g_value_get_uint(value);
  573. switch (fsstate) {
  574. @@ -1158,7 +1236,7 @@ gst_handle_message_element(GstBus *bus,
  575. #endif
  576. "component: %u state: %s\n",
  577. component, state);
  578. - } else if (gst_structure_has_name(msg->structure,
  579. + } else if (gst_structure_has_name(structure,
  580. #ifdef HAVE_FARSIGHT
  581. "farsight-send-codec-changed")) {
  582. #else
  583. @@ -1168,7 +1246,7 @@ gst_handle_message_element(GstBus *bus,
  584. FsCodec *codec;
  585. gchar *codec_str;
  586. - value = gst_structure_get_value(msg->structure, "codec");
  587. + value = gst_structure_get_value(structure, "codec");
  588. codec = g_value_get_boxed(value);
  589. codec_str = fs_codec_to_string(codec);
  590. @@ -1181,7 +1259,7 @@ gst_handle_message_element(GstBus *bus,
  591. codec_str);
  592. g_free(codec_str);
  593. - } else if (gst_structure_has_name(msg->structure,
  594. + } else if (gst_structure_has_name(structure,
  595. #ifdef HAVE_FARSIGHT
  596. "farsight-codecs-changed")) {
  597. #else
  598. @@ -1191,7 +1269,7 @@ gst_handle_message_element(GstBus *bus,
  599. FsSession *fssession;
  600. GList *sessions;
  601. - value = gst_structure_get_value(msg->structure, "session");
  602. + value = gst_structure_get_value(structure, "session");
  603. fssession = g_value_get_object(value);
  604. sessions = g_hash_table_get_values(priv->sessions);
  605. @@ -1635,7 +1713,11 @@ create_src(PurpleMediaBackendFs2 *self,
  606. srcpad = gst_element_get_static_pad(session->srcvalve, "src");
  607. g_object_set(volume, "volume", input_volume, NULL);
  608. } else {
  609. +#if GST_CHECK_VERSION(1,0,0)
  610. + srcpad = gst_element_get_request_pad(session->tee, "src_%u");
  611. +#else
  612. srcpad = gst_element_get_request_pad(session->tee, "src%d");
  613. +#endif
  614. }
  615. purple_debug_info("backend-fs2", "connecting pad: %s\n",
  616. @@ -1645,11 +1727,14 @@ create_src(PurpleMediaBackendFs2 *self,
  617. gst_object_unref(session->src);
  618. gst_object_unref(sinkpad);
  619. - gst_element_set_state(session->src, GST_STATE_PLAYING);
  620. -
  621. purple_media_manager_create_output_window(purple_media_get_manager(
  622. priv->media), priv->media, sess_id, NULL);
  623. + purple_debug_info("backend-fs2", "create_src: setting source "
  624. + "state to GST_STATE_PLAYING - it may hang here on win32\n");
  625. + gst_element_set_state(session->src, GST_STATE_PLAYING);
  626. + purple_debug_info("backend-fs2", "create_src: state set\n");
  627. +
  628. return TRUE;
  629. }
  630. @@ -1853,14 +1938,10 @@ src_pad_added_cb(FsStream *fsstream, Gst
  631. * audioresample ! audioconvert ! realsink
  632. */
  633. stream->queue = gst_element_factory_make("queue", NULL);
  634. - stream->volume = gst_element_factory_make(
  635. - "volume", NULL);
  636. - g_object_set(stream->volume, "volume",
  637. - output_volume, NULL);
  638. - stream->level = gst_element_factory_make(
  639. - "level", NULL);
  640. - stream->src = gst_element_factory_make(
  641. - "liveadder", NULL);
  642. + stream->volume = gst_element_factory_make("volume", NULL);
  643. + g_object_set(stream->volume, "volume", output_volume, NULL);
  644. + stream->level = gst_element_factory_make("level", NULL);
  645. + stream->src = gst_element_factory_make("liveadder", NULL);
  646. sink = purple_media_manager_get_element(
  647. purple_media_get_manager(priv->media),
  648. PURPLE_MEDIA_RECV_AUDIO, priv->media,
  649. @@ -1879,10 +1960,12 @@ src_pad_added_cb(FsStream *fsstream, Gst
  650. gst_element_link(stream->queue, stream->volume);
  651. sink = stream->queue;
  652. } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) {
  653. - stream->src = gst_element_factory_make(
  654. - "fsfunnel", NULL);
  655. - sink = gst_element_factory_make(
  656. - "fakesink", NULL);
  657. +#if GST_CHECK_VERSION(1,0,0)
  658. + stream->src = gst_element_factory_make("funnel", NULL);
  659. +#else
  660. + stream->src = gst_element_factory_make("fsfunnel", NULL);
  661. +#endif
  662. + sink = gst_element_factory_make("fakesink", NULL);
  663. g_object_set(G_OBJECT(sink), "async", FALSE, NULL);
  664. gst_bin_add(GST_BIN(priv->confbin), sink);
  665. gst_element_set_state(sink, GST_STATE_PLAYING);
  666. @@ -1896,7 +1979,11 @@ src_pad_added_cb(FsStream *fsstream, Gst
  667. gst_element_link_many(stream->src, stream->tee, sink, NULL);
  668. }
  669. +#if GST_CHECK_VERSION(1,0,0)
  670. + sinkpad = gst_element_get_request_pad(stream->src, "sink_%u");
  671. +#else
  672. sinkpad = gst_element_get_request_pad(stream->src, "sink%d");
  673. +#endif
  674. gst_pad_link(srcpad, sinkpad);
  675. gst_object_unref(sinkpad);
  676. @@ -2078,8 +2165,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
  677. if (!fs_stream_set_transmitter(fsstream, transmitter,
  678. _params, _num_params, &err)) {
  679. purple_debug_error("backend-fs2",
  680. - "Could not set transmitter %s: %s.\n",
  681. - transmitter, err->message);
  682. + "Could not set transmitter %s: %s.\n",
  683. + transmitter, err ? err->message : NULL);
  684. g_clear_error(&err);
  685. g_free(_params);
  686. return FALSE;
  687. @@ -2398,14 +2485,44 @@ purple_media_backend_fs2_set_send_codec(
  688. return TRUE;
  689. }
  690. +static const gchar **
  691. +purple_media_backend_fs2_get_available_params(void)
  692. +{
  693. + static const gchar *supported_params[] = {
  694. + "sdes-cname", "sdes-email", "sdes-location", "sdes-name", "sdes-note",
  695. + "sdes-phone", "sdes-tool", NULL
  696. + };
  697. +
  698. + return supported_params;
  699. +}
  700. +
  701. +static const gchar*
  702. +param_to_sdes_type(const gchar *param)
  703. +{
  704. + const gchar **supported = purple_media_backend_fs2_get_available_params();
  705. + static const gchar *sdes_types[] = {
  706. + "cname", "email", "location", "name", "note", "phone", "tool", NULL
  707. + };
  708. + guint i;
  709. +
  710. + for (i = 0; supported[i] != NULL; ++i) {
  711. + if (!strcmp(param, supported[i])) {
  712. + return sdes_types[i];
  713. + }
  714. + }
  715. +
  716. + return NULL;
  717. +}
  718. +
  719. static void
  720. purple_media_backend_fs2_set_params(PurpleMediaBackend *self,
  721. guint num_params, GParameter *params)
  722. {
  723. PurpleMediaBackendFs2Private *priv;
  724. - const gchar **supported = purple_media_backend_fs2_get_available_params();
  725. - const gchar **p;
  726. guint i;
  727. +#ifndef HAVE_FARSIGHT
  728. + GstStructure *sdes;
  729. +#endif
  730. g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self));
  731. @@ -2418,27 +2535,30 @@ purple_media_backend_fs2_set_params(Purp
  732. return;
  733. }
  734. +#ifdef HAVE_FARSIGHT
  735. for (i = 0; i != num_params; ++i) {
  736. - for (p = supported; *p != NULL; ++p) {
  737. - if (!strcmp(params[i].name, *p)) {
  738. - g_object_set(priv->conference,
  739. - params[i].name, g_value_get_string(&params[i].value),
  740. - NULL);
  741. - break;
  742. - }
  743. + if (param_to_sdes_type(params[i].name)) {
  744. + g_object_set(priv->conference,
  745. + params[i].name, g_value_get_string(&params[i].value),
  746. + NULL);
  747. }
  748. }
  749. -}
  750. +#else
  751. + g_object_get(G_OBJECT(priv->conference), "sdes", &sdes, NULL);
  752. -static const gchar **
  753. -purple_media_backend_fs2_get_available_params(void)
  754. -{
  755. - static const gchar *supported_params[] = {
  756. - "sdes-cname", "sdes-email", "sdes-location", "sdes-name", "sdes-note",
  757. - "sdes-phone", "sdes-tool", NULL
  758. - };
  759. + for (i = 0; i != num_params; ++i) {
  760. + const gchar *sdes_type = param_to_sdes_type(params[i].name);
  761. + if (!sdes_type)
  762. + continue;
  763. - return supported_params;
  764. + gst_structure_set(sdes, sdes_type,
  765. + G_TYPE_STRING, g_value_get_string(&params[i].value),
  766. + NULL);
  767. + }
  768. +
  769. + g_object_set(G_OBJECT(priv->conference), "sdes", sdes, NULL);
  770. + gst_structure_free(sdes);
  771. +#endif /* HAVE_FARSIGHT */
  772. }
  773. static gboolean
  774. send_dtmf_callback(gpointer userdata)
  775. Index: pidgin-2.10.11/libpurple/mediamanager.c
  776. ===================================================================
  777. --- pidgin-2.10.11.orig/libpurple/mediamanager.c
  778. +++ pidgin-2.10.11/libpurple/mediamanager.c
  779. @@ -44,7 +44,12 @@
  780. #else
  781. #include <farstream/fs-element-added-notifier.h>
  782. #endif
  783. +
  784. +#if GST_CHECK_VERSION(1,0,0)
  785. +#include <gst/video/videooverlay.h>
  786. +#else
  787. #include <gst/interfaces/xoverlay.h>
  788. +#endif
  789. /** @copydoc _PurpleMediaManagerPrivate */
  790. typedef struct _PurpleMediaManagerPrivate PurpleMediaManagerPrivate;
  791. @@ -270,8 +275,11 @@ purple_media_manager_get_pipeline(Purple
  792. gst_bus_add_signal_watch(GST_BUS(bus));
  793. g_signal_connect(G_OBJECT(bus), "message",
  794. G_CALLBACK(pipeline_bus_call), manager);
  795. - gst_bus_set_sync_handler(bus,
  796. - gst_bus_sync_signal_handler, NULL);
  797. +#if GST_CHECK_VERSION(1,0,0)
  798. + gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL, NULL);
  799. +#else
  800. + gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL);
  801. +#endif
  802. gst_object_unref(bus);
  803. filename = g_build_filename(purple_user_dir(),
  804. @@ -405,20 +413,31 @@ request_pad_unlinked_cb(GstPad *pad, Gst
  805. {
  806. GstElement *parent = GST_ELEMENT_PARENT(pad);
  807. GstIterator *iter;
  808. +#if GST_CHECK_VERSION(1,0,0)
  809. + GValue tmp = G_VALUE_INIT;
  810. +#endif
  811. GstPad *remaining_pad;
  812. GstIteratorResult result;
  813. - gst_element_release_request_pad(GST_ELEMENT_PARENT(pad), pad);
  814. + gst_element_release_request_pad(parent, pad);
  815. iter = gst_element_iterate_src_pads(parent);
  816. +#if GST_CHECK_VERSION(1,0,0)
  817. + result = gst_iterator_next(iter, &tmp);
  818. +#else
  819. result = gst_iterator_next(iter, (gpointer)&remaining_pad);
  820. +#endif
  821. if (result == GST_ITERATOR_DONE) {
  822. gst_element_set_locked_state(parent, TRUE);
  823. gst_element_set_state(parent, GST_STATE_NULL);
  824. gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(parent)), parent);
  825. } else if (result == GST_ITERATOR_OK) {
  826. +#if GST_CHECK_VERSION(1,0,0)
  827. + remaining_pad = g_value_get_object(&tmp);
  828. + g_value_reset(&tmp);
  829. +#endif
  830. gst_object_unref(remaining_pad);
  831. }
  832. @@ -456,7 +475,11 @@ purple_media_manager_get_video_caps(Purp
  833. {
  834. #ifdef USE_VV
  835. if (manager->priv->video_caps == NULL)
  836. +#if GST_CHECK_VERSION(1,0,0)
  837. + manager->priv->video_caps = gst_caps_from_string("video/x-raw,"
  838. +#else
  839. manager->priv->video_caps = gst_caps_from_string("video/x-raw-yuv,"
  840. +#endif
  841. "width=[250,352], height=[200,288], framerate=[1/1,20/1]");
  842. return manager->priv->video_caps;
  843. #else
  844. @@ -539,7 +562,11 @@ purple_media_manager_get_element(PurpleM
  845. g_free(id);
  846. tee = gst_bin_get_by_name(GST_BIN(ret), "tee");
  847. +#if GST_CHECK_VERSION(1,0,0)
  848. + pad = gst_element_get_request_pad(tee, "src_%u");
  849. +#else
  850. pad = gst_element_get_request_pad(tee, "src%d");
  851. +#endif
  852. gst_object_unref(tee);
  853. ghost = gst_ghost_pad_new(NULL, pad);
  854. gst_object_unref(pad);
  855. @@ -730,9 +757,12 @@ window_id_cb(GstBus *bus, GstMessage *ms
  856. {
  857. GstElement *sink;
  858. - if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT ||
  859. - !gst_structure_has_name(msg->structure,
  860. - "prepare-xwindow-id"))
  861. + if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT
  862. +#if GST_CHECK_VERSION(1,0,0)
  863. + || !gst_is_video_overlay_prepare_window_handle_message(msg))
  864. +#else
  865. + || !gst_structure_has_name(msg->structure, "prepare-xwindow-id"))
  866. +#endif
  867. return;
  868. sink = GST_ELEMENT(GST_MESSAGE_SRC(msg));
  869. @@ -746,8 +776,16 @@ window_id_cb(GstBus *bus, GstMessage *ms
  870. | G_SIGNAL_MATCH_DATA, 0, 0, NULL,
  871. window_id_cb, ow);
  872. - gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(
  873. - GST_MESSAGE_SRC(msg)), ow->window_id);
  874. +#if GST_CHECK_VERSION(1,0,0)
  875. + gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)),
  876. + ow->window_id);
  877. +#elif GST_CHECK_VERSION(0,10,31)
  878. + gst_x_overlay_set_window_handle(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)),
  879. + ow->window_id);
  880. +#else
  881. + gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)),
  882. + ow->window_id);
  883. +#endif
  884. }
  885. #endif
  886. @@ -772,17 +810,19 @@ purple_media_manager_create_output_windo
  887. (participant == ow->participant)) &&
  888. !strcmp(session_id, ow->session_id)) {
  889. GstBus *bus;
  890. - GstElement *queue, *colorspace;
  891. + GstElement *queue, *convert;
  892. GstElement *tee = purple_media_get_tee(media,
  893. session_id, participant);
  894. if (tee == NULL)
  895. continue;
  896. - queue = gst_element_factory_make(
  897. - "queue", NULL);
  898. - colorspace = gst_element_factory_make(
  899. - "ffmpegcolorspace", NULL);
  900. + queue = gst_element_factory_make("queue", NULL);
  901. +#if GST_CHECK_VERSION(1,0,0)
  902. + convert = gst_element_factory_make("videoconvert", NULL);
  903. +#else
  904. + convert = gst_element_factory_make("ffmpegcolorspace", NULL);
  905. +#endif
  906. ow->sink = purple_media_manager_get_element(
  907. manager, PURPLE_MEDIA_RECV_VIDEO,
  908. ow->media, ow->session_id,
  909. @@ -795,7 +835,7 @@ purple_media_manager_create_output_windo
  910. if (g_object_class_find_property(klass,
  911. "sync"))
  912. g_object_set(G_OBJECT(ow->sink),
  913. - "sync", "FALSE", NULL);
  914. + "sync", FALSE, NULL);
  915. if (g_object_class_find_property(klass,
  916. "async"))
  917. g_object_set(G_OBJECT(ow->sink),
  918. @@ -803,7 +843,7 @@ purple_media_manager_create_output_windo
  919. }
  920. gst_bin_add_many(GST_BIN(GST_ELEMENT_PARENT(tee)),
  921. - queue, colorspace, ow->sink, NULL);
  922. + queue, convert, ow->sink, NULL);
  923. bus = gst_pipeline_get_bus(GST_PIPELINE(
  924. manager->priv->pipeline));
  925. @@ -812,10 +852,10 @@ purple_media_manager_create_output_windo
  926. gst_object_unref(bus);
  927. gst_element_set_state(ow->sink, GST_STATE_PLAYING);
  928. - gst_element_set_state(colorspace, GST_STATE_PLAYING);
  929. + gst_element_set_state(convert, GST_STATE_PLAYING);
  930. gst_element_set_state(queue, GST_STATE_PLAYING);
  931. - gst_element_link(colorspace, ow->sink);
  932. - gst_element_link(queue, colorspace);
  933. + gst_element_link(convert, ow->sink);
  934. + gst_element_link(queue, convert);
  935. gst_element_link(tee, queue);
  936. }
  937. }
  938. Index: pidgin-2.10.11/pidgin/Makefile.am
  939. ===================================================================
  940. --- pidgin-2.10.11.orig/pidgin/Makefile.am
  941. +++ pidgin-2.10.11/pidgin/Makefile.am
  942. @@ -151,6 +151,7 @@ pidgin_LDADD = \
  943. $(GLIB_LIBS) \
  944. $(DBUS_LIBS) \
  945. $(GSTREAMER_LIBS) \
  946. + $(GSTVIDEO_LIBS) \
  947. $(XSS_LIBS) \
  948. $(SM_LIBS) \
  949. $(INTLLIBS) \
  950. Index: pidgin-2.10.11/pidgin/gtkmedia.c
  951. ===================================================================
  952. --- pidgin-2.10.11.orig/pidgin/gtkmedia.c
  953. +++ pidgin-2.10.11/pidgin/gtkmedia.c
  954. @@ -43,7 +43,9 @@
  955. #endif
  956. #include <gdk/gdkkeysyms.h>
  957. +#if !GST_CHECK_VERSION(1,0,0)
  958. #include <gst/interfaces/xoverlay.h>
  959. +#endif
  960. #define PIDGIN_TYPE_MEDIA (pidgin_media_get_type())
  961. #define PIDGIN_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PIDGIN_TYPE_MEDIA, PidginMedia))
  962. @@ -590,6 +592,9 @@ pidgin_media_error_cb(PidginMedia *media
  963. if (conv != NULL)
  964. purple_conversation_write(conv, NULL, error,
  965. PURPLE_MESSAGE_ERROR, time(NULL));
  966. + else
  967. + purple_notify_error(NULL, NULL, _("Media error"), error);
  968. +
  969. gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar),
  970. 0, error);
  971. }
  972. Index: pidgin-2.10.11/pidgin/plugins/vvconfig.c
  973. ===================================================================
  974. --- pidgin-2.10.11.orig/pidgin/plugins/vvconfig.c
  975. +++ pidgin-2.10.11/pidgin/plugins/vvconfig.c
  976. @@ -26,7 +26,11 @@
  977. #include "gtkutils.h"
  978. #include "gtkprefs.h"
  979. +#if GST_CHECK_VERSION(1,0,0)
  980. +#include <gst/video/videooverlay.h>
  981. +#else
  982. #include <gst/interfaces/propertyprobe.h>
  983. +#endif
  984. /* container window for showing a stand-alone configurator */
  985. static GtkWidget *window = NULL;
  986. @@ -81,8 +85,10 @@ get_element_devices(const gchar *element
  987. GList *ret = NULL;
  988. GstElement *element;
  989. GObjectClass *klass;
  990. +#if !GST_CHECK_VERSION(1,0,0)
  991. GstPropertyProbe *probe;
  992. const GParamSpec *pspec;
  993. +#endif
  994. ret = g_list_prepend(ret, (gpointer)_("Default"));
  995. ret = g_list_prepend(ret, "");
  996. @@ -103,6 +109,10 @@ get_element_devices(const gchar *element
  997. return g_list_reverse(ret);
  998. }
  999. +#if GST_CHECK_VERSION(1,0,0)
  1000. + purple_debug_info("vvconfig", "'%s' - gstreamer-1.0 doesn't suport "
  1001. + "property probing\n", element_name);
  1002. +#else
  1003. if (!g_object_class_find_property(klass, "device") ||
  1004. !GST_IS_PROPERTY_PROBE(element) ||
  1005. !(probe = GST_PROPERTY_PROBE(element)) ||
  1006. @@ -155,6 +165,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
  1007. gst_element_set_state(element, GST_STATE_NULL);
  1008. }
  1009. }
  1010. +#endif
  1011. gst_object_unref(element);
  1012. return g_list_reverse(ret);
  1013. @@ -168,8 +179,13 @@ get_element_plugins(const gchar **plugin
  1014. ret = g_list_prepend(ret, "Default");
  1015. ret = g_list_prepend(ret, "");
  1016. for (; plugins[0] && plugins[1]; plugins += 2) {
  1017. +#if GST_CHECK_VERSION(1,0,0)
  1018. + if (gst_registry_check_feature_version(gst_registry_get(),
  1019. + plugins[0], 0, 0, 0)) {
  1020. +#else
  1021. if (gst_default_registry_check_feature_version(
  1022. plugins[0], 0, 0, 0)) {
  1023. +#endif
  1024. ret = g_list_prepend(ret, (gpointer)plugins[1]);
  1025. ret = g_list_prepend(ret, (gpointer)plugins[0]);
  1026. }
  1027. @@ -588,7 +604,13 @@ gst_msg_db_to_percent(GstMessage *msg, g
  1028. list = gst_structure_get_value(
  1029. gst_message_get_structure(msg), value_name);
  1030. +#if GST_CHECK_VERSION(1,0,0)
  1031. +G_GNUC_BEGIN_IGNORE_DEPRECATIONS
  1032. + value = g_value_array_get_nth(g_value_get_boxed(list), 0);
  1033. +G_GNUC_END_IGNORE_DEPRECATIONS
  1034. +#else
  1035. value = gst_value_list_get_value(list, 0);
  1036. +#endif
  1037. value_db = g_value_get_double(value);
  1038. percent = pow(10, value_db / 20);
  1039. return (percent > 1.0) ? 1.0 : percent;
  1040. @@ -604,7 +626,7 @@ static gboolean
  1041. gst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx)
  1042. {
  1043. if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT &&
  1044. - gst_structure_has_name(msg->structure, "level")) {
  1045. + gst_structure_has_name(gst_message_get_structure(msg), "level")) {
  1046. GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
  1047. gchar *name = gst_element_get_name(src);