qa-monitor: fix various start up issues

Fix reference count for monitored object, passing of constructor
parameter and base monitor property flag
This commit is contained in:
Thiago Santos 2013-07-11 00:03:54 -03:00
parent 1e9b4311c9
commit ac66ed48fa
4 changed files with 6 additions and 8 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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:

View file

@ -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);