gst/gstbuffer.c: Copy more flags.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 11 Nov 2005 18:25:50 +0000 (18:25 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 11 Nov 2005 18:25:50 +0000 (18:25 +0000)
Original commit message from CVS:
* 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.

ChangeLog
gst/gstbuffer.c
gst/gstcaps.c
gst/gstminiobject.c
gst/gstminiobject.h
gst/gstutils.c

index 6bfbf8e..3b707fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2005-11-11  Wim Taymans  <wim@fluendo.com>
 
+       * 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  <wim@fluendo.com>
+
        * gst/base/gstbasetransform.c:
        (gst_base_transform_prepare_output_buf),
        (gst_base_transform_handle_buffer):
index 3a84ea2..e746c13 100644 (file)
@@ -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 */
index e5229cb..fa5a06a 100644 (file)
@@ -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)
index 1e8171d..5954dc9 100644 (file)
@@ -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.
  *
index 9601dd8..d2d5721 100644 (file)
@@ -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);
-
-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);
+GType          gst_mini_object_get_type        (void);
 
-GstMiniObject * gst_mini_object_ref (GstMiniObject *mini_object);
-void gst_mini_object_unref (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);
 
-void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
+/* 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);
 
-GParamSpec * gst_param_spec_mini_object (const char *name, const char *nick,
-    const char *blurb, GType object_type, GParamFlags flags);
+/* GParamSpec */
+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
index 2c20fde..35b4fdc 100644 (file)
@@ -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)