docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
[platform/upstream/gstreamer.git] / gst / gstallocator.c
index a6e6039..6363ba5 100644 (file)
@@ -25,7 +25,7 @@
  * @see_also: #GstMemory
  *
  * Memory is usually created by allocators with a gst_allocator_alloc()
- * method call. When NULL is used as the allocator, the default allocator will
+ * method call. When %NULL is used as the allocator, the default allocator will
  * be used.
  *
  * New allocators can be registered with gst_allocator_register().
@@ -35,8 +35,6 @@
  *
  * New memory can be created with gst_memory_new_wrapped() that wraps the memory
  * allocated elsewhere.
- *
- * Last reviewed on 2012-07-09 (0.11.3)
  */
 
 #ifdef HAVE_CONFIG_H
@@ -58,15 +56,15 @@ struct _GstAllocatorPrivate
 };
 
 #if defined(MEMORY_ALIGNMENT_MALLOC)
-size_t gst_memory_alignment = 7;
+gsize gst_memory_alignment = 7;
 #elif defined(MEMORY_ALIGNMENT_PAGESIZE)
 /* we fill this in in the _init method */
-size_t gst_memory_alignment = 0;
+gsize gst_memory_alignment = 0;
 #elif defined(MEMORY_ALIGNMENT)
-size_t gst_memory_alignment = MEMORY_ALIGNMENT - 1;
+gsize gst_memory_alignment = MEMORY_ALIGNMENT - 1;
 #else
 #error "No memory alignment configured"
-size_t gst_memory_alignment = 0;
+gsize gst_memory_alignment = 0;
 #endif
 
 /* the default allocator */
@@ -220,10 +218,10 @@ gst_allocator_register (const gchar * name, GstAllocator * allocator)
  * gst_allocator_find:
  * @name: (allow-none): the name of the allocator
  *
- * Find a previously registered allocator with @name. When @name is NULL, the
+ * Find a previously registered allocator with @name. When @name is %NULL, the
  * default allocator will be returned.
  *
- * Returns: (transfer full): a #GstAllocator or NULL when the allocator with @name was not
+ * Returns: (transfer full): a #GstAllocator or %NULL when the allocator with @name was not
  * registered. Use gst_object_unref() to release the allocator after usage.
  */
 GstAllocator *
@@ -276,13 +274,13 @@ gst_allocator_set_default (GstAllocator * allocator)
  * @size big.
  *
  * The optional @params can specify the prefix and padding for the memory. If
- * NULL is passed, no flags, no extra prefix/padding and a default alignment is
+ * %NULL is passed, no flags, no extra prefix/padding and a default alignment is
  * used.
  *
  * The prefix/padding will be filled with 0 if flags contains
  * #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
  *
- * When @allocator is NULL, the default allocator will be used.
+ * When @allocator is %NULL, the default allocator will be used.
  *
  * The alignment in @params is given as a bitmask so that @align + 1 equals
  * the amount of bytes to align to. For example, to align to 8 bytes,
@@ -458,13 +456,10 @@ _sysmem_copy (GstMemorySystem * mem, gssize offset, gsize size)
   if (size == -1)
     size = mem->mem.size > offset ? mem->mem.size - offset : 0;
 
-  copy =
-      _sysmem_new_block (0, mem->mem.maxsize, mem->mem.align,
-      mem->mem.offset + offset, size);
+  copy = _sysmem_new_block (0, size, mem->mem.align, 0, size);
   GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
-      "memcpy %" G_GSIZE_FORMAT " memory %p -> %p", mem->mem.maxsize, mem,
-      copy);
-  memcpy (copy->data, mem->data, mem->mem.maxsize);
+      "memcpy %" G_GSIZE_FORMAT " memory %p -> %p", size, mem, copy);
+  memcpy (copy->data, mem->data + mem->mem.offset + offset, size);
 
   return copy;
 }