summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Krishnamurthy <pavan.krishnamurthy@nokia.com>2010-09-22 16:52:24 (GMT)
committerPavan Krishnamurthy <pavan.krishnamurthy@nokia.com>2010-09-22 16:52:24 (GMT)
commit71d889d75033b2ab35459128f034ee6807682994 (patch)
tree5685323fb2db0a0bd689be299f64a448eaf6d3ab
parent72ab40cb9adbf957279f5bdc717d65ccfcecfd93 (diff)
downloadtelepathy-stream-engine-71d889d75033b2ab35459128f034ee6807682994.tar.gz
telepathy-stream-engine-71d889d75033b2ab35459128f034ee6807682994.tar.xz
Setting the window-id and window-params to the videosink in the bus handler
-rw-r--r--src/videosink.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/videosink.c b/src/videosink.c
index 68d905e..a947d4f 100644
--- a/src/videosink.c
+++ b/src/videosink.c
@@ -594,10 +594,67 @@ tp_stream_engine_video_sink_class_init (TpStreamEngineVideoSinkClass *klass)
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
}
+struct xid_data
+{
+ GstElement *src;
+ gulong window_id;
+ WindowParams win_params;
+ gboolean found;
+};
+
+static void
+set_window_xid (gpointer data, gpointer user_data)
+{
+ GstXOverlay *xov = GST_X_OVERLAY (data);
+ struct xid_data *xiddata = (struct xid_data *) user_data;
+
+ if (GST_ELEMENT_CAST(xov) == xiddata->src) {
+ gst_x_overlay_set_xwindow_id (xov, xiddata->window_id);
+ gst_x_overlay_set_render_rectangle (xov,
+ xiddata->win_params.x,
+ xiddata->win_params.y,
+ xiddata->win_params.width,
+ xiddata->win_params.height);
+ xiddata->found = TRUE;
+ }
+ g_debug("Setwindowxid, window id= %d x=%d y=%d %d x %d ", xiddata->window_id,
+ xiddata->win_params.x,
+ xiddata->win_params.y,
+ xiddata->win_params.width,
+ xiddata->win_params.height);
+
+ gst_object_unref (data);
+}
+
gboolean
tp_stream_engine_video_sink_bus_sync_message (
TpStreamEngineVideoSink *self,
GstMessage *message)
{
- return FALSE;
+ const GstStructure *s;
+ GstIterator *it = NULL;
+ struct xid_data xiddata;
+
+ if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
+ return FALSE;
+
+ s = gst_message_get_structure (message);
+ if (!gst_structure_has_name (s, "prepare-xwindow-id"))
+ return FALSE;
+
+ xiddata.src = GST_ELEMENT (GST_MESSAGE_SRC (message));
+ xiddata.window_id = self->priv->window_id;
+ xiddata.win_params = self->priv->win_params;
+ xiddata.found = FALSE;
+
+ g_debug("In bus sync handler, window id= %d", self->priv->window_id);
+
+ it = gst_bin_iterate_all_by_interface (GST_BIN (self->priv->sink),
+ GST_TYPE_X_OVERLAY);
+ while (gst_iterator_foreach (it, set_window_xid, &xiddata) ==
+ GST_ITERATOR_RESYNC)
+ gst_iterator_resync (it);
+ gst_iterator_free (it);
+
+ return xiddata.found;
}