began loop video
authorvlad <vlad@vlanout.(none)>
Wed, 28 Jul 2010 20:08:18 +0000 (23:08 +0300)
committervlad <vlad@vlanout.(none)>
Wed, 28 Jul 2010 20:08:18 +0000 (23:08 +0300)
applet/src/livewp-scene.c

index e4c4813..be068b5 100644 (file)
@@ -86,6 +86,23 @@ sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin)
 
 }
 #endif
+static gboolean
+bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
+{
+    switch (GST_MESSAGE_TYPE (msg))
+    {
+       case GST_MESSAGE_EOS: 
+           if (desktop_plugin->priv->rich_animation){
+                gst_element_set_start_time(desktop_plugin->priv->pipeline, 0);
+                gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
+           }
+           break;
+       case GST_MESSAGE_ERROR: break;
+       default: break;
+     }
+       return TRUE;
+}
+
 void
 init_scene_Video(AWallpaperPlugin *desktop_plugin)
 {
@@ -104,7 +121,7 @@ init_scene_Video(AWallpaperPlugin *desktop_plugin)
     {
        GstBus *bus;
        bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
-//     gst_bus_add_watch(bus, bus_call, NULL);
+               gst_bus_add_watch(bus, bus_call, desktop_plugin);
        gst_object_unref (bus);
     }
     file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);