[Gstreamer-openmax] [PATCH 2/8] Add some debug traces

Rob Clark rob at ti.com
Wed Mar 17 16:58:55 PDT 2010


---
 omx/gstomx_util.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index 115ca84..f14cc86 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -160,7 +160,12 @@ imp_new (const gchar *name)
     {
         void *handle;
 
+        GST_DEBUG ("loading: %s", name);
+
         imp->dl_handle = handle = dlopen (name, RTLD_LAZY);
+
+        GST_DEBUG ("dlopen(%s) -> %p", name, handle);
+
         if (!handle)
         {
             g_warning ("%s\n", dlerror ());
@@ -316,6 +321,9 @@ g_omx_core_free (GOmxCore *core)
 static void
 core_init (GOmxCore *core)
 {
+    GST_DEBUG_OBJECT (core->object, "loading: %s (%s)",
+            core->component_name, core->library_name);
+
     core->imp = request_imp (core->library_name);
 
     if (!core->imp)
@@ -325,6 +333,10 @@ core_init (GOmxCore *core)
                                                        (char *) core->component_name,
                                                        core,
                                                        &callbacks);
+
+    GST_DEBUG_OBJECT (core->object, "OMX_GetHandle(&%p) -> %d",
+            core->omx_handle, core->omx_error);
+
     if (!core->omx_error)
         core->omx_state = OMX_StateLoaded;
 }
@@ -339,7 +351,16 @@ core_deinit (GOmxCore *core)
         core->omx_state == OMX_StateInvalid)
     {
         if (core->omx_handle)
+        {
             core->omx_error = core->imp->sym_table.free_handle (core->omx_handle);
+            GST_DEBUG_OBJECT (core->object, "OMX_FreeHandle(%p) -> %d",
+                    core->omx_handle, core->omx_error);
+        }
+    }
+    else
+    {
+        GST_WARNING_OBJECT (core->object, "Incorrect state: %s",
+                omx_state_to_str (core->omx_state));
     }
 
     g_free (core->library_name);
@@ -530,6 +551,10 @@ g_omx_port_setup (GOmxPort *port)
     port->num_buffers = param.nBufferCountActual;
     port->buffer_size = param.nBufferSize;
 
+    GST_DEBUG_OBJECT (port->core->object,
+        "type=%d, num_buffers=%d, buffer_size=%ld, port_index=%d",
+        port->type, port->num_buffers, port->buffer_size, port->port_index);
+
     g_free (port->buffers);
     port->buffers = g_new0 (OMX_BUFFERHEADERTYPE *, port->num_buffers);
 }
@@ -862,6 +887,8 @@ EventHandler (OMX_HANDLETYPE omx_handle,
 
                 cmd = (OMX_COMMANDTYPE) data_1;
 
+                GST_DEBUG_OBJECT (core->object, "OMX_EventCmdComplete: %d", cmd);
+
                 switch (cmd)
                 {
                     case OMX_CommandStateSet:
@@ -880,6 +907,7 @@ EventHandler (OMX_HANDLETYPE omx_handle,
             }
         case OMX_EventBufferFlag:
             {
+                GST_DEBUG_OBJECT (core->object, "OMX_EventBufferFlag");
                 if (data_2 & OMX_BUFFERFLAG_EOS)
                 {
                     g_omx_core_set_done (core);
@@ -888,6 +916,7 @@ EventHandler (OMX_HANDLETYPE omx_handle,
             }
         case OMX_EventPortSettingsChanged:
             {
+                GST_DEBUG_OBJECT (core->object, "OMX_EventPortSettingsChanged");
                 /** @todo only on the relevant port. */
                 if (core->settings_changed_cb)
                 {
-- 
1.6.3.2





More information about the Gstreamer-openmax mailing list