Klasse Buffer

Alle implementierten Schnittstellen:
PointerInterface

public class Buffer extends Record
Buffers are the basic unit of data transfer in GStreamer. They contain the
timing and offset along with other arbitrary metadata that is associated
with the #GstMemory blocks that the buffer contains.

Buffers are usually created with gst_buffer_new(). After a buffer has been
created one will typically allocate memory for it and add it to the buffer.
The following example creates a buffer that can hold a given video frame
with a given width, height and bits per plane.

``` C
GstBuffer *buffer;
GstMemory *memory;
gint size, width, height, bpp;
...
size = width * height * bpp;
buffer = gst_buffer_new ();
memory = gst_allocator_alloc (NULL, size, NULL);
gst_buffer_insert_memory (buffer, -1, memory);
...
```

Alternatively, use gst_buffer_new_allocate() to create a buffer with
preallocated data of a given size.

Buffers can contain a list of #GstMemory objects. You can retrieve how many
memory objects with gst_buffer_n_memory() and you can get a pointer
to memory with gst_buffer_peek_memory()

A buffer will usually have timestamps, and a duration, but neither of these
are guaranteed (they may be set to #GST_CLOCK_TIME_NONE). Whenever a
meaningful value can be given for these, they should be set. The timestamps
and duration are measured in nanoseconds (they are #GstClockTime values).

The buffer DTS refers to the timestamp when the buffer should be decoded and
is usually monotonically increasing. The buffer PTS refers to the timestamp when
the buffer content should be presented to the user and is not always
monotonically increasing.

A buffer can also have one or both of a start and an end offset. These are
media-type specific. For video buffers, the start offset will generally be
the frame number. For audio buffers, it will be the number of samples
produced so far. For compressed data, it could be the byte offset in a
source or destination file. Likewise, the end offset will be the offset of
the end of the buffer. These can only be meaningfully interpreted if you
know the media type of the buffer (the preceding CAPS event). Either or both
can be set to #GST_BUFFER_OFFSET_NONE.

gst_buffer_ref() is used to increase the refcount of a buffer. This must be
done when you want to keep a handle to the buffer after pushing it to the
next element. The buffer refcount determines the writability of the buffer, a
buffer is only writable when the refcount is exactly 1, i.e. when the caller
has the only reference to the buffer.

To efficiently create a smaller buffer out of an existing one, you can
use gst_buffer_copy_region(). This method tries to share the memory objects
between the two buffers.

If a plug-in wants to modify the buffer data or metadata in-place, it should
first obtain a buffer that is safe to modify by using
gst_buffer_make_writable(). This function is optimized so that a copy will
only be made when it is necessary.

Several flags of the buffer can be set and unset with the
GST_BUFFER_FLAG_SET() and GST_BUFFER_FLAG_UNSET() macros. Use
GST_BUFFER_FLAG_IS_SET() to test if a certain #GstBufferFlags flag is set.

Buffers can be efficiently merged into a larger buffer with
gst_buffer_append(). Copying of memory will only be done when absolutely
needed.

Arbitrary extra metadata can be set on a buffer with gst_buffer_add_meta().
Metadata can be retrieved with gst_buffer_get_meta(). See also #GstMeta.

An element should either unref the buffer or push it out on a src pad
using gst_pad_push() (see #GstPad).

Buffers are usually freed by unreffing them with gst_buffer_unref(). When
the refcount drops to 0, any memory and metadata pointed to by the buffer is
unreffed as well. Buffers allocated from a #GstBufferPool will be returned to
the pool when the refcount drops to 0.

The #GstParentBufferMeta is a meta which can be attached to a #GstBuffer
to hold a reference to another buffer that is only released when the child
#GstBuffer is released.

Typically, #GstParentBufferMeta is used when the child buffer is directly
using the #GstMemory of the parent buffer, and wants to prevent the parent
buffer from being returned to a buffer pool until the #GstMemory is available
for re-use. (Since: 1.6)

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Felddetails

    • MINI_OBJECT

      public static final String MINI_OBJECT
      the parent structure
      Private field: direct-type
      Siehe auch:
    • POOL

      public static final String POOL
      pointer to the pool owner of the buffer
      Siehe auch:
    • PTS

      public static final String PTS
      presentation timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      pts is not known or relevant. The pts contains the timestamp when the
      media should be presented to the user.
      Siehe auch:
    • DTS

      public static final String DTS
      decoding timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      dts is not known or relevant. The dts contains the timestamp when the
      media should be processed.
      Siehe auch:
    • DURATION

      public static final String DURATION
      duration in time of the buffer data, can be #GST_CLOCK_TIME_NONE
      when the duration is not known or relevant.
      Siehe auch:
    • OFFSET

      public static final String OFFSET
      a media specific offset for the buffer data.
      For video frames, this is the frame number of this buffer.
      For audio samples, this is the offset of the first sample in this buffer.
      For file data or compressed data this is the byte offset of the first
      byte in this buffer.
      Siehe auch:
    • OFFSET_END

      public static final String OFFSET_END
      the last offset contained in this buffer. It has the same
      format as @offset.
      Siehe auch:
  • Konstruktordetails

    • Buffer

      public Buffer(PointerContainer pointer)
    • Buffer

      public Buffer()
      Creates a newly allocated buffer without any data.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldPool

      public void setFieldPool(BufferPool pool)
      pointer to the pool owner of the buffer
    • getFieldPool

      public BufferPool getFieldPool()
      pointer to the pool owner of the buffer
    • setFieldPts

      public void setFieldPts(long pts)
      presentation timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      pts is not known or relevant. The pts contains the timestamp when the
      media should be presented to the user.
    • getFieldPts

      public long getFieldPts()
      presentation timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      pts is not known or relevant. The pts contains the timestamp when the
      media should be presented to the user.
    • setFieldDts

      public void setFieldDts(long dts)
      decoding timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      dts is not known or relevant. The dts contains the timestamp when the
      media should be processed.
    • getFieldDts

      public long getFieldDts()
      decoding timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the
      dts is not known or relevant. The dts contains the timestamp when the
      media should be processed.
    • setFieldDuration

      public void setFieldDuration(long duration)
      duration in time of the buffer data, can be #GST_CLOCK_TIME_NONE
      when the duration is not known or relevant.
    • getFieldDuration

      public long getFieldDuration()
      duration in time of the buffer data, can be #GST_CLOCK_TIME_NONE
      when the duration is not known or relevant.
    • setFieldOffset

      public void setFieldOffset(long offset)
      a media specific offset for the buffer data.
      For video frames, this is the frame number of this buffer.
      For audio samples, this is the offset of the first sample in this buffer.
      For file data or compressed data this is the byte offset of the first
      byte in this buffer.
    • getFieldOffset

      public long getFieldOffset()
      a media specific offset for the buffer data.
      For video frames, this is the frame number of this buffer.
      For audio samples, this is the offset of the first sample in this buffer.
      For file data or compressed data this is the byte offset of the first
      byte in this buffer.
    • setFieldOffsetEnd

      public void setFieldOffsetEnd(long offset_end)
      the last offset contained in this buffer. It has the same
      format as @offset.
    • getFieldOffsetEnd

      public long getFieldOffsetEnd()
      the last offset contained in this buffer. It has the same
      format as @offset.
    • newAllocateBuffer

      public static Buffer newAllocateBuffer(@Nullable Allocator allocator, long size, @Nullable AllocationParams params)
      Tries to create a newly allocated buffer with data of the given size and
      extra parameters from @allocator. If the requested amount of memory can't be
      allocated, %NULL will be returned. The allocated buffer memory is not cleared.

      When @allocator is %NULL, the default memory allocator will be used.

      Note that when @size == 0, the buffer will not have memory associated with it.
      Parameter:
      allocator - the #GstAllocator to use, or %NULL to use the default allocator
      size - the size in bytes of the new buffer's data.
      params - optional parameters
      Gibt zurück:
      a new #GstBuffer
    • newMemdupBuffer

      public static Buffer newMemdupBuffer(@Nonnull Pointer data, long size)
      Creates a new buffer of size @size and fills it with a copy of @data.
      Parameter:
      data - data to copy into new buffer
      size - size of @data in bytes
      Gibt zurück:
      a new #GstBuffer
    • newWrappedBuffer

      public static Buffer newWrappedBuffer(@Nonnull Pointer data, long size)
      Creates a new buffer that wraps the given @data. The memory will be freed
      with g_free() and will be marked writable.
      Parameter:
      data - data to wrap
      size - allocated size of @data
      Gibt zurück:
      a new #GstBuffer
    • newWrappedBytesBuffer

      public static Buffer newWrappedBytesBuffer(@Nonnull Bytes bytes)
      Creates a new #GstBuffer that wraps the given @bytes. The data inside
      @bytes cannot be %NULL and the resulting buffer will be marked as read only.
      Parameter:
      bytes - a #GBytes to wrap
      Gibt zurück:
      a new #GstBuffer wrapping @bytes
    • newWrappedFullBuffer

      public static Buffer newWrappedFullBuffer(int flags, @Nonnull Pointer data, long maxsize, long offset, long size, @Nullable Pointer user_data, Buffer.OnDestroyNotify notify)
      Allocates a new buffer that wraps the given memory. @data must point to
      @maxsize of memory, the wrapped buffer will have the region from @offset and
      @size visible.

      When the buffer is destroyed, @notify will be called with @user_data.

      The prefix/padding must be filled with 0 if @flags contains
      #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.
      Parameter:
      flags - #GstMemoryFlags
      data - data to wrap
      maxsize - allocated size of @data
      offset - offset in @data
      size - size of valid data
      user_data - user_data
      notify - called with @user_data when the memory is freed
      Gibt zurück:
      a new #GstBuffer
    • addCustomMeta

      public CustomMeta addCustomMeta(@Nonnull Str name)
      Creates and adds a #GstCustomMeta for the desired @name. @name must have
      been successfully registered with gst_meta_register_custom().
      Parameter:
      name - the registered name of the desired custom meta
      Gibt zurück:
      The #GstCustomMeta that was added to the buffer
    • addCustomMeta

      public CustomMeta addCustomMeta(String name)
      Creates and adds a #GstCustomMeta for the desired @name. @name must have
      been successfully registered with gst_meta_register_custom().
      Parameter:
      name - the registered name of the desired custom meta
      Gibt zurück:
      The #GstCustomMeta that was added to the buffer
    • addMeta

      public Meta addMeta(@Nonnull MetaInfo info, @Nullable Pointer params)
      Adds metadata for @info to @buffer using the parameters in @params.
      Parameter:
      info - a #GstMetaInfo
      params - params for @info
      Gibt zurück:
      the metadata for the api in @info on @buffer.
    • addParentBufferMeta

      public ParentBufferMeta addParentBufferMeta(@Nonnull Buffer ref)
      Adds a #GstParentBufferMeta to @buffer that holds a reference on
      @ref until the buffer is freed.
      Parameter:
      ref - a #GstBuffer to ref
      Gibt zurück:
      The #GstParentBufferMeta that was added to the buffer
    • addProtectionMeta

      public ProtectionMeta addProtectionMeta(@Nonnull Structure info)
      Attaches protection metadata to a #GstBuffer.
      Parameter:
      info - a #GstStructure holding cryptographic information relating to the sample contained in @buffer. This function takes ownership of @info.
      Gibt zurück:
      a pointer to the added #GstProtectionMeta if successful
    • addReferenceTimestampMeta

      public ReferenceTimestampMeta addReferenceTimestampMeta(@Nonnull Caps reference, long timestamp, long duration)
      Adds a #GstReferenceTimestampMeta to @buffer that holds a @timestamp and
      optionally @duration based on a specific timestamp @reference. See the
      documentation of #GstReferenceTimestampMeta for details.
      Parameter:
      reference - identifier for the timestamp reference.
      timestamp - timestamp
      duration - duration, or %GST_CLOCK_TIME_NONE
      Gibt zurück:
      The #GstReferenceTimestampMeta that was added to the buffer
    • append

      public Buffer append(@Nonnull Buffer buf2)
      Appends all the memory from @buf2 to @buf1. The result buffer will contain a
      concatenation of the memory of @buf1 and @buf2.
      Parameter:
      buf2 - the second source #GstBuffer to append.
      Gibt zurück:
      the new #GstBuffer that contains the memory of the two source buffers.
    • appendMemory

      public void appendMemory(@Nonnull Memory mem)
      Appends the memory block @mem to @buffer. This function takes
      ownership of @mem and thus doesn't increase its refcount.

      This function is identical to gst_buffer_insert_memory() with an index of -1.
      See gst_buffer_insert_memory() for more details.
      Parameter:
      mem - a #GstMemory.
    • appendRegion

      public Buffer appendRegion(@Nonnull Buffer buf2, long offset, long size)
      Appends @size bytes at @offset from @buf2 to @buf1. The result buffer will
      contain a concatenation of the memory of @buf1 and the requested region of
      @buf2.
      Parameter:
      buf2 - the second source #GstBuffer to append.
      offset - the offset in @buf2
      size - the size or -1 of @buf2
      Gibt zurück:
      the new #GstBuffer that contains the memory of the two source buffers.
    • copyDeep

      public Buffer copyDeep()
      Creates a copy of the given buffer. This will make a newly allocated
      copy of the data the source buffer contains.
      Gibt zurück:
      a new copy of @buf if the copy succeeded, %NULL otherwise.
    • copyInto

      public boolean copyInto(@Nonnull Buffer src, int flags, long offset, long size)
      Copies the information from @src into @dest.

      If @dest already contains memory and @flags contains GST_BUFFER_COPY_MEMORY,
      the memory from @src will be appended to @dest.

      @flags indicate which fields will be copied.
      Parameter:
      src - a source #GstBuffer
      flags - flags indicating what metadata fields should be copied.
      offset - offset to copy from
      size - total size to copy. If -1, all data is copied.
      Gibt zurück:
      %TRUE if the copying succeeded, %FALSE otherwise.
    • copyRegion

      public Buffer copyRegion(int flags, long offset, long size)
      Creates a sub-buffer from @parent at @offset and @size.
      This sub-buffer uses the actual memory space of the parent buffer.
      This function will copy the offset and timestamp fields when the
      offset is 0. If not, they will be set to #GST_CLOCK_TIME_NONE and
      #GST_BUFFER_OFFSET_NONE.
      If @offset equals 0 and @size equals the total size of @buffer, the
      duration and offset end fields are also copied. If not they will be set
      to #GST_CLOCK_TIME_NONE and #GST_BUFFER_OFFSET_NONE.
      Parameter:
      flags - the #GstBufferCopyFlags
      offset - the offset into parent #GstBuffer at which the new sub-buffer begins.
      size - the size of the new #GstBuffer sub-buffer, in bytes. If -1, all data is copied.
      Gibt zurück:
      the new #GstBuffer or %NULL if copying failed.
    • extract

      public long extract(long offset, @Nonnull Pointer dest, long size)
      Copies @size bytes starting from @offset in @buffer to @dest.
      Parameter:
      offset - the offset to extract
      dest - the destination address
      size - the size to extract
      Gibt zurück:
      The amount of bytes extracted. This value can be lower than @size when @buffer did not contain enough data.
    • fill

      public long fill(long offset, @Nonnull Pointer src, long size)
      Copies @size bytes from @src to @buffer at @offset.
      Parameter:
      offset - the offset to fill
      src - the source address
      size - the size to fill
      Gibt zurück:
      The amount of bytes copied. This value can be lower than @size when @buffer did not contain enough data.
    • getAllMemory

      public Memory getAllMemory()
      Gets all the memory blocks in @buffer. The memory blocks will be merged
      into one large #GstMemory.
      Gibt zurück:
      a #GstMemory that contains the merged memory.
    • getCustomMeta

      public CustomMeta getCustomMeta(@Nonnull Str name)
      Finds the first #GstCustomMeta on @buffer for the desired @name.
      Parameter:
      name - the registered name of the custom meta to retrieve.
      Gibt zurück:
      the #GstCustomMeta
    • getCustomMeta

      public CustomMeta getCustomMeta(String name)
      Finds the first #GstCustomMeta on @buffer for the desired @name.
      Parameter:
      name - the registered name of the custom meta to retrieve.
      Gibt zurück:
      the #GstCustomMeta
    • getFlags

      public int getFlags()
      Gets the #GstBufferFlags flags set on this buffer.
      Gibt zurück:
      the flags set on this buffer.
    • getMemory

      public Memory getMemory(int idx)
      Gets the memory block at index @idx in @buffer.
      Parameter:
      idx - an index
      Gibt zurück:
      a #GstMemory that contains the data of the memory block at @idx.
    • getMemoryRange

      public Memory getMemoryRange(int idx, int length)
      Gets @length memory blocks in @buffer starting at @idx. The memory blocks will
      be merged into one large #GstMemory.

      If @length is -1, all memory starting from @idx is merged.
      Parameter:
      idx - an index
      length - a length
      Gibt zurück:
      a #GstMemory that contains the merged data of @length blocks starting at @idx.
    • getMeta

      public Meta getMeta(long api)
      Gets the metadata for @api on buffer. When there is no such metadata, %NULL is
      returned. If multiple metadata with the given @api are attached to this
      buffer only the first one is returned. To handle multiple metadata with a
      given API use gst_buffer_iterate_meta() or gst_buffer_foreach_meta() instead
      and check the `meta->info.api` member for the API type.
      Parameter:
      api - the #GType of an API
      Gibt zurück:
      the metadata for @api on @buffer.
    • getNMeta

      public int getNMeta(long api_type)
      Parameter:
      api_type - the #GType of an API
      Gibt zurück:
      number of metas of type @api_type on @buffer.
    • getReferenceTimestampMeta

      public ReferenceTimestampMeta getReferenceTimestampMeta(@Nullable Caps reference)
      Finds the first #GstReferenceTimestampMeta on @buffer that conforms to
      @reference. Conformance is tested by checking if the meta's reference is a
      subset of @reference.

      Buffers can contain multiple #GstReferenceTimestampMeta metadata items.
      Parameter:
      reference - a reference #GstCaps
      Gibt zurück:
      the #GstReferenceTimestampMeta or %NULL when there is no such metadata on @buffer.
    • getSize

      public long getSize()
      Gets the total size of the memory blocks in @buffer.
      Gibt zurück:
      total size of the memory blocks in @buffer.
    • getSizes

      public long getSizes(@Nullable Int64 offset, @Nullable Int64 maxsize)
      Gets the total size of the memory blocks in @buffer.

      When not %NULL, @offset will contain the offset of the data in the
      first memory block in @buffer and @maxsize will contain the sum of
      the size and @offset and the amount of extra padding on the last
      memory block. @offset and @maxsize can be used to resize the
      buffer memory blocks with gst_buffer_resize().
      Parameter:
      offset - a pointer to the offset
      maxsize - a pointer to the maxsize
      Gibt zurück:
      total size of the memory blocks in @buffer.
    • getSizesRange

      public long getSizesRange(int idx, int length, @Nullable Int64 offset, @Nullable Int64 maxsize)
      Gets the total size of @length memory blocks stating from @idx in @buffer.

      When not %NULL, @offset will contain the offset of the data in the
      memory block in @buffer at @idx and @maxsize will contain the sum of the size
      and @offset and the amount of extra padding on the memory block at @idx +
      @length -1.
      @offset and @maxsize can be used to resize the buffer memory blocks with
      gst_buffer_resize_range().
      Parameter:
      idx - an index
      length - a length
      offset - a pointer to the offset
      maxsize - a pointer to the maxsize
      Gibt zurück:
      total size of @length memory blocks starting at @idx in @buffer.
    • hasFlags

      public boolean hasFlags(int flags)
      Gives the status of a specific flag on a buffer.
      Parameter:
      flags - the #GstBufferFlags flag to check.
      Gibt zurück:
      %TRUE if all flags in @flags are found on @buffer.
    • insertMemory

      public void insertMemory(int idx, @Nonnull Memory mem)
      Inserts the memory block @mem into @buffer at @idx. This function takes ownership
      of @mem and thus doesn't increase its refcount.

      Only gst_buffer_get_max_memory() can be added to a buffer. If more memory is
      added, existing memory blocks will automatically be merged to make room for
      the new memory.
      Parameter:
      idx - the index to add the memory at, or -1 to append it to the end
      mem - a #GstMemory.
    • isAllMemoryWritable

      public boolean isAllMemoryWritable()
      Checks if all memory blocks in @buffer are writable.

      Note that this function does not check if @buffer is writable, use
      gst_buffer_is_writable() to check that if needed.
      Gibt zurück:
      %TRUE if all memory blocks in @buffer are writable
    • isMemoryRangeWritable

      public boolean isMemoryRangeWritable(int idx, int length)
      Checks if @length memory blocks in @buffer starting from @idx are writable.

      @length can be -1 to check all the memory blocks after @idx.

      Note that this function does not check if @buffer is writable, use
      gst_buffer_is_writable() to check that if needed.
      Parameter:
      idx - an index
      length - a length, should not be 0
      Gibt zurück:
      %TRUE if the memory range is writable
    • map

      public boolean map(@Nonnull MapInfo info, int flags)
      Fills @info with the #GstMapInfo of all merged memory blocks in @buffer.

      @flags describe the desired access of the memory. When @flags is
      #GST_MAP_WRITE, @buffer should be writable (as returned from
      gst_buffer_is_writable()).

      When @buffer is writable but the memory isn't, a writable copy will
      automatically be created and returned. The readonly copy of the
      buffer memory will then also be replaced with this writable copy.

      The memory in @info should be unmapped with gst_buffer_unmap() after
      usage.
      Parameter:
      info - info about the mapping
      flags - flags for the mapping
      Gibt zurück:
      %TRUE if the map succeeded and @info contains valid data.
    • mapRange

      public boolean mapRange(int idx, int length, @Nonnull MapInfo info, int flags)
      Fills @info with the #GstMapInfo of @length merged memory blocks
      starting at @idx in @buffer. When @length is -1, all memory blocks starting
      from @idx are merged and mapped.

      @flags describe the desired access of the memory. When @flags is
      #GST_MAP_WRITE, @buffer should be writable (as returned from
      gst_buffer_is_writable()).

      When @buffer is writable but the memory isn't, a writable copy will
      automatically be created and returned. The readonly copy of the buffer memory
      will then also be replaced with this writable copy.

      The memory in @info should be unmapped with gst_buffer_unmap() after usage.
      Parameter:
      idx - an index
      length - a length
      info - info about the mapping
      flags - flags for the mapping
      Gibt zurück:
      %TRUE if the map succeeded and @info contains valid data.
    • memcmp

      public int memcmp(long offset, @Nonnull Pointer mem, long size)
      Compares @size bytes starting from @offset in @buffer with the memory in @mem.
      Parameter:
      offset - the offset in @buffer
      mem - the memory to compare
      size - the size to compare
      Gibt zurück:
      0 if the memory is equal.
    • memset

      public long memset(long offset, int val, long size)
      Fills @buf with @size bytes with @val starting from @offset.
      Parameter:
      offset - the offset in @buffer
      val - the value to set
      size - the size to set
      Gibt zurück:
      The amount of bytes filled. This value can be lower than @size when @buffer did not contain enough data.
    • nMemory

      public int nMemory()
      Gets the amount of memory blocks that this buffer has. This amount is never
      larger than what gst_buffer_get_max_memory() returns.
      Gibt zurück:
      the number of memory blocks this buffer is made of.
    • peekMemory

      public Memory peekMemory(int idx)
      Gets the memory block at @idx in @buffer. The memory block stays valid until
      the memory block in @buffer is removed, replaced or merged, typically with
      any call that modifies the memory in @buffer.
      Parameter:
      idx - an index
      Gibt zurück:
      the #GstMemory at @idx.
    • prependMemory

      public void prependMemory(@Nonnull Memory mem)
      Prepends the memory block @mem to @buffer. This function takes
      ownership of @mem and thus doesn't increase its refcount.

      This function is identical to gst_buffer_insert_memory() with an index of 0.
      See gst_buffer_insert_memory() for more details.
      Parameter:
      mem - a #GstMemory.
    • removeAllMemory

      public void removeAllMemory()
      Removes all the memory blocks in @buffer.
    • removeMemory

      public void removeMemory(int idx)
      Removes the memory block in @b at index @i.
      Parameter:
      idx - an index
    • removeMemoryRange

      public void removeMemoryRange(int idx, int length)
      Removes @length memory blocks in @buffer starting from @idx.

      @length can be -1, in which case all memory starting from @idx is removed.
      Parameter:
      idx - an index
      length - a length
    • removeMeta

      public boolean removeMeta(@Nonnull Meta meta)
      Removes the metadata for @meta on @buffer.
      Parameter:
      meta - a #GstMeta
      Gibt zurück:
      %TRUE if the metadata existed and was removed, %FALSE if no such metadata was on @buffer.
    • replaceAllMemory

      public void replaceAllMemory(@Nonnull Memory mem)
      Replaces all memory in @buffer with @mem.
      Parameter:
      mem - a #GstMemory
    • replaceMemory

      public void replaceMemory(int idx, @Nonnull Memory mem)
      Replaces the memory block at index @idx in @buffer with @mem.
      Parameter:
      idx - an index
      mem - a #GstMemory
    • replaceMemoryRange

      public void replaceMemoryRange(int idx, int length, @Nonnull Memory mem)
      Replaces @length memory blocks in @buffer starting at @idx with @mem.

      If @length is -1, all memory starting from @idx will be removed and
      replaced with @mem.

      @buffer should be writable.
      Parameter:
      idx - an index
      length - a length, should not be 0
      mem - a #GstMemory
    • resize

      public void resize(long offset, long size)
      Sets the offset and total size of the memory blocks in @buffer.
      Parameter:
      offset - the offset adjustment
      size - the new size or -1 to just adjust the offset
    • resizeRange

      public boolean resizeRange(int idx, int length, long offset, long size)
      Sets the total size of the @length memory blocks starting at @idx in
      @buffer
      Parameter:
      idx - an index
      length - a length
      offset - the offset adjustment
      size - the new size or -1 to just adjust the offset
      Gibt zurück:
      %TRUE if resizing succeeded, %FALSE otherwise.
    • setFlags

      public boolean setFlags(int flags)
      Sets one or more buffer flags on a buffer.
      Parameter:
      flags - the #GstBufferFlags to set.
      Gibt zurück:
      %TRUE if @flags were successfully set on buffer.
    • setSize

      public void setSize(long size)
      Sets the total size of the memory blocks in @buffer.
      Parameter:
      size - the new size
    • unmap

      public void unmap(@Nonnull MapInfo info)
      Releases the memory previously mapped with gst_buffer_map().
      Parameter:
      info - a #GstMapInfo
    • unsetFlags

      public boolean unsetFlags(int flags)
      Clears one or more buffer flags.
      Parameter:
      flags - the #GstBufferFlags to clear
      Gibt zurück:
      true if @flags is successfully cleared from buffer.
    • getMaxMemory

      public static int getMaxMemory()
      Gets the maximum amount of memory blocks that a buffer can hold. This is a
      compile time constant that can be queried with the function.

      When more memory blocks are added, existing memory blocks will be merged
      together to make room for the new block.
      Gibt zurück:
      the maximum amount of memory blocks that a buffer can hold.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()