guint alive_timer;
time_t last_alive_event;
gchar *theme_string_parametr1;
- gint theme_int_parametr1;
+ guint theme_int_parametr1;
GstElement *pipeline;
gboolean running;
};
fprintf (stderr, "APPLET PATH11111111111111111111 %s %s %s\n", dbus_message_get_path(msg), dbus_message_get_interface (msg), dbus_message_get_member (msg));
#endif
#endif
-fprintf(stderr, "ddddasddddddddddddddddddddddda!!!!!!!!!!!!!!!\n");
if (!priv)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
(priv->view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW2))||
(priv->view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW3))||
(priv->view == 4 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW4))){
- fprintf(stderr, "Play scene visible %i\n", priv->visible);
+ /* fprintf(stderr, "Play scene visible %i\n", priv->visible); */
if (priv->visible != TRUE){
priv->visible = TRUE;
view_state_changed(priv);
(priv->view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW2))||
(priv->view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW3))||
(priv->view == 4 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW4))){
- fprintf(stderr, "Pause scene visible %i\n", priv->visible);
+ /* fprintf(stderr, "Pause scene visible %i\n", priv->visible); */
if (priv->visible != FALSE){
priv->visible = FALSE;
view_state_changed(priv);
{
GstFormat fmt = GST_FORMAT_TIME;
gint64 p;
- fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer);
+
+ /* fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer); */
if (desktop_plugin->priv->pipeline){
- fprintf(stderr, " gst play in run long timeout \n");
if (!desktop_plugin->priv->visible){
gst_element_query_position(desktop_plugin->priv->pipeline, &fmt, &p);
- desktop_plugin->priv->theme_int_parametr1 = p / 1000000;
+ desktop_plugin->priv->theme_int_parametr1 = p / GST_SECOND;
gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
desktop_plugin->priv->pipeline = NULL;
desktop_plugin->priv->long_timer = 0;
return FALSE;
}
-
run_long_timeout(desktop_plugin);
return TRUE; /* keep running this event */
}
if (!strcmp(priv->theme,"Video")){
if (priv->pipeline){
- fprintf(stderr, " gst play \n");
gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
}else{
init_scene_Video(priv->desktop_plugin);
}
}else{
if (priv->pipeline){
- fprintf(stderr, " gst stop %i\n", priv->long_timer);
gst_element_set_state (priv->pipeline, GST_STATE_PAUSED);
return;
}
priv->podpid = -1;
priv->running = FALSE;
priv->window = main_widget;
- fprintf(stderr,"XWINDOW %i\n",GDK_WINDOW_XID (main_widget->window));
+ /* fprintf(stderr,"XWINDOW %i\n",GDK_WINDOW_XID (main_widget->window)); */
priv->desktop_plugin = desktop_plugin;
priv->view = view;
set_live_bg(GDK_WINDOW_XDISPLAY (main_widget->window), GDK_WINDOW_XID (main_widget->window), view);
priv->view_notify = 0;
- fprintf(stderr,"VISIBLE %i %i\n",priv->visible, current_active_view());
+ /* fprintf(stderr,"VISIBLE %i %i\n",priv->visible, current_active_view()); */
gconf_client_add_dir(gconf_client_get_default (), "/apps/osso/hildon-desktop/views", GCONF_CLIENT_PRELOAD_NONE, NULL);
priv->view_notify = gconf_client_notify_add(gconf_client_get_default (),"/apps/osso/hildon-desktop/views/current",
(GConfClientNotifyFunc)view_changed, priv, NULL, NULL);
}
return TRUE;
}
+
/*******************************************************************************/
void
init_scene_Xsnow(AWallpaperPlugin *desktop_plugin){
}
g_free(run_string);
}
+/*******************************************************************************/
+gboolean cb_timeout0(AWallpaperPlugin *desktop_plugin) {
+ GstFormat fmt = GST_FORMAT_TIME;
+ gboolean test;
+ gint64 len;
+ gint len_seconds = 0;
+
+ if (!desktop_plugin || !desktop_plugin->priv->pipeline)
+ return FALSE;
+ if (desktop_plugin->priv->theme_int_parametr1 == 0){
+ if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
+ GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+ fprintf(stderr,"Error in seek:\n");
+ return FALSE;
+ }
+
+ gst_element_query_position(desktop_plugin->priv->pipeline, &fmt, &len);
+ len_seconds = len / GST_SECOND;
+ if (len <0)
+ return TRUE;
+ if (len_seconds < desktop_plugin->priv->theme_int_parametr1){
+ if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
+ GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
+ desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
+ GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+ fprintf(stderr,"Error in seek:\n");
+ return TRUE;
+ }else
+ return FALSE;
+}
+/*******************************************************************************/
void
init_scene_Video(AWallpaperPlugin *desktop_plugin)
{
gchar *file_plus_uri;
- fprintf(stderr, "init scene Video \n");
+ /* fprintf(stderr, "init scene Video \n"); */
desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
bin = gst_element_factory_make ("playbin2", "bin");
videosink = gst_element_factory_make ("ximagesink", "videosink");
if (GST_IS_X_OVERLAY (videosink))
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
- if (desktop_plugin->priv->visible)
- gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
-
- fprintf(stderr," desktop_plugin->priv->theme_int_parametr1 %i\n", desktop_plugin->priv->theme_int_parametr1);
- GstClockTime nach = (GstClockTime)(desktop_plugin->priv->theme_int_parametr1 * GST_MSECOND);
- if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
- (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
- nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
- fprintf(stderr,"Error in seek\n");
+ if (desktop_plugin->priv->visible){
+ gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
+ g_timeout_add(100, cb_timeout0, desktop_plugin);
+ }
+
+ //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
}
/*******************************************************************************/