+static void
+_video_resize(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__,
+ Evas_Coord w, Evas_Coord h)
+{
+ Emotion_Gstreamer_Video *ev = data;
+
+#ifdef HAVE_ECORE_X
+ ecore_x_window_resize(ev->win, w, h);
+#endif
+ fprintf(stderr, "resize: %i, %i\n", w, h);
+}
+
+static void
+_video_move(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__,
+ Evas_Coord x, Evas_Coord y)
+{
+ Emotion_Gstreamer_Video *ev = data;
+#ifdef HAVE_ECORE_X
+ unsigned int pos[2];
+
+ fprintf(stderr, "move: %i, %i\n", x, y);
+ pos[0] = x; pos[1] = y;
+ ecore_x_window_prop_card32_set(ev->win, ECORE_X_ATOM_E_VIDEO_POSITION, pos, 2);
+#endif
+}
+
+#if 0
+/* Much better idea to always feed the XvImageSink and let him handle optimizing the rendering as we do */
+static void
+_block_pad_unlink_cb(GstPad *pad, gboolean blocked, gpointer user_data)
+{
+ if (blocked)
+ {
+ Emotion_Gstreamer_Video *ev = user_data;
+ GstEvent *gev;
+
+ gst_pad_unlink(ev->teepad, ev->xvpad);
+ gev = gst_event_new_eos();
+ gst_pad_send_event(ev->xvpad, gev);
+ gst_pad_set_blocked_async(pad, FALSE, _block_pad_unlink_cb, NULL);
+ }
+}
+
+static void
+_block_pad_link_cb(GstPad *pad, gboolean blocked, gpointer user_data)
+{
+ if (blocked)
+ {
+ Emotion_Gstreamer_Video *ev = user_data;
+
+ gst_pad_link(ev->teepad, ev->xvpad);
+ if (ev->play)
+ gst_element_set_state(ev->xvsink, GST_STATE_PLAYING);
+ else
+ gst_element_set_state(ev->xvsink, GST_STATE_PAUSED);
+ gst_pad_set_blocked_async(pad, FALSE, _block_pad_link_cb, NULL);
+ }
+}
+#endif
+
+static void
+_video_show(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__)
+{
+ Emotion_Gstreamer_Video *ev = data;
+
+ fprintf(stderr, "show xv\n");
+#ifdef HAVE_ECORE_X
+ ecore_x_window_show(ev->win);
+#endif
+ /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_link_cb, ev); */
+}
+
+static void
+_video_hide(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__)
+{
+ Emotion_Gstreamer_Video *ev = data;
+
+ fprintf(stderr, "hide xv\n");
+#ifdef HAVE_ECORE_X
+ ecore_x_window_hide(ev->win);
+#endif
+ /* gst_pad_set_blocked_async(ev->teepad, TRUE, _block_pad_unlink_cb, ev); */
+}
+
+static void
+_video_update_pixels(void *data, Evas_Object *obj __UNUSED__, const Evas_Video_Surface *surface __UNUSED__)
+{
+ Emotion_Gstreamer_Video *ev = data;
+ Emotion_Gstreamer_Buffer *send;
+
+ if (!ev->send) return ;
+
+ send = ev->send;
+ send->force = EINA_TRUE;
+ ev->send = NULL;
+ evas_video_sink_main_render(send);
+}
+