From ac66ed48fa235bb3beba1f6f2c4e1b5fd731362f Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 11 Jul 2013 00:03:54 -0300 Subject: [PATCH] qa-monitor: fix various start up issues Fix reference count for monitored object, passing of constructor parameter and base monitor property flag --- validate/gst/qa/gst-qa-bin-monitor.c | 4 ++-- validate/gst/qa/gst-qa-element-monitor.c | 4 +--- validate/gst/qa/gst-qa-monitor.c | 4 ++-- validate/gst/qa/gst-qa-pad-monitor.c | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/validate/gst/qa/gst-qa-bin-monitor.c b/validate/gst/qa/gst-qa-bin-monitor.c index 9f705ee764..d8bf869cb7 100644 --- a/validate/gst/qa/gst-qa-bin-monitor.c +++ b/validate/gst/qa/gst-qa-bin-monitor.c @@ -35,7 +35,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_qa_bin_monitor_debug); GST_DEBUG_CATEGORY_INIT (gst_qa_bin_monitor_debug, "qa_bin_monitor", 0, "QA BinMonitor"); #define gst_qa_bin_monitor_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstQaBinMonitor, gst_qa_bin_monitor, - G_TYPE_OBJECT, _do_init); + GST_TYPE_QA_ELEMENT_MONITOR, _do_init); static void gst_qa_bin_monitor_wrap_element (GstQaBinMonitor * monitor, @@ -88,7 +88,7 @@ GstQaBinMonitor * gst_qa_bin_monitor_new (GstBin * bin) { GstQaBinMonitor *monitor = g_object_new (GST_TYPE_QA_BIN_MONITOR, "object", - G_TYPE_OBJECT, bin, NULL); + bin, NULL); if (GST_QA_MONITOR_GET_OBJECT (monitor) == NULL) { g_object_unref (monitor); diff --git a/validate/gst/qa/gst-qa-element-monitor.c b/validate/gst/qa/gst-qa-element-monitor.c index 3ccc2d4f28..4d9c745d26 100644 --- a/validate/gst/qa/gst-qa-element-monitor.c +++ b/validate/gst/qa/gst-qa-element-monitor.c @@ -90,9 +90,7 @@ gst_qa_element_monitor_new (GstElement * element) g_return_val_if_fail (element != NULL, NULL); - monitor = - g_object_new (GST_TYPE_QA_ELEMENT_MONITOR, "object", - G_TYPE_OBJECT, element, NULL); + monitor = g_object_new (GST_TYPE_QA_ELEMENT_MONITOR, "object", element, NULL); if (GST_QA_ELEMENT_MONITOR_GET_ELEMENT (monitor) == NULL) { g_object_unref (monitor); diff --git a/validate/gst/qa/gst-qa-monitor.c b/validate/gst/qa/gst-qa-monitor.c index 7ecdd4eec6..94c8658c66 100644 --- a/validate/gst/qa/gst-qa-monitor.c +++ b/validate/gst/qa/gst-qa-monitor.c @@ -80,7 +80,7 @@ gst_qa_monitor_class_init (GstQaMonitorClass * klass) g_object_class_install_property (gobject_class, PROP_OBJECT, g_param_spec_object ("object", "Object", "The object to be monitored", - G_TYPE_OBJECT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READABLE)); + G_TYPE_OBJECT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); } static void @@ -132,7 +132,7 @@ gst_qa_monitor_set_property (GObject * object, guint prop_id, switch (prop_id) { case PROP_OBJECT: g_assert (monitor->object == NULL); - monitor->object = g_value_get_object (value); + monitor->object = g_value_dup_object (value); gst_qa_monitor_setup (monitor); break; default: diff --git a/validate/gst/qa/gst-qa-pad-monitor.c b/validate/gst/qa/gst-qa-pad-monitor.c index 02f8b6a24a..1a95c39c86 100644 --- a/validate/gst/qa/gst-qa-pad-monitor.c +++ b/validate/gst/qa/gst-qa-pad-monitor.c @@ -72,7 +72,7 @@ GstQaPadMonitor * gst_qa_pad_monitor_new (GstPad * pad) { GstQaPadMonitor *monitor = g_object_new (GST_TYPE_QA_PAD_MONITOR, - "object", G_TYPE_OBJECT, pad, NULL); + "object", pad, NULL); if (GST_QA_PAD_MONITOR_GET_PAD (monitor) == NULL) { g_object_unref (monitor);