[Gstreamer-openmax] [PATCH 2/5] Reorganize core_new()

Felipe Contreras felipe.contreras at nokia.com
Wed Mar 3 14:51:12 PST 2010


So that it receives the 'object' which is kind of mandatory.

Signed-off-by: Felipe Contreras <felipe.contreras at nokia.com>
---
 omx/gstomx_base_filter.c |    3 +--
 omx/gstomx_base_sink.c   |    3 +--
 omx/gstomx_base_src.c    |    3 +--
 omx/gstomx_util.c        |    3 ++-
 omx/gstomx_util.h        |    2 +-
 5 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/omx/gstomx_base_filter.c b/omx/gstomx_base_filter.c
index fd3f071..626f979 100644
--- a/omx/gstomx_base_filter.c
+++ b/omx/gstomx_base_filter.c
@@ -897,8 +897,7 @@ type_instance_init (GTypeInstance *instance,
     /* GOmx */
     {
         GOmxCore *gomx;
-        self->gomx = gomx = g_omx_core_new ();
-        gomx->object = self;
+        self->gomx = gomx = g_omx_core_new (self);
     }
 
     self->ready_lock = g_mutex_new ();
diff --git a/omx/gstomx_base_sink.c b/omx/gstomx_base_sink.c
index 5afb11d..aec2b68 100644
--- a/omx/gstomx_base_sink.c
+++ b/omx/gstomx_base_sink.c
@@ -460,8 +460,7 @@ type_instance_init (GTypeInstance *instance,
     /* GOmx */
     {
         GOmxCore *gomx;
-        self->gomx = gomx = g_omx_core_new ();
-        gomx->object = self;
+        self->gomx = gomx = g_omx_core_new (self);
     }
 
     {
diff --git a/omx/gstomx_base_src.c b/omx/gstomx_base_src.c
index 4e67a71..9439455 100644
--- a/omx/gstomx_base_src.c
+++ b/omx/gstomx_base_src.c
@@ -446,8 +446,7 @@ type_instance_init (GTypeInstance *instance,
     /* GOmx */
     {
         GOmxCore *gomx;
-        self->gomx = gomx = g_omx_core_new ();
-        gomx->object = self;
+        self->gomx = gomx = g_omx_core_new (self);
     }
 
     {
diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index c61f849..b2a96c8 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -265,12 +265,13 @@ g_omx_deinit (void)
  */
 
 GOmxCore *
-g_omx_core_new (void)
+g_omx_core_new (void *object)
 {
     GOmxCore *core;
 
     core = g_new0 (GOmxCore, 1);
 
+    core->object = object;
     core->ports = g_ptr_array_new ();
 
     core->omx_state_condition = g_cond_new ();
diff --git a/omx/gstomx_util.h b/omx/gstomx_util.h
index a4dc47b..ce0156c 100644
--- a/omx/gstomx_util.h
+++ b/omx/gstomx_util.h
@@ -117,7 +117,7 @@ struct GOmxPort
 void g_omx_init (void);
 void g_omx_deinit (void);
 
-GOmxCore *g_omx_core_new (void);
+GOmxCore *g_omx_core_new (void *object);
 void g_omx_core_free (GOmxCore *core);
 void g_omx_core_init (GOmxCore *core);
 void g_omx_core_deinit (GOmxCore *core);
-- 
1.7.0.1





More information about the Gstreamer-openmax mailing list