diff --git a/ChangeLog b/ChangeLog index 6bfbf8e7da..3b707fa486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-11-11 Wim Taymans + + * gst/gstbuffer.c: (_gst_buffer_copy): + Copy more flags. + + * gst/gstcaps.c: (gst_caps_is_equal): + Fix some docs. + Make _is_equal fast in the trivial cases. + + * gst/gstminiobject.c: + * gst/gstminiobject.h: + More docs. Spifify .h file. + + * gst/gstutils.c: + Small doc update. + 2005-11-11 Wim Taymans * gst/base/gstbasetransform.c: diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 3a84ea2910..e746c13e07 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -199,7 +199,8 @@ _gst_buffer_copy (GstBuffer * buffer) /* copy relevant flags */ mask = GST_BUFFER_FLAG_PREROLL | GST_BUFFER_FLAG_IN_CAPS | - GST_BUFFER_FLAG_DELTA_UNIT; + GST_BUFFER_FLAG_DELTA_UNIT | GST_BUFFER_FLAG_DISCONT | + GST_BUFFER_FLAG_GAP; GST_MINI_OBJECT (copy)->flags |= GST_MINI_OBJECT (buffer)->flags & mask; /* we simply copy everything from our parent */ diff --git a/gst/gstcaps.c b/gst/gstcaps.c index e5229cb33e..fa5a06aa70 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -868,6 +868,10 @@ gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset) gboolean gst_caps_is_equal (const GstCaps * caps1, const GstCaps * caps2) { + /* NULL <-> NULL is allowed here */ + if (caps1 == caps2) + return TRUE; + g_return_val_if_fail (caps1 != NULL, FALSE); g_return_val_if_fail (caps2 != NULL, FALSE); @@ -1537,9 +1541,9 @@ gst_caps_load_thyself (xmlNodePtr parent) * @caps: a pointer to #GstCaps * @newcaps: a #GstCaps to replace *caps * - * Replaces *caps with @newcaps. Frees the #GstCaps in the location + * Replaces *caps with @newcaps. Unrefs the #GstCaps in the location * pointed to by @caps, if applicable, then modifies @caps to point to - * @newcaps. + * @newcaps. An additional ref on @newcaps is taken. */ void gst_caps_replace (GstCaps ** caps, GstCaps * newcaps) diff --git a/gst/gstminiobject.c b/gst/gstminiobject.c index 1e8171dd2f..5954dc916e 100644 --- a/gst/gstminiobject.c +++ b/gst/gstminiobject.c @@ -134,7 +134,7 @@ gst_mini_object_init (GTypeInstance * instance, gpointer klass) /** * gst_mini_object_new: - * @type: the GType of the mini-object to create + * @type: the #GType of the mini-object to create * * Creates a new mini-object of the desired type. * @@ -183,7 +183,7 @@ gst_mini_object_copy (const GstMiniObject * mini_object) * @mini_object: the mini-object to check * * Checks if a mini-object is writable. A mini-object is writable - * if the reference count is one and the GST_MINI_OBJECT_FLAG_READONLY + * if the reference count is one and the #GST_MINI_OBJECT_FLAG_READONLY * flag is not set. Modification of a mini-object should only be * done after verifying that it is writable. * diff --git a/gst/gstminiobject.h b/gst/gstminiobject.h index 9601dd8fd0..d2d572166f 100644 --- a/gst/gstminiobject.h +++ b/gst/gstminiobject.h @@ -128,11 +128,21 @@ typedef enum */ #define GST_MINI_OBJECT_REFCOUNT_VALUE(obj) (g_atomic_int_get (&(GST_MINI_OBJECT_CAST(obj))->refcount)) +/** + * GstMiniObject: + * @instance: type instance + * @refcount: atomic refcount + * @flags: extra flags. + * + * Base class for refcounted lightweight objects. + */ struct _GstMiniObject { GTypeInstance instance; + /*< public >*/ /* with COW */ gint refcount; guint flags; + /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; @@ -142,27 +152,31 @@ struct _GstMiniObjectClass { GstMiniObjectCopyFunction copy; GstMiniObjectFinalizeFunction finalize; + /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; -GType gst_mini_object_get_type (void); +GType gst_mini_object_get_type (void); -GstMiniObject * gst_mini_object_new (GType type); -GstMiniObject * gst_mini_object_copy (const GstMiniObject *mini_object); -gboolean gst_mini_object_is_writable (const GstMiniObject *mini_object); -GstMiniObject * gst_mini_object_make_writable (GstMiniObject *mini_object); +GstMiniObject* gst_mini_object_new (GType type); +GstMiniObject* gst_mini_object_copy (const GstMiniObject *mini_object); +gboolean gst_mini_object_is_writable (const GstMiniObject *mini_object); +GstMiniObject* gst_mini_object_make_writable (GstMiniObject *mini_object); -GstMiniObject * gst_mini_object_ref (GstMiniObject *mini_object); -void gst_mini_object_unref (GstMiniObject *mini_object); +/* refcounting */ +GstMiniObject* gst_mini_object_ref (GstMiniObject *mini_object); +void gst_mini_object_unref (GstMiniObject *mini_object); +void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata); -void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata); +/* GParamSpec */ +GParamSpec* gst_param_spec_mini_object (const char *name, const char *nick, + const char *blurb, GType object_type, + GParamFlags flags); -GParamSpec * gst_param_spec_mini_object (const char *name, const char *nick, - const char *blurb, GType object_type, GParamFlags flags); - -void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object); -void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object); -GstMiniObject * gst_value_get_mini_object (const GValue *value); +/* GValue stuff */ +void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object); +void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object); +GstMiniObject* gst_value_get_mini_object (const GValue *value); G_END_DECLS diff --git a/gst/gstutils.c b/gst/gstutils.c index 2c20fde079..35b4fdc927 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -2204,6 +2204,8 @@ gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2) * * Copies additional information (the timestamp, duration, and offset start * and end) from one buffer to the other. + * + * This function does not copy any buffer flags or caps. */ void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src)