[gst-cvs] gst-openmax: Add core_stop function to split core_finish

Felipe Contreras felipec at kemper.freedesktop.org
Sun Apr 26 12:27:40 PDT 2009


Module: gst-openmax
Branch: master
Commit: c8a68576bfac7cf77e5a3884790f15210ba3d36f
URL:    http://cgit.freedesktop.org/gstreamer/gst-openmax/commit/?id=c8a68576bfac7cf77e5a3884790f15210ba3d36f

Author: Felipe Contreras <felipe.contreras at gmail.com>
Date:   Tue Aug  5 11:26:13 2008 +0300

Add core_stop function to split core_finish

Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>

---

 omx/gstomx_base_filter.c |    1 +
 omx/gstomx_base_sink.c   |    4 ++++
 omx/gstomx_base_src.c    |    3 ++-
 omx/gstomx_util.c        |   18 +++++++++++-------
 omx/gstomx_util.h        |    1 +
 5 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/omx/gstomx_base_filter.c b/omx/gstomx_base_filter.c
index 2d4b642..b57bd6d 100644
--- a/omx/gstomx_base_filter.c
+++ b/omx/gstomx_base_filter.c
@@ -128,6 +128,7 @@ change_state (GstElement *element,
                 g_omx_port_finish (self->in_port);
                 g_omx_port_finish (self->out_port);
 
+                g_omx_core_stop (core);
                 g_omx_core_finish (core);
                 self->ready = FALSE;
             }
diff --git a/omx/gstomx_base_sink.c b/omx/gstomx_base_sink.c
index 086473d..6b73be1 100644
--- a/omx/gstomx_base_sink.c
+++ b/omx/gstomx_base_sink.c
@@ -115,6 +115,10 @@ change_state (GstElement *element,
             break;
 
         case GST_STATE_CHANGE_PAUSED_TO_READY:
+            g_omx_core_stop (self->gomx);
+            break;
+
+        case GST_STATE_CHANGE_READY_TO_NULL:
             g_omx_core_finish (self->gomx);
             break;
 
diff --git a/omx/gstomx_base_src.c b/omx/gstomx_base_src.c
index e88772e..affb80b 100644
--- a/omx/gstomx_base_src.c
+++ b/omx/gstomx_base_src.c
@@ -85,9 +85,10 @@ stop (GstBaseSrc *gst_base)
 
     GST_LOG_OBJECT (self, "begin");
 
+    g_omx_core_stop (self->gomx);
     g_omx_core_finish (self->gomx);
-
     g_omx_core_deinit (self->gomx);
+
     if (self->gomx->omx_error)
         return GST_STATE_CHANGE_FAILURE;
 
diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index 1f40246..6a72b71 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -350,6 +350,17 @@ g_omx_core_start (GOmxCore *core)
 }
 
 void
+g_omx_core_stop (GOmxCore *core)
+{
+    if (core->omx_state == OMX_StateExecuting ||
+        core->omx_state == OMX_StatePause)
+    {
+        change_state (core, OMX_StateIdle);
+        wait_for_state (core, OMX_StateIdle);
+    }
+}
+
+void
 g_omx_core_pause (GOmxCore *core)
 {
     change_state (core, OMX_StatePause);
@@ -359,13 +370,6 @@ g_omx_core_pause (GOmxCore *core)
 void
 g_omx_core_finish (GOmxCore *core)
 {
-    if (core->omx_state == OMX_StateExecuting ||
-        core->omx_state == OMX_StatePause)
-    {
-        change_state (core, OMX_StateIdle);
-        wait_for_state (core, OMX_StateIdle);
-    }
-
     if (core->omx_state == OMX_StateIdle ||
         core->omx_state == OMX_StateWaitForResources ||
         core->omx_state == OMX_StateInvalid)
diff --git a/omx/gstomx_util.h b/omx/gstomx_util.h
index 0e6ab76..77ee52f 100644
--- a/omx/gstomx_util.h
+++ b/omx/gstomx_util.h
@@ -121,6 +121,7 @@ void g_omx_core_deinit (GOmxCore *core);
 void g_omx_core_prepare (GOmxCore *core);
 void g_omx_core_start (GOmxCore *core);
 void g_omx_core_pause (GOmxCore *core);
+void g_omx_core_stop (GOmxCore *core);
 void g_omx_core_finish (GOmxCore *core);
 void g_omx_core_set_done (GOmxCore *core);
 void g_omx_core_wait_for_done (GOmxCore *core);





More information about the Gstreamer-commits mailing list