SHA256
1
0
forked from pool/pidgin
pidgin/pidgin-gstreamer1.patch
2013-03-25 19:40:38 +00:00

331 lines
12 KiB
Diff

Index: pidgin-2.10.7/libpurple/media/backend-fs2.c
===================================================================
--- pidgin-2.10.7.orig/libpurple/media/backend-fs2.c
+++ pidgin-2.10.7/libpurple/media/backend-fs2.c
@@ -189,8 +189,13 @@ event_probe_cb(GstPad *srcpad, GstEvent
gst_pad_unlink(srcpad, gst_pad_get_peer(srcpad));
+#if GST_CHECK_VERSION(1,0,0)
+ gst_pad_remove_probe(srcpad,
+ g_value_get_ulong(gst_structure_get_value(s, "handler-id")));
+#else
gst_pad_remove_event_probe(srcpad,
g_value_get_uint(gst_structure_get_value(s, "handler-id")));
+#endif
if (g_value_get_boolean(gst_structure_get_value(s, "release-pad")))
gst_element_release_request_pad(GST_ELEMENT_PARENT(srcpad), srcpad);
@@ -204,7 +209,12 @@ event_probe_cb(GstPad *srcpad, GstEvent
static void
unlink_teepad_dynamic(GstPad *srcpad, gboolean release_pad)
{
+#if GST_CHECK_VERSION(1,0,0)
+ gulong id = gst_pad_add_probe(srcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
+ G_CALLBACK(event_probe_cb), NULL, NULL);
+#else
guint id = gst_pad_add_event_probe(srcpad, G_CALLBACK(event_probe_cb), NULL);
+#endif
if (GST_IS_GHOST_PAD(srcpad))
srcpad = gst_ghost_pad_get_target(GST_GHOST_PAD(srcpad));
@@ -213,7 +223,11 @@ unlink_teepad_dynamic(GstPad *srcpad, gb
gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM,
gst_structure_new("purple-unlink-tee",
"release-pad", G_TYPE_BOOLEAN, release_pad,
+#if GST_CHECK_VERSION(1,0,0)
+ "handler-id", G_TYPE_ULONG, id,
+#else
"handler-id", G_TYPE_UINT, id,
+#endif
NULL)));
}
@@ -808,12 +822,15 @@ gst_handle_message_element(GstBus *bus,
PurpleMediaBackendFs2Private *priv =
PURPLE_MEDIA_BACKEND_FS2_GET_PRIVATE(self);
GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
+ GstStructure *gst_struct;
static guint level_id = 0;
if (level_id == 0)
level_id = g_signal_lookup("level", PURPLE_TYPE_MEDIA);
- if (gst_structure_has_name(msg->structure, "level")) {
+ gst_struct = gst_message_get_structure(msg);
+
+ if (gst_structure_has_name(gst_struct, "level")) {
GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
gchar *name;
gchar *participant = NULL;
@@ -868,12 +885,12 @@ gst_handle_message_element(GstBus *bus,
return;
#ifdef HAVE_FARSIGHT
- if (gst_structure_has_name(msg->structure, "farsight-error")) {
+ if (gst_structure_has_name(gst_struct, "farsight-error")) {
#else
- if (gst_structure_has_name(msg->structure, "farstream-error")) {
+ if (gst_structure_has_name(gst_struct, "farstream-error")) {
#endif
FsError error_no;
- gst_structure_get_enum(msg->structure, "error-no",
+ gst_structure_get_enum(gst_struct, "error-no",
FS_TYPE_ERROR, (gint*)&error_no);
switch (error_no) {
case FS_ERROR_NO_CODECS:
@@ -910,7 +927,7 @@ gst_handle_message_element(GstBus *bus,
#endif
error_no,
gst_structure_get_string(
- msg->structure, "error-msg"));
+ gst_struct, "error-msg"));
break;
}
@@ -924,7 +941,7 @@ gst_handle_message_element(GstBus *bus,
#endif
purple_media_end(priv->media, NULL, NULL);
}
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-new-local-candidate")) {
#else
@@ -939,9 +956,9 @@ gst_handle_message_element(GstBus *bus,
PurpleMediaBackendFs2Stream *media_stream;
gchar *name;
- value = gst_structure_get_value(msg->structure, "stream");
+ value = gst_structure_get_value(gst_struct, "stream");
stream = g_value_get_object(value);
- value = gst_structure_get_value(msg->structure, "candidate");
+ value = gst_structure_get_value(gst_struct, "candidate");
local_candidate = g_value_get_boxed(value);
session = get_session_from_fs_stream(self, stream);
@@ -963,7 +980,7 @@ gst_handle_message_element(GstBus *bus,
g_signal_emit_by_name(self, "new-candidate",
session->id, name, candidate);
g_object_unref(candidate);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-local-candidates-prepared")) {
#else
@@ -975,7 +992,7 @@ gst_handle_message_element(GstBus *bus,
PurpleMediaBackendFs2Session *session;
gchar *name;
- value = gst_structure_get_value(msg->structure, "stream");
+ value = gst_structure_get_value(gst_struct, "stream");
stream = g_value_get_object(value);
session = get_session_from_fs_stream(self, stream);
@@ -985,7 +1002,7 @@ gst_handle_message_element(GstBus *bus,
g_signal_emit_by_name(self, "candidates-prepared",
session->id, name);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-new-active-candidate-pair")) {
#else
@@ -1000,12 +1017,12 @@ gst_handle_message_element(GstBus *bus,
PurpleMediaCandidate *lcandidate, *rcandidate;
gchar *name;
- value = gst_structure_get_value(msg->structure, "stream");
+ value = gst_structure_get_value(gst_struct, "stream");
stream = g_value_get_object(value);
- value = gst_structure_get_value(msg->structure,
+ value = gst_structure_get_value(gst_struct,
"local-candidate");
local_candidate = g_value_get_boxed(value);
- value = gst_structure_get_value(msg->structure,
+ value = gst_structure_get_value(gst_struct,
"remote-candidate");
remote_candidate = g_value_get_boxed(value);
@@ -1023,7 +1040,7 @@ gst_handle_message_element(GstBus *bus,
g_object_unref(lcandidate);
g_object_unref(rcandidate);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-recv-codecs-changed")) {
#else
@@ -1033,7 +1050,7 @@ gst_handle_message_element(GstBus *bus,
GList *codecs;
FsCodec *codec;
- value = gst_structure_get_value(msg->structure, "codecs");
+ value = gst_structure_get_value(gst_struct, "codecs");
codecs = g_value_get_boxed(value);
codec = codecs->data;
@@ -1044,7 +1061,7 @@ gst_handle_message_element(GstBus *bus,
"farstream-recv-codecs-changed: %s\n",
#endif
codec->encoding_name);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-component-state-changed")) {
#else
@@ -1055,9 +1072,9 @@ gst_handle_message_element(GstBus *bus,
guint component;
const gchar *state;
- value = gst_structure_get_value(msg->structure, "state");
+ value = gst_structure_get_value(gst_struct, "state");
fsstate = g_value_get_enum(value);
- value = gst_structure_get_value(msg->structure, "component");
+ value = gst_structure_get_value(gst_struct, "component");
component = g_value_get_uint(value);
switch (fsstate) {
@@ -1092,7 +1109,7 @@ gst_handle_message_element(GstBus *bus,
#endif
"component: %u state: %s\n",
component, state);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-send-codec-changed")) {
#else
@@ -1102,7 +1119,7 @@ gst_handle_message_element(GstBus *bus,
FsCodec *codec;
gchar *codec_str;
- value = gst_structure_get_value(msg->structure, "codec");
+ value = gst_structure_get_value(gst_struct, "codec");
codec = g_value_get_boxed(value);
codec_str = fs_codec_to_string(codec);
@@ -1115,7 +1132,7 @@ gst_handle_message_element(GstBus *bus,
codec_str);
g_free(codec_str);
- } else if (gst_structure_has_name(msg->structure,
+ } else if (gst_structure_has_name(gst_struct,
#ifdef HAVE_FARSIGHT
"farsight-codecs-changed")) {
#else
@@ -1125,7 +1142,7 @@ gst_handle_message_element(GstBus *bus,
FsSession *fssession;
GList *sessions;
- value = gst_structure_get_value(msg->structure, "session");
+ value = gst_structure_get_value(gst_struct, "session");
fssession = g_value_get_object(value);
sessions = g_hash_table_get_values(priv->sessions);
Index: pidgin-2.10.7/libpurple/mediamanager.c
===================================================================
--- pidgin-2.10.7.orig/libpurple/mediamanager.c
+++ pidgin-2.10.7/libpurple/mediamanager.c
@@ -44,7 +44,12 @@
#else
#include <farstream/fs-element-added-notifier.h>
#endif
+
+#if GST_CHECK_VERSION(1,0,0)
+#include <gst/video/videooverlay.h>
+#else
#include <gst/interfaces/xoverlay.h>
+#endif
/** @copydoc _PurpleMediaManagerPrivate */
typedef struct _PurpleMediaManagerPrivate PurpleMediaManagerPrivate;
@@ -270,8 +275,13 @@ purple_media_manager_get_pipeline(Purple
gst_bus_add_signal_watch(GST_BUS(bus));
g_signal_connect(G_OBJECT(bus), "message",
G_CALLBACK(pipeline_bus_call), manager);
+#if GST_CHECK_VERSION(1,0,0)
+ gst_bus_set_sync_handler(bus,
+ gst_bus_sync_signal_handler, NULL, NULL);
+#else
gst_bus_set_sync_handler(bus,
gst_bus_sync_signal_handler, NULL);
+#endif
gst_object_unref(bus);
filename = g_build_filename(purple_user_dir(),
@@ -727,7 +737,7 @@ window_id_cb(GstBus *bus, GstMessage *ms
GstElement *sink;
if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT ||
- !gst_structure_has_name(msg->structure,
+ !gst_structure_has_name(gst_message_get_structure(msg),
"prepare-xwindow-id"))
return;
@@ -742,8 +752,13 @@ window_id_cb(GstBus *bus, GstMessage *ms
| G_SIGNAL_MATCH_DATA, 0, 0, NULL,
window_id_cb, ow);
+#if GST_CHECK_VERSION(1,0,0)
+ gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)),
+ ow->window_id);
+#else
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(
GST_MESSAGE_SRC(msg)), ow->window_id);
+#endif
}
#endif
Index: pidgin-2.10.7/configure.ac
===================================================================
--- pidgin-2.10.7.orig/configure.ac
+++ pidgin-2.10.7/configure.ac
@@ -740,17 +740,17 @@ dnl ####################################
dnl # Check for GStreamer
dnl #######################################################################
dnl
-dnl TODO: Depend on gstreamer >= 0.10.10, and remove the conditional use of
+dnl TODO: Depend on gstreamer >= 1.0.0, and remove the conditional use of
dnl gst_registry_fork_set_enabled.
AC_ARG_ENABLE(gstreamer,
[AC_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
enable_gst="$enableval", enable_gst="yes")
if test "x$enable_gst" != "xno"; then
- PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10], [
+ PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0], [
AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
- AC_CHECK_LIB(gstreamer-0.10, gst_registry_fork_set_enabled,
+ AC_CHECK_LIB(gstreamer-1.0, gst_registry_fork_set_enabled,
[ AC_DEFINE(GST_CAN_DISABLE_FORKING, [],
[Define if gst_registry_fork_set_enabled exists])],
[], [$GSTREAMER_LIBS])
@@ -766,26 +766,6 @@ Use --disable-gstreamer if you do not ne
fi
dnl #######################################################################
-dnl # Check for GStreamer Interfaces
-dnl #######################################################################
-if test "x$enable_gst" != "xno"; then
- AC_ARG_ENABLE(gstreamer-interfaces,
- [AC_HELP_STRING([--disable-gstreamer-interfaces], [compile without GStreamer interface support])],
- enable_gstinterfaces="$enableval", enable_gstinterfaces="yes")
- if test "x$enable_gstinterfaces" != "xno"; then
- PKG_CHECK_MODULES(GSTINTERFACES, [gstreamer-interfaces-0.10], [
- AC_DEFINE(USE_GSTINTERFACES, 1, [Use GStreamer interfaces for X overlay support])
- AC_SUBST(GSTINTERFACES_CFLAGS)
- AC_SUBST(GSTINTERFACES_LIBS)
- ], [
- enable_gstinterfaces="no"
- ])
- fi
-else
- enable_gstinterfaces="no"
-fi
-
-dnl #######################################################################
dnl # Check for Farstream
dnl #######################################################################
AC_ARG_ENABLE(farstream,