summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert McQueen <robert.mcqueen@collabora.co.uk>2006-12-29 02:41:03 +0000
committerRobert McQueen <robert.mcqueen@collabora.co.uk>2006-12-29 02:41:03 +0000
commit5c45852e78474ffd78e16efadc49365d1def7788 (patch)
tree1afe1a97e2797b7dc3d93c470cd168620a5398fd
parent1405f8f03f81ca85d9c0ee859fc72b56a7f0e78b (diff)
downloadtelepathy-farstream-5c45852e78474ffd78e16efadc49365d1def7788.tar.gz
when handling prepare-xwindow-id messages, look for window pairs belonging to the parents of the element that sent us the message, as well as the element itself, to deal with x/xv image sinks which are in a bin (or autovideosink)
20061229024103-418b8-30c8fccad7a571e019c270eaa6c570c219832c48.gz
-rw-r--r--src/tp-stream-engine.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/tp-stream-engine.c b/src/tp-stream-engine.c
index 2333355..aec7769 100644
--- a/src/tp-stream-engine.c
+++ b/src/tp-stream-engine.c
@@ -942,7 +942,8 @@ bus_sync_handler (GstBus *bus, GstMessage *message, gpointer data)
{
TpStreamEngine *engine = TP_STREAM_ENGINE (data);
TpStreamEnginePrivate *priv = TP_STREAM_ENGINE_GET_PRIVATE (engine);
- WindowPair *wp;
+ GstElement *element;
+ WindowPair *wp = NULL;
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
@@ -950,24 +951,33 @@ bus_sync_handler (GstBus *bus, GstMessage *message, gpointer data)
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
return GST_BUS_PASS;
+ element = GST_ELEMENT (GST_MESSAGE_SRC (message));
+
g_debug ("got prepare-xwindow-id message from %s",
- gst_element_get_name (GST_MESSAGE_SRC (message)));
+ gst_element_get_name (element));
- wp = _window_pairs_find_by_sink (priv->output_windows,
- GST_ELEMENT (GST_MESSAGE_SRC (message)));
+ while (element != NULL)
+ {
+ wp = _window_pairs_find_by_sink (priv->output_windows, element);
- if (wp == NULL)
- wp = _window_pairs_find_by_sink (priv->preview_windows,
- GST_ELEMENT (GST_MESSAGE_SRC (message)));
+ if (wp == NULL)
+ wp = _window_pairs_find_by_sink (priv->preview_windows, element);
+
+ if (wp != NULL)
+ break;
+
+ element = GST_ELEMENT_PARENT (element);
+ }
if (wp == NULL)
return GST_BUS_PASS;
- g_debug ("Giving xvimagesink %p window id %d", wp->sink, wp->window_id);
- gst_x_overlay_set_xwindow_id (
- GST_X_OVERLAY (GST_MESSAGE_SRC (message)), wp->window_id);
+ g_debug ("Giving video sink %p window id %d", wp->sink, wp->window_id);
+ gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
+ wp->window_id);
gst_message_unref (message);
+
return GST_BUS_DROP;
}