/** * gst_value_set_mini_object: * @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type * @mini_object: mini object value to set * * Set the contents of a %GST_TYPE_MINI_OBJECT derived #GValue to * @mini_object. * The caller retains ownership of the reference. */ void gst_value_set_mini_object (GValue * value, GstMiniObject * mini_object) { gpointer *pointer_p; g_return_if_fail (GST_VALUE_HOLDS_MINI_OBJECT (value)); g_return_if_fail (mini_object == NULL || GST_IS_MINI_OBJECT (mini_object)); pointer_p = &value->data[0].v_pointer; gst_mini_object_replace ((GstMiniObject **) pointer_p, mini_object); }
static void gst_stream_finalize (GObject * object) { GstStream *stream = GST_STREAM_CAST (object); gst_mini_object_replace ((GstMiniObject **) & stream->priv->tags, (GstMiniObject *) NULL); gst_caps_replace (&stream->priv->caps, NULL); g_free ((gchar *) stream->stream_id); G_OBJECT_CLASS (parent_class)->finalize (object); }
static void gst_stream_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstStream *stream; stream = GST_STREAM_CAST (object); switch (prop_id) { case PROP_STREAM_ID: gst_stream_set_stream_id (stream, g_value_get_string (value)); break; case PROP_STREAM_FLAGS: GST_OBJECT_LOCK (stream); stream->priv->flags = g_value_get_flags (value); GST_OBJECT_UNLOCK (stream); break; case PROP_STREAM_TYPE: GST_OBJECT_LOCK (stream); stream->priv->type = g_value_get_flags (value); GST_OBJECT_UNLOCK (stream); break; case PROP_TAGS: GST_OBJECT_LOCK (stream); gst_mini_object_replace ((GstMiniObject **) & stream->priv->tags, (GstMiniObject *) g_value_get_boxed (value)); GST_OBJECT_UNLOCK (stream); break; case PROP_CAPS: GST_OBJECT_LOCK (stream); gst_mini_object_replace ((GstMiniObject **) & stream->priv->caps, (GstMiniObject *) g_value_get_boxed (value)); GST_OBJECT_UNLOCK (stream); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
/** * gst_value_take_mini_object: * @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type * @mini_object: mini object value to take * * Set the contents of a %GST_TYPE_MINI_OBJECT derived #GValue to * @mini_object. * Takes over the ownership of the caller's reference to @mini_object; * the caller doesn't have to unref it any more. */ void gst_value_take_mini_object (GValue * value, GstMiniObject * mini_object) { gpointer *pointer_p; g_return_if_fail (GST_VALUE_HOLDS_MINI_OBJECT (value)); g_return_if_fail (mini_object == NULL || GST_IS_MINI_OBJECT (mini_object)); pointer_p = &value->data[0].v_pointer; /* takes additional refcount */ gst_mini_object_replace ((GstMiniObject **) pointer_p, mini_object); /* remove additional refcount */ if (mini_object) gst_mini_object_unref (mini_object); }
/** * gst_stream_set_tags: * @stream: a #GstStream * @tags: (transfer none) (allow-none): a #GstTagList * * Set the tags for the #GstStream * * Since: 1.10 */ void gst_stream_set_tags (GstStream * stream, GstTagList * tags) { gboolean notify = FALSE; GST_OBJECT_LOCK (stream); if (stream->priv->tags == NULL || tags == NULL || !gst_tag_list_is_equal (stream->priv->tags, tags)) { gst_mini_object_replace ((GstMiniObject **) & stream->priv->tags, (GstMiniObject *) tags); notify = TRUE; } GST_OBJECT_UNLOCK (stream); if (notify) g_object_notify_by_pspec (G_OBJECT (stream), gst_stream_pspecs[PROP_TAGS]); }
static void queue_item_destroy (GstDataQueueItem * item) { gst_mini_object_replace (&item->object, NULL); g_slice_free (GstDataQueueItem, item); }