mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
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:
parent
1e9b4311c9
commit
ac66ed48fa
4 changed files with 6 additions and 8 deletions
|
@ -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");
|
GST_DEBUG_CATEGORY_INIT (gst_qa_bin_monitor_debug, "qa_bin_monitor", 0, "QA BinMonitor");
|
||||||
#define gst_qa_bin_monitor_parent_class parent_class
|
#define gst_qa_bin_monitor_parent_class parent_class
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstQaBinMonitor, gst_qa_bin_monitor,
|
G_DEFINE_TYPE_WITH_CODE (GstQaBinMonitor, gst_qa_bin_monitor,
|
||||||
G_TYPE_OBJECT, _do_init);
|
GST_TYPE_QA_ELEMENT_MONITOR, _do_init);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_qa_bin_monitor_wrap_element (GstQaBinMonitor * monitor,
|
gst_qa_bin_monitor_wrap_element (GstQaBinMonitor * monitor,
|
||||||
|
@ -88,7 +88,7 @@ GstQaBinMonitor *
|
||||||
gst_qa_bin_monitor_new (GstBin * bin)
|
gst_qa_bin_monitor_new (GstBin * bin)
|
||||||
{
|
{
|
||||||
GstQaBinMonitor *monitor = g_object_new (GST_TYPE_QA_BIN_MONITOR, "object",
|
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) {
|
if (GST_QA_MONITOR_GET_OBJECT (monitor) == NULL) {
|
||||||
g_object_unref (monitor);
|
g_object_unref (monitor);
|
||||||
|
|
|
@ -90,9 +90,7 @@ gst_qa_element_monitor_new (GstElement * element)
|
||||||
|
|
||||||
g_return_val_if_fail (element != NULL, NULL);
|
g_return_val_if_fail (element != NULL, NULL);
|
||||||
|
|
||||||
monitor =
|
monitor = g_object_new (GST_TYPE_QA_ELEMENT_MONITOR, "object", element, NULL);
|
||||||
g_object_new (GST_TYPE_QA_ELEMENT_MONITOR, "object",
|
|
||||||
G_TYPE_OBJECT, element, NULL);
|
|
||||||
|
|
||||||
if (GST_QA_ELEMENT_MONITOR_GET_ELEMENT (monitor) == NULL) {
|
if (GST_QA_ELEMENT_MONITOR_GET_ELEMENT (monitor) == NULL) {
|
||||||
g_object_unref (monitor);
|
g_object_unref (monitor);
|
||||||
|
|
|
@ -80,7 +80,7 @@ gst_qa_monitor_class_init (GstQaMonitorClass * klass)
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_OBJECT,
|
g_object_class_install_property (gobject_class, PROP_OBJECT,
|
||||||
g_param_spec_object ("object", "Object", "The object to be monitored",
|
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
|
static void
|
||||||
|
@ -132,7 +132,7 @@ gst_qa_monitor_set_property (GObject * object, guint prop_id,
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_OBJECT:
|
case PROP_OBJECT:
|
||||||
g_assert (monitor->object == NULL);
|
g_assert (monitor->object == NULL);
|
||||||
monitor->object = g_value_get_object (value);
|
monitor->object = g_value_dup_object (value);
|
||||||
gst_qa_monitor_setup (monitor);
|
gst_qa_monitor_setup (monitor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -72,7 +72,7 @@ GstQaPadMonitor *
|
||||||
gst_qa_pad_monitor_new (GstPad * pad)
|
gst_qa_pad_monitor_new (GstPad * pad)
|
||||||
{
|
{
|
||||||
GstQaPadMonitor *monitor = g_object_new (GST_TYPE_QA_PAD_MONITOR,
|
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) {
|
if (GST_QA_PAD_MONITOR_GET_PAD (monitor) == NULL) {
|
||||||
g_object_unref (monitor);
|
g_object_unref (monitor);
|
||||||
|
|
Loading…
Reference in a new issue