From 99ca616f3bcad552c8741f41b37fac892950b15d Mon Sep 17 00:00:00 2001 From: cedric Date: Wed, 31 Aug 2011 15:51:50 +0000 Subject: [PATCH] emotion: better debug infrastructure. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@63039 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/gstreamer/emotion_gstreamer.c | 21 +++++++++++++++++---- src/modules/gstreamer/emotion_sink.c | 4 ++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/modules/gstreamer/emotion_gstreamer.c b/src/modules/gstreamer/emotion_gstreamer.c index ea68b5b..3f7c895 100644 --- a/src/modules/gstreamer/emotion_gstreamer.c +++ b/src/modules/gstreamer/emotion_gstreamer.c @@ -1474,9 +1474,10 @@ _eos_main_fct(void *data) case GST_MESSAGE_STREAM_STATUS: break; default: - ERR("bus say: %s [%i]", + ERR("bus say: %s [%i - %s]", GST_MESSAGE_SRC_NAME(msg), - GST_MESSAGE_TYPE(msg)); + GST_MESSAGE_TYPE(msg), + GST_MESSAGE_TYPE_NAME(msg)); break; } @@ -1502,10 +1503,22 @@ _eos_sync_fct(GstBus *bus, GstMessage *msg, gpointer data) break; + case GST_MESSAGE_STATE_CHANGED: + { + GstState old_state, new_state; + + gst_message_parse_state_changed (msg, &old_state, &new_state, NULL); + INF("Element %s changed state from %s to %s.", + GST_OBJECT_NAME(msg->src), + gst_element_state_get_name(old_state), + gst_element_state_get_name(new_state)); + break; + } default: - WRN("bus say: %s [%i]", + WRN("bus say: %s [%i - %s]", GST_MESSAGE_SRC_NAME(msg), - GST_MESSAGE_TYPE(msg)); + GST_MESSAGE_TYPE(msg), + GST_MESSAGE_TYPE_NAME(msg)); break; } diff --git a/src/modules/gstreamer/emotion_sink.c b/src/modules/gstreamer/emotion_sink.c index 3ae40bd..6d429af 100644 --- a/src/modules/gstreamer/emotion_sink.c +++ b/src/modules/gstreamer/emotion_sink.c @@ -768,6 +768,8 @@ _emotion_gstreamer_cancel(void *data, Ecore_Thread *thread) ev->threads = eina_list_remove(ev->threads, thread); + if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT")); + if (ev->in == ev->out && ev->threads == NULL && ev->delete_me) em_shutdown(ev); } @@ -785,6 +787,8 @@ _emotion_gstreamer_end(void *data, Ecore_Thread *thread) ev->play_started = 1; } + if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT")); + if (ev->in == ev->out && ev->threads == NULL && ev->delete_me) em_shutdown(ev); else -- 2.7.4