public class Buffer extends MiniObject
See upstream documentation at https://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstBuffer.html
NativeObject.Initializer, NativeObject.TypeProvider, NativeObject.TypeRegistration<T extends NativeObject>
Modifier and Type | Field and Description |
---|---|
static String |
GTYPE_NAME |
Constructor and Description |
---|
Buffer()
Creates a newly allocated buffer without any data.
|
Buffer(int size)
Creates a newly allocated buffer with data of the given size.
|
Modifier and Type | Method and Description |
---|---|
long |
getDecodeTimestamp()
Gets the timestamps of this buffer.
|
long |
getDuration()
Gets the duration of this buffer.
|
EnumSet<BufferFlags> |
getFlags()
Get the GstBufferFlags describing this buffer.
|
long |
getOffset()
Get the offset (media-specific) of this buffer
|
long |
getOffsetEnd()
Get the offset (media-specific) of this buffer
|
long |
getPresentationTimestamp()
Gets the timestamps of this buffer.
|
ByteBuffer |
map(boolean writable)
Gets a
ByteBuffer that can access the native memory
associated with this Buffer, with the option of ensuring the memory is
writable. |
void |
setDecodeTimestamp(long val)
Set the decode timestamp of the Buffer
|
void |
setDuration(long val)
Set the duration of this buffer.
|
boolean |
setFlags(EnumSet<BufferFlags> flags)
Set some of the GstBufferFlags describing this buffer.
|
void |
setOffset(long val)
Set the offset (media-specific) of this buffer
|
void |
setOffsetEnd(long val)
Set the offset (media-specific) of this buffer
|
void |
setPresentationTimestamp(long val)
Set the presentation timestamp of the Buffer
|
void |
unmap()
Release the memory previously mapped with
map(boolean) |
boolean |
unsetFlags(EnumSet<BufferFlags> flags)
unset the GstBufferFlags describing this buffer.
|
copy, getRefCount, isWritable, makeWritable
close, disown, dispose, equals, getPointer, getRawPointer, hashCode, invalidate, toString
public static final String GTYPE_NAME
public Buffer()
public Buffer(int size)
size
- public ByteBuffer map(boolean writable)
ByteBuffer
that can access the native memory
associated with this Buffer, with the option of ensuring the memory is
writable.
When requesting a writable buffer, if the buffer is writable but the underlying 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 Buffer should be unmapped with unmap()
after usage.
writable
- ByteBuffer
that can access this Buffer's data.public void unmap()
map(boolean)
public long getDecodeTimestamp()
ClockTime.NONE
when the timestamp is not known or relevant.public void setDecodeTimestamp(long val)
val
- a long representing the timestamp or
ClockTime.NONE
when the timestamp is not known or relevant.public long getPresentationTimestamp()
ClockTime.NONE
when the timestamp is not known or relevant.public void setPresentationTimestamp(long val)
val
- a long representing the timestamp or
ClockTime.NONE
when the timestamp is not known or relevant.public long getDuration()
ClockTime.NONE
when the timestamp is not known or relevant.public void setDuration(long val)
val
- a long representing the duration or
ClockTime.NONE
when the timestamp is not known or relevant.public long getOffset()
public void setOffset(long val)
val
- 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.public long getOffsetEnd()
public void setOffsetEnd(long val)
val
- 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.@Gst.Since(minor=10) public EnumSet<BufferFlags> getFlags()
BufferFlags
@Gst.Since(minor=10) public boolean setFlags(EnumSet<BufferFlags> flags)
flags
- an EnumSet of BufferFlags
to be set on the buffer.@Gst.Since(minor=10) public boolean unsetFlags(EnumSet<BufferFlags> flags)
flags
- an EnumSet of BufferFlags
to be cleared on the buffer.Copyright © 2019 gstreamer-java. All rights reserved.