GstBuffer
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.
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)
GstBuffer
The structure of a GstBuffer. Use the associated macros to access the public variables.
Members
mini_object
(GstMiniObject)
–
the parent structure
pool
(GstBufferPool *)
–
pointer to the pool owner of the buffer
pts
(GstClockTime)
–
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.
dts
(GstClockTime)
–
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.
duration
(GstClockTime)
–
duration in time of the buffer data, can be GST_CLOCK_TIME_NONE when the duration is not known or relevant.
offset
(guint64)
–
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.
offset_end
(guint64)
–
the last offset contained in this buffer. It has the same format as offset.
GstBuffer
The structure of a GstBuffer. Use the associated macros to access the public variables.
Members
mini_object
(GstMiniObject)
–
the parent structure
pool
(GstBufferPool)
–
pointer to the pool owner of the buffer
pts
(GstClockTime)
–
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.
dts
(GstClockTime)
–
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.
duration
(GstClockTime)
–
duration in time of the buffer data, can be GST_CLOCK_TIME_NONE when the duration is not known or relevant.
offset
(Number)
–
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.
offset_end
(Number)
–
the last offset contained in this buffer. It has the same format as offset.
GstBuffer
The structure of a GstBuffer. Use the associated macros to access the public variables.
Members
mini_object
(GstMiniObject)
–
the parent structure
pool
(GstBufferPool)
–
pointer to the pool owner of the buffer
pts
(GstClockTime)
–
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.
dts
(GstClockTime)
–
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.
duration
(GstClockTime)
–
duration in time of the buffer data, can be GST_CLOCK_TIME_NONE when the duration is not known or relevant.
offset
(int)
–
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.
offset_end
(int)
–
the last offset contained in this buffer. It has the same format as offset.
Constructors
gst_buffer_new
GstBuffer * gst_buffer_new ()
Creates a newly allocated buffer without any data.
MT safe.
the new GstBuffer.
Gst.Buffer.prototype.new
function Gst.Buffer.prototype.new(): {
// javascript wrapper for 'gst_buffer_new'
}
Creates a newly allocated buffer without any data.
MT safe.
the new Gst.Buffer.
Gst.Buffer.new
def Gst.Buffer.new ():
#python wrapper for 'gst_buffer_new'
Creates a newly allocated buffer without any data.
MT safe.
the new Gst.Buffer.
gst_buffer_new_allocate
GstBuffer * gst_buffer_new_allocate (GstAllocator * allocator, gsize size, GstAllocationParams * 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.
MT safe.
Parameters:
allocator
(
[transfer: none]
[allow-none]
)
–
the GstAllocator to use, or NULL to use the default allocator
size
–
the size in bytes of the new buffer's data.
params
(
[transfer: none]
[allow-none]
)
–
optional parameters
Gst.Buffer.prototype.new_allocate
function Gst.Buffer.prototype.new_allocate(allocator: Gst.Allocator, size: Number, params: Gst.AllocationParams): {
// javascript wrapper for 'gst_buffer_new_allocate'
}
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.
MT safe.
Parameters:
allocator
(
Gst.Allocator
)
–
the Gst.Allocator to use, or null to use the default allocator
size
(
Number
)
–
the size in bytes of the new buffer's data.
params
(
Gst.AllocationParams
)
–
optional parameters
a new Gst.Buffer, or null if the memory couldn't be allocated.
Gst.Buffer.new_allocate
def Gst.Buffer.new_allocate (allocator, size, params):
#python wrapper for 'gst_buffer_new_allocate'
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, None will be returned. The allocated buffer memory is not cleared.
When allocator is None, the default memory allocator will be used.
Note that when size == 0, the buffer will not have memory associated with it.
MT safe.
Parameters:
allocator
(
Gst.Allocator
)
–
the Gst.Allocator to use, or None to use the default allocator
size
(
int
)
–
the size in bytes of the new buffer's data.
params
(
Gst.AllocationParams
)
–
optional parameters
a new Gst.Buffer, or None if the memory couldn't be allocated.
gst_buffer_new_wrapped
GstBuffer * gst_buffer_new_wrapped (gpointer data, gsize size)
Creates a new buffer that wraps the given data. The memory will be freed with g_free and will be marked writable.
MT safe.
Parameters:
data
(
[array length=size]
[element-type guint8]
[transfer: full]
)
–
data to wrap
size
–
allocated size of data
a new GstBuffer
Gst.Buffer.prototype.new_wrapped
function Gst.Buffer.prototype.new_wrapped(data: [ Number ], size: Number): {
// javascript wrapper for 'gst_buffer_new_wrapped'
}
Creates a new buffer that wraps the given data. The memory will be freed with g_free and will be marked writable.
MT safe.
a new Gst.Buffer
Gst.Buffer.new_wrapped
def Gst.Buffer.new_wrapped (data, size):
#python wrapper for 'gst_buffer_new_wrapped'
Creates a new buffer that wraps the given data. The memory will be freed with g_free and will be marked writable.
MT safe.
a new Gst.Buffer
gst_buffer_new_wrapped_bytes
GstBuffer * gst_buffer_new_wrapped_bytes (GBytes * 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.
MT safe.
Parameters:
bytes
(
[transfer: none]
)
–
a GBytes to wrap
a new GstBuffer wrapping bytes
Since : 1.16
Gst.Buffer.prototype.new_wrapped_bytes
function Gst.Buffer.prototype.new_wrapped_bytes(bytes: GLib.Bytes): {
// javascript wrapper for 'gst_buffer_new_wrapped_bytes'
}
Creates a new Gst.Buffer that wraps the given bytes. The data inside bytes cannot be null and the resulting buffer will be marked as read only.
MT safe.
Parameters:
bytes
(
GLib.Bytes
)
–
a GLib.Bytes to wrap
a new Gst.Buffer wrapping bytes
Since : 1.16
Gst.Buffer.new_wrapped_bytes
def Gst.Buffer.new_wrapped_bytes (bytes):
#python wrapper for 'gst_buffer_new_wrapped_bytes'
Creates a new Gst.Buffer that wraps the given bytes. The data inside bytes cannot be None and the resulting buffer will be marked as read only.
MT safe.
Parameters:
bytes
(
GLib.Bytes
)
–
a GLib.Bytes to wrap
a new Gst.Buffer wrapping bytes
Since : 1.16
gst_buffer_new_wrapped_full
GstBuffer * gst_buffer_new_wrapped_full (GstMemoryFlags flags, gpointer data, gsize maxsize, gsize offset, gsize size, gpointer user_data, GDestroyNotify notify)
Allocate 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.
Parameters:
flags
–
data
(
[array length=size]
[element-type guint8]
[transfer: none]
)
–
data to wrap
maxsize
–
allocated size of data
offset
–
offset in data
size
–
size of valid data
user_data
(
[allow-none]
)
–
user_data
notify
(
[allow-none]
[scope async]
[closure]
)
–
called with user_data when the memory is freed
a new GstBuffer
Gst.Buffer.prototype.new_wrapped_full
function Gst.Buffer.prototype.new_wrapped_full(flags: Gst.MemoryFlags, data: [ Number ], maxsize: Number, offset: Number, size: Number, user_data: Object, notify: GLib.DestroyNotify): {
// javascript wrapper for 'gst_buffer_new_wrapped_full'
}
Allocate 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.MemoryFlags.ZERO_PREFIXED and Gst.MemoryFlags.ZERO_PADDED respectively.
Parameters:
flags
(
Gst.MemoryFlags
)
–
data
(
[ Number ]
)
–
data to wrap
maxsize
(
Number
)
–
allocated size of data
offset
(
Number
)
–
offset in data
size
(
Number
)
–
size of valid data
user_data
(
Object
)
–
user_data
notify
(
GLib.DestroyNotify
)
–
called with user_data when the memory is freed
a new Gst.Buffer
Gst.Buffer.new_wrapped_full
def Gst.Buffer.new_wrapped_full (flags, data, maxsize, offset, size, *user_data, notify):
#python wrapper for 'gst_buffer_new_wrapped_full'
Allocate 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.MemoryFlags.ZERO_PREFIXED and Gst.MemoryFlags.ZERO_PADDED respectively.
Parameters:
flags
(
Gst.MemoryFlags
)
–
data
(
[ int ]
)
–
data to wrap
maxsize
(
int
)
–
allocated size of data
offset
(
int
)
–
offset in data
size
(
int
)
–
size of valid data
user_data
(
variadic
)
–
user_data
notify
(
GLib.DestroyNotify
)
–
called with user_data when the memory is freed
a new Gst.Buffer
Methods
gst_buffer_add_custom_meta
GstCustomMeta * gst_buffer_add_custom_meta (GstBuffer * buffer, const gchar * name)
Creates and adds a GstCustomMeta for the desired name. name must have been successfully registered with gst_meta_register_custom.
Parameters:
buffer
(
[transfer: none]
)
–
name
–
the registered name of the desired custom meta
The GstCustomMeta that was added to the buffer
Since : 1.20
Gst.Buffer.prototype.add_custom_meta
function Gst.Buffer.prototype.add_custom_meta(name: String): {
// javascript wrapper for 'gst_buffer_add_custom_meta'
}
Creates and adds a Gst.CustomMeta for the desired name. name must have been successfully registered with Gst.prototype.meta_register_custom.
Parameters:
buffer
(
Gst.Buffer
)
–
name
(
String
)
–
the registered name of the desired custom meta
The Gst.CustomMeta that was added to the buffer
Since : 1.20
Gst.Buffer.add_custom_meta
def Gst.Buffer.add_custom_meta (self, name):
#python wrapper for 'gst_buffer_add_custom_meta'
Creates and adds a Gst.CustomMeta for the desired name. name must have been successfully registered with Gst.meta_register_custom.
The Gst.CustomMeta that was added to the buffer
Since : 1.20
gst_buffer_add_meta
GstMeta * gst_buffer_add_meta (GstBuffer * buffer, const GstMetaInfo * info, gpointer params)
Add metadata for info to buffer using the parameters in params.
the metadata for the api in info on buffer.
Gst.Buffer.prototype.add_meta
function Gst.Buffer.prototype.add_meta(info: Gst.MetaInfo, params: Object): {
// javascript wrapper for 'gst_buffer_add_meta'
}
Add metadata for info to buffer using the parameters in params.
the metadata for the api in info on buffer.
Gst.Buffer.add_meta
def Gst.Buffer.add_meta (self, info, params):
#python wrapper for 'gst_buffer_add_meta'
Add metadata for info to buffer using the parameters in params.
the metadata for the api in info on buffer.
gst_buffer_add_parent_buffer_meta
GstParentBufferMeta * gst_buffer_add_parent_buffer_meta (GstBuffer * buffer, GstBuffer * ref)
Add a GstParentBufferMeta to buffer that holds a reference on ref until the buffer is freed.
The GstParentBufferMeta that was added to the buffer
Since : 1.6
Gst.Buffer.prototype.add_parent_buffer_meta
function Gst.Buffer.prototype.add_parent_buffer_meta(ref: Gst.Buffer): {
// javascript wrapper for 'gst_buffer_add_parent_buffer_meta'
}
Add a Gst.ParentBufferMeta to buffer that holds a reference on ref until the buffer is freed.
The Gst.ParentBufferMeta that was added to the buffer
Since : 1.6
Gst.Buffer.add_parent_buffer_meta
def Gst.Buffer.add_parent_buffer_meta (self, ref):
#python wrapper for 'gst_buffer_add_parent_buffer_meta'
Add a Gst.ParentBufferMeta to buffer that holds a reference on ref until the buffer is freed.
The Gst.ParentBufferMeta that was added to the buffer
Since : 1.6
gst_buffer_add_protection_meta
GstProtectionMeta * gst_buffer_add_protection_meta (GstBuffer * buffer, GstStructure * info)
Attaches protection metadata to a GstBuffer.
Parameters:
buffer
–
GstBuffer holding an encrypted sample, to which protection metadata should be added.
info
(
[transfer: full]
)
–
a GstStructure holding cryptographic information relating to the sample contained in buffer. This function takes ownership of info.
a pointer to the added GstProtectionMeta if successful; NULL if unsuccessful.
Since : 1.6
Gst.Buffer.prototype.add_protection_meta
function Gst.Buffer.prototype.add_protection_meta(info: Gst.Structure): {
// javascript wrapper for 'gst_buffer_add_protection_meta'
}
Attaches protection metadata to a Gst.Buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
Gst.Buffer holding an encrypted sample, to which protection metadata should be added.
info
(
Gst.Structure
)
–
a Gst.Structure holding cryptographic information relating to the sample contained in buffer. This function takes ownership of info.
a pointer to the added Gst.ProtectionMeta if successful; null if unsuccessful.
Since : 1.6
Gst.Buffer.add_protection_meta
def Gst.Buffer.add_protection_meta (self, info):
#python wrapper for 'gst_buffer_add_protection_meta'
Attaches protection metadata to a Gst.Buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
Gst.Buffer holding an encrypted sample, to which protection metadata should be added.
info
(
Gst.Structure
)
–
a Gst.Structure holding cryptographic information relating to the sample contained in buffer. This function takes ownership of info.
a pointer to the added Gst.ProtectionMeta if successful; None if unsuccessful.
Since : 1.6
gst_buffer_add_reference_timestamp_meta
GstReferenceTimestampMeta * gst_buffer_add_reference_timestamp_meta (GstBuffer * buffer, GstCaps * reference, GstClockTime timestamp, GstClockTime duration)
Add a GstReferenceTimestampMeta to buffer that holds a timestamp and optionally duration based on a specific timestamp reference. See the documentation of GstReferenceTimestampMeta for details.
Parameters:
buffer
(
[transfer: none]
)
–
reference
(
[transfer: none]
)
–
identifier for the timestamp reference.
timestamp
–
timestamp
duration
–
duration, or GST_CLOCK_TIME_NONE
The GstReferenceTimestampMeta that was added to the buffer
Since : 1.14
Gst.Buffer.prototype.add_reference_timestamp_meta
function Gst.Buffer.prototype.add_reference_timestamp_meta(reference: Gst.Caps, timestamp: Number, duration: Number): {
// javascript wrapper for 'gst_buffer_add_reference_timestamp_meta'
}
Add a Gst.ReferenceTimestampMeta to buffer that holds a timestamp and optionally duration based on a specific timestamp reference. See the documentation of Gst.ReferenceTimestampMeta for details.
Parameters:
buffer
(
Gst.Buffer
)
–
reference
(
Gst.Caps
)
–
identifier for the timestamp reference.
timestamp
(
Number
)
–
timestamp
duration
(
Number
)
–
duration, or Gst.CLOCK_TIME_NONE
The Gst.ReferenceTimestampMeta that was added to the buffer
Since : 1.14
Gst.Buffer.add_reference_timestamp_meta
def Gst.Buffer.add_reference_timestamp_meta (self, reference, timestamp, duration):
#python wrapper for 'gst_buffer_add_reference_timestamp_meta'
Add a Gst.ReferenceTimestampMeta to buffer that holds a timestamp and optionally duration based on a specific timestamp reference. See the documentation of Gst.ReferenceTimestampMeta for details.
Parameters:
buffer
(
Gst.Buffer
)
–
reference
(
Gst.Caps
)
–
identifier for the timestamp reference.
timestamp
(
int
)
–
timestamp
duration
(
int
)
–
duration, or Gst.CLOCK_TIME_NONE
The Gst.ReferenceTimestampMeta that was added to the buffer
Since : 1.14
gst_buffer_append
GstBuffer * gst_buffer_append (GstBuffer * buf1, GstBuffer * buf2)
Append all the memory from buf2 to buf1. The result buffer will contain a concatenation of the memory of buf1 and buf2.
Parameters:
buf1
(
[transfer: full]
)
–
the first source GstBuffer to append.
buf2
(
[transfer: full]
)
–
the second source GstBuffer to append.
the new GstBuffer that contains the memory of the two source buffers.
Gst.Buffer.prototype.append
function Gst.Buffer.prototype.append(buf2: Gst.Buffer): {
// javascript wrapper for 'gst_buffer_append'
}
Append all the memory from buf2 to buf1. The result buffer will contain a concatenation of the memory of buf1 and buf2.
Parameters:
buf1
(
Gst.Buffer
)
–
the first source Gst.Buffer to append.
buf2
(
Gst.Buffer
)
–
the second source Gst.Buffer to append.
the new Gst.Buffer that contains the memory of the two source buffers.
Gst.Buffer.append
def Gst.Buffer.append (self, buf2):
#python wrapper for 'gst_buffer_append'
Append all the memory from buf2 to buf1. The result buffer will contain a concatenation of the memory of buf1 and buf2.
Parameters:
buf1
(
Gst.Buffer
)
–
the first source Gst.Buffer to append.
buf2
(
Gst.Buffer
)
–
the second source Gst.Buffer to append.
the new Gst.Buffer that contains the memory of the two source buffers.
gst_buffer_append_memory
gst_buffer_append_memory (GstBuffer * buffer, GstMemory * mem)
Append 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.
Gst.Buffer.prototype.append_memory
function Gst.Buffer.prototype.append_memory(mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_append_memory'
}
Append 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.prototype.insert_memory with an index of -1. See Gst.Buffer.prototype.insert_memory for more details.
Gst.Buffer.append_memory
def Gst.Buffer.append_memory (self, mem):
#python wrapper for 'gst_buffer_append_memory'
Append 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.
gst_buffer_append_region
GstBuffer * gst_buffer_append_region (GstBuffer * buf1, GstBuffer * buf2, gssize offset, gssize size)
Append 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.
Parameters:
buf1
(
[transfer: full]
)
–
the first source GstBuffer to append.
buf2
(
[transfer: full]
)
–
the second source GstBuffer to append.
offset
–
the offset in buf2
size
–
the size or -1 of buf2
the new GstBuffer that contains the memory of the two source buffers.
Gst.Buffer.prototype.append_region
function Gst.Buffer.prototype.append_region(buf2: Gst.Buffer, offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_append_region'
}
Append 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.
Parameters:
buf1
(
Gst.Buffer
)
–
the first source Gst.Buffer to append.
buf2
(
Gst.Buffer
)
–
the second source Gst.Buffer to append.
offset
(
Number
)
–
the offset in buf2
size
(
Number
)
–
the size or -1 of buf2
the new Gst.Buffer that contains the memory of the two source buffers.
Gst.Buffer.append_region
def Gst.Buffer.append_region (self, buf2, offset, size):
#python wrapper for 'gst_buffer_append_region'
Append 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.
Parameters:
buf1
(
Gst.Buffer
)
–
the first source Gst.Buffer to append.
buf2
(
Gst.Buffer
)
–
the second source Gst.Buffer to append.
offset
(
int
)
–
the offset in buf2
size
(
int
)
–
the size or -1 of buf2
the new Gst.Buffer that contains the memory of the two source buffers.
gst_buffer_copy
GstBuffer * gst_buffer_copy (const GstBuffer * buf)
Create a copy of the given buffer. This will only copy the buffer's data to a newly allocated memory if needed (if the type of memory requires it), otherwise the underlying data is just referenced. Check gst_buffer_copy_deep if you want to force the data to be copied to newly allocated memory.
Parameters:
buf
–
a GstBuffer.
a new copy of buf.
gst_buffer_copy_deep
GstBuffer * gst_buffer_copy_deep (const GstBuffer * buf)
Create a copy of the given buffer. This will make a newly allocated copy of the data the source buffer contains.
Parameters:
buf
–
a GstBuffer.
a new copy of buf.
Since : 1.6
Gst.Buffer.prototype.copy_deep
function Gst.Buffer.prototype.copy_deep(): {
// javascript wrapper for 'gst_buffer_copy_deep'
}
Create a copy of the given buffer. This will make a newly allocated copy of the data the source buffer contains.
Parameters:
buf
(
Gst.Buffer
)
–
a Gst.Buffer.
a new copy of buf.
Since : 1.6
Gst.Buffer.copy_deep
def Gst.Buffer.copy_deep (self):
#python wrapper for 'gst_buffer_copy_deep'
Create a copy of the given buffer. This will make a newly allocated copy of the data the source buffer contains.
Parameters:
buf
(
Gst.Buffer
)
–
a Gst.Buffer.
a new copy of buf.
Since : 1.6
gst_buffer_copy_into
gboolean gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, GstBufferCopyFlags flags, gsize offset, gsize 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.
Parameters:
dest
–
a destination GstBuffer
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.
Gst.Buffer.prototype.copy_into
function Gst.Buffer.prototype.copy_into(src: Gst.Buffer, flags: Gst.BufferCopyFlags, offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_copy_into'
}
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.
Parameters:
dest
(
Gst.Buffer
)
–
a destination Gst.Buffer
src
(
Gst.Buffer
)
–
a source Gst.Buffer
flags
(
Gst.BufferCopyFlags
)
–
flags indicating what metadata fields should be copied.
offset
(
Number
)
–
offset to copy from
size
(
Number
)
–
total size to copy. If -1, all data is copied.
Gst.Buffer.copy_into
def Gst.Buffer.copy_into (self, src, flags, offset, size):
#python wrapper for 'gst_buffer_copy_into'
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.
Parameters:
dest
(
Gst.Buffer
)
–
a destination Gst.Buffer
src
(
Gst.Buffer
)
–
a source Gst.Buffer
flags
(
Gst.BufferCopyFlags
)
–
flags indicating what metadata fields should be copied.
offset
(
int
)
–
offset to copy from
size
(
int
)
–
total size to copy. If -1, all data is copied.
gst_buffer_copy_region
GstBuffer * gst_buffer_copy_region (GstBuffer * parent, GstBufferCopyFlags flags, gsize offset, gsize 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.
MT safe.
Parameters:
parent
–
a GstBuffer.
flags
–
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.
Gst.Buffer.prototype.copy_region
function Gst.Buffer.prototype.copy_region(flags: Gst.BufferCopyFlags, offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_copy_region'
}
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.
MT safe.
Parameters:
parent
(
Gst.Buffer
)
–
a Gst.Buffer.
flags
(
Gst.BufferCopyFlags
)
–
offset
(
Number
)
–
the offset into parent Gst.Buffer at which the new sub-buffer begins.
size
(
Number
)
–
the size of the new Gst.Buffer sub-buffer, in bytes. If -1, all data is copied.
the new Gst.Buffer or null if the arguments were invalid.
Gst.Buffer.copy_region
def Gst.Buffer.copy_region (self, flags, offset, size):
#python wrapper for 'gst_buffer_copy_region'
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.
MT safe.
Parameters:
parent
(
Gst.Buffer
)
–
a Gst.Buffer.
flags
(
Gst.BufferCopyFlags
)
–
offset
(
int
)
–
the offset into parent Gst.Buffer at which the new sub-buffer begins.
size
(
int
)
–
the size of the new Gst.Buffer sub-buffer, in bytes. If -1, all data is copied.
the new Gst.Buffer or None if the arguments were invalid.
gst_buffer_extract
gsize gst_buffer_extract (GstBuffer * buffer, gsize offset, gpointer dest, gsize size)
Copy size bytes starting from offset in buffer to dest.
Parameters:
buffer
–
a GstBuffer.
offset
–
the offset to extract
dest
–
(out caller-allocates) (array length=size) (element-type guint8): the destination address
size
–
the size to extract
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.prototype.extract
function Gst.Buffer.prototype.extract(offset: Number): {
// javascript wrapper for 'gst_buffer_extract'
}
Copy size bytes starting from offset in buffer to dest.
Returns a tuple made of:
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
dest
(
[ Number ]
)
–
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
size
(
Number
)
–
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.extract
def Gst.Buffer.extract (self, offset):
#python wrapper for 'gst_buffer_extract'
Copy size bytes starting from offset in buffer to dest.
Returns a tuple made of:
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
dest
(
[ int ]
)
–
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
size
(
int
)
–
The amount of bytes extracted. This value can be lower than size when buffer did not contain enough data.
gst_buffer_extract_dup
gst_buffer_extract_dup (GstBuffer * buffer, gsize offset, gsize size, gpointer * dest, gsize * dest_size)
Extracts a copy of at most size bytes the data at offset into newly-allocated memory. dest must be freed using g_free when done.
Parameters:
buffer
–
offset
–
the offset to extract
size
–
the size to extract
dest
(
[array length=dest_size]
[element-type guint8]
[out]
)
–
A pointer where the destination array will be written. Might be NULL if the size is 0.
dest_size
(
[out]
)
–
A location where the size of dest can be written
Since : 1.0.10
Gst.Buffer.prototype.extract_dup
function Gst.Buffer.prototype.extract_dup(offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_extract_dup'
}
Extracts a copy of at most size bytes the data at offset into newly-allocated memory. dest must be freed using GLib.prototype.free when done.
Parameters:
buffer
(
Gst.Buffer
)
–
offset
(
Number
)
–
the offset to extract
size
(
Number
)
–
the size to extract
Since : 1.0.10
Gst.Buffer.extract_dup
def Gst.Buffer.extract_dup (self, offset, size):
#python wrapper for 'gst_buffer_extract_dup'
Extracts a copy of at most size bytes the data at offset into newly-allocated memory. dest must be freed using GLib.free when done.
Parameters:
buffer
(
Gst.Buffer
)
–
offset
(
int
)
–
the offset to extract
size
(
int
)
–
the size to extract
Since : 1.0.10
gst_buffer_fill
gsize gst_buffer_fill (GstBuffer * buffer, gsize offset, gconstpointer src, gsize size)
Copy size bytes from src to buffer at offset.
Parameters:
buffer
–
a GstBuffer.
offset
–
the offset to fill
src
(
[array length=size]
[element-type guint8]
)
–
the source address
size
–
the size to fill
The amount of bytes copied. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.prototype.fill
function Gst.Buffer.prototype.fill(offset: Number, src: [ Number ], size: Number): {
// javascript wrapper for 'gst_buffer_fill'
}
Copy size bytes from src to buffer at offset.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
Number
)
–
the offset to fill
src
(
[ Number ]
)
–
the source address
size
(
Number
)
–
the size to fill
The amount of bytes copied. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.fill
def Gst.Buffer.fill (self, offset, src, size):
#python wrapper for 'gst_buffer_fill'
Copy size bytes from src to buffer at offset.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
int
)
–
the offset to fill
src
(
[ int ]
)
–
the source address
size
(
int
)
–
the size to fill
The amount of bytes copied. This value can be lower than size when buffer did not contain enough data.
gst_buffer_find_memory
gboolean gst_buffer_find_memory (GstBuffer * buffer, gsize offset, gsize size, guint * idx, guint * length, gsize * skip)
Find the memory blocks that span size bytes starting from offset in buffer.
When this function returns TRUE, idx will contain the index of the first memory block where the byte for offset can be found and length contains the number of memory blocks containing the size remaining bytes. skip contains the number of bytes to skip in the memory block at idx to get to the byte for offset.
size can be -1 to get all the memory blocks after idx.
Parameters:
buffer
–
a GstBuffer.
offset
–
an offset
size
–
a size
idx
(
[out]
)
–
pointer to index
length
(
[out]
)
–
pointer to length
skip
(
[out]
)
–
pointer to skip
TRUE when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.
Gst.Buffer.prototype.find_memory
function Gst.Buffer.prototype.find_memory(offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_find_memory'
}
Find the memory blocks that span size bytes starting from offset in buffer.
When this function returns true, idx will contain the index of the first memory block where the byte for offset can be found and length contains the number of memory blocks containing the size remaining bytes. skip contains the number of bytes to skip in the memory block at idx to get to the byte for offset.
size can be -1 to get all the memory blocks after idx.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
Number
)
–
an offset
size
(
Number
)
–
a size
Returns a tuple made of:
true when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.
idx
(
Number
)
–
true when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.
Gst.Buffer.find_memory
def Gst.Buffer.find_memory (self, offset, size):
#python wrapper for 'gst_buffer_find_memory'
Find the memory blocks that span size bytes starting from offset in buffer.
When this function returns True, idx will contain the index of the first memory block where the byte for offset can be found and length contains the number of memory blocks containing the size remaining bytes. skip contains the number of bytes to skip in the memory block at idx to get to the byte for offset.
size can be -1 to get all the memory blocks after idx.
Returns a tuple made of:
True when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.
idx
(
int
)
–
True when size bytes starting from offset could be found in buffer and idx, length and skip will be filled.
gst_buffer_foreach_meta
gboolean gst_buffer_foreach_meta (GstBuffer * buffer, GstBufferForeachMetaFunc func, gpointer user_data)
Call func with user_data for each meta in buffer.
func can modify the passed meta pointer or its contents. The return value of func define if this function returns or if the remaining metadata items in the buffer should be skipped.
Parameters:
buffer
–
func
(
[scope call]
)
–
a GstBufferForeachMetaFunc to call
user_data
(
[closure]
)
–
user data passed to func
Gst.Buffer.prototype.foreach_meta
function Gst.Buffer.prototype.foreach_meta(func: Gst.BufferForeachMetaFunc, user_data: Object): {
// javascript wrapper for 'gst_buffer_foreach_meta'
}
Call func with user_data for each meta in buffer.
func can modify the passed meta pointer or its contents. The return value of func define if this function returns or if the remaining metadata items in the buffer should be skipped.
Parameters:
buffer
(
Gst.Buffer
)
–
func
(
Gst.BufferForeachMetaFunc
)
–
a Gst.BufferForeachMetaFunc to call
user_data
(
Object
)
–
user data passed to func
Gst.Buffer.foreach_meta
def Gst.Buffer.foreach_meta (self, func, *user_data):
#python wrapper for 'gst_buffer_foreach_meta'
Call func with user_data for each meta in buffer.
func can modify the passed meta pointer or its contents. The return value of func define if this function returns or if the remaining metadata items in the buffer should be skipped.
Parameters:
buffer
(
Gst.Buffer
)
–
func
(
Gst.BufferForeachMetaFunc
)
–
a Gst.BufferForeachMetaFunc to call
user_data
(
variadic
)
–
user data passed to func
gst_buffer_get_all_memory
GstMemory * gst_buffer_get_all_memory (GstBuffer * buffer)
Get all the memory block in buffer. The memory blocks will be merged into one large GstMemory.
Parameters:
buffer
–
a GstBuffer.
a GstMemory that contains the merged memory. Use gst_memory_unref () after usage.
Gst.Buffer.prototype.get_all_memory
function Gst.Buffer.prototype.get_all_memory(): {
// javascript wrapper for 'gst_buffer_get_all_memory'
}
Get all the memory block in buffer. The memory blocks will be merged into one large Gst.Memory.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
a Gst.Memory that contains the merged memory. Use gst_memory_unref () after usage.
Gst.Buffer.get_all_memory
def Gst.Buffer.get_all_memory (self):
#python wrapper for 'gst_buffer_get_all_memory'
Get all the memory block in buffer. The memory blocks will be merged into one large Gst.Memory.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
a Gst.Memory that contains the merged memory. Use gst_memory_unref () after usage.
gst_buffer_get_custom_meta
GstCustomMeta * gst_buffer_get_custom_meta (GstBuffer * buffer, const gchar * name)
Find the first GstCustomMeta on buffer for the desired name.
the GstCustomMeta or NULL when there is no such metadata on buffer.
Since : 1.20
Gst.Buffer.prototype.get_custom_meta
function Gst.Buffer.prototype.get_custom_meta(name: String): {
// javascript wrapper for 'gst_buffer_get_custom_meta'
}
Find the first Gst.CustomMeta on buffer for the desired name.
Parameters:
buffer
(
Gst.Buffer
)
–
name
(
String
)
–
the registered name of the custom meta to retrieve.
the Gst.CustomMeta or null when there is no such metadata on buffer.
Since : 1.20
Gst.Buffer.get_custom_meta
def Gst.Buffer.get_custom_meta (self, name):
#python wrapper for 'gst_buffer_get_custom_meta'
Find the first Gst.CustomMeta on buffer for the desired name.
Parameters:
buffer
(
Gst.Buffer
)
–
name
(
str
)
–
the registered name of the custom meta to retrieve.
the Gst.CustomMeta or None when there is no such metadata on buffer.
Since : 1.20
gst_buffer_get_flags
GstBufferFlags gst_buffer_get_flags (GstBuffer * buffer)
Get the GstBufferFlags flags set on this buffer.
Parameters:
buffer
–
the flags set on this buffer.
Since : 1.10
Gst.Buffer.prototype.get_flags
function Gst.Buffer.prototype.get_flags(): {
// javascript wrapper for 'gst_buffer_get_flags'
}
Get the Gst.BufferFlags flags set on this buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
the flags set on this buffer.
Since : 1.10
Gst.Buffer.get_flags
def Gst.Buffer.get_flags (self):
#python wrapper for 'gst_buffer_get_flags'
Get the Gst.BufferFlags flags set on this buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
the flags set on this buffer.
Since : 1.10
gst_buffer_get_memory
GstMemory * gst_buffer_get_memory (GstBuffer * buffer, guint idx)
Get the memory block at index idx in buffer.
a GstMemory that contains the data of the memory block at idx. Use gst_memory_unref () after usage.
Gst.Buffer.prototype.get_memory
function Gst.Buffer.prototype.get_memory(idx: Number): {
// javascript wrapper for 'gst_buffer_get_memory'
}
Get the memory block at index idx in buffer.
a Gst.Memory that contains the data of the memory block at idx. Use gst_memory_unref () after usage.
Gst.Buffer.get_memory
def Gst.Buffer.get_memory (self, idx):
#python wrapper for 'gst_buffer_get_memory'
Get the memory block at index idx in buffer.
a Gst.Memory that contains the data of the memory block at idx. Use gst_memory_unref () after usage.
gst_buffer_get_memory_range
GstMemory * gst_buffer_get_memory_range (GstBuffer * buffer, guint idx, gint length)
Get 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.
a GstMemory that contains the merged data of length blocks starting at idx. Use gst_memory_unref () after usage.
Gst.Buffer.prototype.get_memory_range
function Gst.Buffer.prototype.get_memory_range(idx: Number, length: Number): {
// javascript wrapper for 'gst_buffer_get_memory_range'
}
Get length memory blocks in buffer starting at idx. The memory blocks will be merged into one large Gst.Memory.
If length is -1, all memory starting from idx is merged.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length
a Gst.Memory that contains the merged data of length blocks starting at idx. Use gst_memory_unref () after usage.
Gst.Buffer.get_memory_range
def Gst.Buffer.get_memory_range (self, idx, length):
#python wrapper for 'gst_buffer_get_memory_range'
Get length memory blocks in buffer starting at idx. The memory blocks will be merged into one large Gst.Memory.
If length is -1, all memory starting from idx is merged.
a Gst.Memory that contains the merged data of length blocks starting at idx. Use gst_memory_unref () after usage.
gst_buffer_get_meta
GstMeta * gst_buffer_get_meta (GstBuffer * buffer, GType api)
Get 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.
the metadata for api on buffer.
Gst.Buffer.prototype.get_meta
function Gst.Buffer.prototype.get_meta(api: GObject.Type): {
// javascript wrapper for 'gst_buffer_get_meta'
}
Get 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 (not introspectable) or Gst.Buffer.prototype.foreach_meta instead and check the meta->info.api member for the API type.
the metadata for api on buffer.
Gst.Buffer.get_meta
def Gst.Buffer.get_meta (self, api):
#python wrapper for 'gst_buffer_get_meta'
Get the metadata for api on buffer. When there is no such metadata, None 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 (not introspectable) or Gst.Buffer.foreach_meta instead and check the meta->info.api member for the API type.
the metadata for api on buffer.
gst_buffer_get_n_meta
guint gst_buffer_get_n_meta (GstBuffer * buffer, GType api_type)
number of metas of type api_type on buffer.
Since : 1.14
Gst.Buffer.prototype.get_n_meta
function Gst.Buffer.prototype.get_n_meta(api_type: GObject.Type): {
// javascript wrapper for 'gst_buffer_get_n_meta'
}
number of metas of type api_type on buffer.
Since : 1.14
Gst.Buffer.get_n_meta
def Gst.Buffer.get_n_meta (self, api_type):
#python wrapper for 'gst_buffer_get_n_meta'
number of metas of type api_type on buffer.
Since : 1.14
gst_buffer_get_reference_timestamp_meta
GstReferenceTimestampMeta * gst_buffer_get_reference_timestamp_meta (GstBuffer * buffer, GstCaps * reference)
Find 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.
the GstReferenceTimestampMeta or NULL when there is no such metadata on buffer.
Since : 1.14
Gst.Buffer.prototype.get_reference_timestamp_meta
function Gst.Buffer.prototype.get_reference_timestamp_meta(reference: Gst.Caps): {
// javascript wrapper for 'gst_buffer_get_reference_timestamp_meta'
}
Find the first Gst.ReferenceTimestampMeta 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 Gst.ReferenceTimestampMeta metadata items.
the Gst.ReferenceTimestampMeta or null when there is no such metadata on buffer.
Since : 1.14
Gst.Buffer.get_reference_timestamp_meta
def Gst.Buffer.get_reference_timestamp_meta (self, reference):
#python wrapper for 'gst_buffer_get_reference_timestamp_meta'
Find the first Gst.ReferenceTimestampMeta 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 Gst.ReferenceTimestampMeta metadata items.
the Gst.ReferenceTimestampMeta or None when there is no such metadata on buffer.
Since : 1.14
gst_buffer_get_size
gsize gst_buffer_get_size (GstBuffer * buffer)
Get the total size of the memory blocks in buffer.
Parameters:
buffer
–
a GstBuffer.
total size of the memory blocks in buffer.
Gst.Buffer.prototype.get_size
function Gst.Buffer.prototype.get_size(): {
// javascript wrapper for 'gst_buffer_get_size'
}
Get the total size of the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
total size of the memory blocks in buffer.
Gst.Buffer.get_size
def Gst.Buffer.get_size (self):
#python wrapper for 'gst_buffer_get_size'
Get the total size of the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
total size of the memory blocks in buffer.
gst_buffer_get_sizes
gsize gst_buffer_get_sizes (GstBuffer * buffer, gsize * offset, gsize * maxsize)
Get the total size of the memory blocks in b.
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.
Parameters:
buffer
–
a GstBuffer.
offset
(
[out]
[allow-none]
)
–
a pointer to the offset
maxsize
(
[out]
[allow-none]
)
–
a pointer to the maxsize
total size of the memory blocks in buffer.
Gst.Buffer.prototype.get_sizes
function Gst.Buffer.prototype.get_sizes(): {
// javascript wrapper for 'gst_buffer_get_sizes'
}
Get the total size of the memory blocks in b.
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.prototype.resize.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
Returns a tuple made of:
total size of the memory blocks in buffer.
offset
(
Number
)
–
total size of the memory blocks in buffer.
maxsize
(
Number
)
–
total size of the memory blocks in buffer.
Gst.Buffer.get_sizes
def Gst.Buffer.get_sizes (self):
#python wrapper for 'gst_buffer_get_sizes'
Get the total size of the memory blocks in b.
When not None, 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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
Returns a tuple made of:
total size of the memory blocks in buffer.
offset
(
int
)
–
total size of the memory blocks in buffer.
maxsize
(
int
)
–
total size of the memory blocks in buffer.
gst_buffer_get_sizes_range
gsize gst_buffer_get_sizes_range (GstBuffer * buffer, guint idx, gint length, gsize * offset, gsize * maxsize)
Get 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.
Parameters:
buffer
–
a GstBuffer.
idx
–
an index
length
–
a length
offset
(
[out]
[allow-none]
)
–
a pointer to the offset
maxsize
(
[out]
[allow-none]
)
–
a pointer to the maxsize
total size of length memory blocks starting at idx in buffer.
Gst.Buffer.prototype.get_sizes_range
function Gst.Buffer.prototype.get_sizes_range(idx: Number, length: Number): {
// javascript wrapper for 'gst_buffer_get_sizes_range'
}
Get 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.prototype.resize_range.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length
Returns a tuple made of:
total size of length memory blocks starting at idx in buffer.
offset
(
Number
)
–
total size of length memory blocks starting at idx in buffer.
maxsize
(
Number
)
–
total size of length memory blocks starting at idx in buffer.
Gst.Buffer.get_sizes_range
def Gst.Buffer.get_sizes_range (self, idx, length):
#python wrapper for 'gst_buffer_get_sizes_range'
Get the total size of length memory blocks stating from idx in buffer.
When not None, 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.
Returns a tuple made of:
total size of length memory blocks starting at idx in buffer.
offset
(
int
)
–
total size of length memory blocks starting at idx in buffer.
maxsize
(
int
)
–
total size of length memory blocks starting at idx in buffer.
gst_buffer_has_flags
gboolean gst_buffer_has_flags (GstBuffer * buffer, GstBufferFlags flags)
Gives the status of a specific flag on a buffer.
TRUE if all flags in flags are found on buffer.
Since : 1.10
Gst.Buffer.prototype.has_flags
function Gst.Buffer.prototype.has_flags(flags: Gst.BufferFlags): {
// javascript wrapper for 'gst_buffer_has_flags'
}
Gives the status of a specific flag on a buffer.
Since : 1.10
Gst.Buffer.has_flags
def Gst.Buffer.has_flags (self, flags):
#python wrapper for 'gst_buffer_has_flags'
Gives the status of a specific flag on a buffer.
Since : 1.10
gst_buffer_insert_memory
gst_buffer_insert_memory (GstBuffer * buffer, gint idx, GstMemory * mem)
Insert the memory block mem to 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.
Parameters:
buffer
–
a GstBuffer.
idx
–
the index to add the memory at, or -1 to append it to the end
mem
(
[transfer: full]
)
–
a GstMemory.
Gst.Buffer.prototype.insert_memory
function Gst.Buffer.prototype.insert_memory(idx: Number, mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_insert_memory'
}
Insert the memory block mem to buffer at idx. This function takes ownership of mem and thus doesn't increase its refcount.
Only Gst.prototype.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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
the index to add the memory at, or -1 to append it to the end
mem
(
Gst.Memory
)
–
a Gst.Memory.
Gst.Buffer.insert_memory
def Gst.Buffer.insert_memory (self, idx, mem):
#python wrapper for 'gst_buffer_insert_memory'
Insert the memory block mem to 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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
int
)
–
the index to add the memory at, or -1 to append it to the end
mem
(
Gst.Memory
)
–
a Gst.Memory.
gst_buffer_is_all_memory_writable
gboolean gst_buffer_is_all_memory_writable (GstBuffer * buffer)
Check 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.
Parameters:
buffer
–
a GstBuffer.
TRUE if all memory blocks in buffer are writable
Since : 1.4
Gst.Buffer.prototype.is_all_memory_writable
function Gst.Buffer.prototype.is_all_memory_writable(): {
// javascript wrapper for 'gst_buffer_is_all_memory_writable'
}
Check if all memory blocks in buffer are writable.
Note that this function does not check if buffer is writable, use gst_buffer_is_writable (not introspectable) to check that if needed.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
Since : 1.4
Gst.Buffer.is_all_memory_writable
def Gst.Buffer.is_all_memory_writable (self):
#python wrapper for 'gst_buffer_is_all_memory_writable'
Check if all memory blocks in buffer are writable.
Note that this function does not check if buffer is writable, use gst_buffer_is_writable (not introspectable) to check that if needed.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
Since : 1.4
gst_buffer_is_memory_range_writable
gboolean gst_buffer_is_memory_range_writable (GstBuffer * buffer, guint idx, gint length)
Check 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.
TRUE if the memory range is writable
Since : 1.4
Gst.Buffer.prototype.is_memory_range_writable
function Gst.Buffer.prototype.is_memory_range_writable(idx: Number, length: Number): {
// javascript wrapper for 'gst_buffer_is_memory_range_writable'
}
Check 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 (not introspectable) to check that if needed.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length should not be 0
Since : 1.4
Gst.Buffer.is_memory_range_writable
def Gst.Buffer.is_memory_range_writable (self, idx, length):
#python wrapper for 'gst_buffer_is_memory_range_writable'
Check 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 (not introspectable) to check that if needed.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
int
)
–
an index
length
(
int
)
–
a length should not be 0
Since : 1.4
gst_buffer_iterate_meta
GstMeta * gst_buffer_iterate_meta (GstBuffer * buffer, gpointer * state)
Retrieve the next GstMeta after current. If state points to NULL, the first metadata is returned.
state will be updated with an opaque state pointer
gst_buffer_iterate_meta_filtered
GstMeta * gst_buffer_iterate_meta_filtered (GstBuffer * buffer, gpointer * state, GType meta_api_type)
Retrieve the next GstMeta of type meta_api_type after the current one according to state. If state points to NULL, the first metadata of type meta_api_type is returned.
state will be updated with an opaque state pointer
Parameters:
buffer
–
state
(
[out]
)
–
an opaque state pointer
meta_api_type
–
only return GstMeta of this type
Since : 1.12
gst_buffer_map
gboolean gst_buffer_map (GstBuffer * buffer, GstMapInfo * info, GstMapFlags flags)
This function 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.
Parameters:
buffer
–
a GstBuffer.
info
(
[out]
)
–
info about the mapping
flags
–
flags for the mapping
TRUE if the map succeeded and info contains valid data.
Gst.Buffer.prototype.map
function Gst.Buffer.prototype.map(flags: Gst.MapFlags): {
// javascript wrapper for 'gst_buffer_map'
}
This function fills info with the Gst.MapInfo of all merged memory blocks in buffer.
flags describe the desired access of the memory. When flags is Gst.MapFlags.WRITE, buffer should be writable (as returned from gst_buffer_is_writable (not introspectable)).
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.prototype.unmap after usage.
Returns a tuple made of:
info
(
Gst.MapInfo
)
–
true if the map succeeded and info contains valid data.
Gst.Buffer.map
def Gst.Buffer.map (self, flags):
#python wrapper for 'gst_buffer_map'
This function fills info with the Gst.MapInfo of all merged memory blocks in buffer.
flags describe the desired access of the memory. When flags is Gst.MapFlags.WRITE, buffer should be writable (as returned from gst_buffer_is_writable (not introspectable)).
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.
Returns a tuple made of:
info
(
Gst.MapInfo
)
–
True if the map succeeded and info contains valid data.
gst_buffer_map_range
gboolean gst_buffer_map_range (GstBuffer * buffer, guint idx, gint length, GstMapInfo * info, GstMapFlags flags)
This function 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.
Parameters:
buffer
–
a GstBuffer.
idx
–
an index
length
–
a length
info
(
[out]
)
–
info about the mapping
flags
–
flags for the mapping
TRUE if the map succeeded and info contains valid data.
Gst.Buffer.prototype.map_range
function Gst.Buffer.prototype.map_range(idx: Number, length: Number, flags: Gst.MapFlags): {
// javascript wrapper for 'gst_buffer_map_range'
}
This function fills info with the Gst.MapInfo 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.MapFlags.WRITE, buffer should be writable (as returned from gst_buffer_is_writable (not introspectable)).
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.prototype.unmap after usage.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length
flags
(
Gst.MapFlags
)
–
flags for the mapping
Returns a tuple made of:
info
(
Gst.MapInfo
)
–
true if the map succeeded and info contains valid data.
Gst.Buffer.map_range
def Gst.Buffer.map_range (self, idx, length, flags):
#python wrapper for 'gst_buffer_map_range'
This function fills info with the Gst.MapInfo 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.MapFlags.WRITE, buffer should be writable (as returned from gst_buffer_is_writable (not introspectable)).
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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
int
)
–
an index
length
(
int
)
–
a length
flags
(
Gst.MapFlags
)
–
flags for the mapping
Returns a tuple made of:
info
(
Gst.MapInfo
)
–
True if the map succeeded and info contains valid data.
gst_buffer_memcmp
gint gst_buffer_memcmp (GstBuffer * buffer, gsize offset, gconstpointer mem, gsize size)
Compare size bytes starting from offset in buffer with the memory in mem.
Parameters:
buffer
–
a GstBuffer.
offset
–
the offset in buffer
mem
(
[array length=size]
[element-type guint8]
)
–
the memory to compare
size
–
the size to compare
0 if the memory is equal.
Gst.Buffer.prototype.memcmp
function Gst.Buffer.prototype.memcmp(offset: Number, mem: [ Number ], size: Number): {
// javascript wrapper for 'gst_buffer_memcmp'
}
Compare size bytes starting from offset in buffer with the memory in mem.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
Number
)
–
the offset in buffer
mem
(
[ Number ]
)
–
the memory to compare
size
(
Number
)
–
the size to compare
0 if the memory is equal.
Gst.Buffer.memcmp
def Gst.Buffer.memcmp (self, offset, mem, size):
#python wrapper for 'gst_buffer_memcmp'
Compare size bytes starting from offset in buffer with the memory in mem.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
int
)
–
the offset in buffer
mem
(
[ int ]
)
–
the memory to compare
size
(
int
)
–
the size to compare
0 if the memory is equal.
gst_buffer_memset
gsize gst_buffer_memset (GstBuffer * buffer, gsize offset, guint8 val, gsize size)
Fill buf with size bytes with val starting from offset.
Parameters:
buffer
–
a GstBuffer.
offset
–
the offset in buffer
val
–
the value to set
size
–
the size to set
The amount of bytes filled. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.prototype.memset
function Gst.Buffer.prototype.memset(offset: Number, val: Number, size: Number): {
// javascript wrapper for 'gst_buffer_memset'
}
Fill buf with size bytes with val starting from offset.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
Number
)
–
the offset in buffer
val
(
Number
)
–
the value to set
size
(
Number
)
–
the size to set
The amount of bytes filled. This value can be lower than size when buffer did not contain enough data.
Gst.Buffer.memset
def Gst.Buffer.memset (self, offset, val, size):
#python wrapper for 'gst_buffer_memset'
Fill buf with size bytes with val starting from offset.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
int
)
–
the offset in buffer
val
(
int
)
–
the value to set
size
(
int
)
–
the size to set
The amount of bytes filled. This value can be lower than size when buffer did not contain enough data.
gst_buffer_n_memory
guint gst_buffer_n_memory (GstBuffer * buffer)
Get the amount of memory blocks that this buffer has. This amount is never larger than what gst_buffer_get_max_memory returns.
Parameters:
buffer
–
a GstBuffer.
the number of memory blocks this buffer is made of.
Gst.Buffer.prototype.n_memory
function Gst.Buffer.prototype.n_memory(): {
// javascript wrapper for 'gst_buffer_n_memory'
}
Get the amount of memory blocks that this buffer has. This amount is never larger than what Gst.prototype.buffer_get_max_memory returns.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
the number of memory blocks this buffer is made of.
Gst.Buffer.n_memory
def Gst.Buffer.n_memory (self):
#python wrapper for 'gst_buffer_n_memory'
Get the amount of memory blocks that this buffer has. This amount is never larger than what Gst.buffer_get_max_memory returns.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
the number of memory blocks this buffer is made of.
gst_buffer_peek_memory
GstMemory * gst_buffer_peek_memory (GstBuffer * buffer, guint idx)
Get 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.
the GstMemory at idx.
Gst.Buffer.prototype.peek_memory
function Gst.Buffer.prototype.peek_memory(idx: Number): {
// javascript wrapper for 'gst_buffer_peek_memory'
}
Get 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.
the Gst.Memory at idx.
Gst.Buffer.peek_memory
def Gst.Buffer.peek_memory (self, idx):
#python wrapper for 'gst_buffer_peek_memory'
Get 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.
the Gst.Memory at idx.
gst_buffer_prepend_memory
gst_buffer_prepend_memory (GstBuffer * buffer, GstMemory * mem)
Prepend 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.
Gst.Buffer.prototype.prepend_memory
function Gst.Buffer.prototype.prepend_memory(mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_prepend_memory'
}
Prepend 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.prototype.insert_memory with an index of 0. See Gst.Buffer.prototype.insert_memory for more details.
Gst.Buffer.prepend_memory
def Gst.Buffer.prepend_memory (self, mem):
#python wrapper for 'gst_buffer_prepend_memory'
Prepend 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.
gst_buffer_ref
GstBuffer * gst_buffer_ref (GstBuffer * buf)
Increases the refcount of the given buffer by one.
Note that the refcount affects the writability of buf and its metadata, see gst_buffer_is_writable. It is important to note that keeping additional references to GstBuffer instances can potentially increase the number of memcpy operations in a pipeline.
Parameters:
buf
–
a GstBuffer.
buf
gst_buffer_remove_all_memory
gst_buffer_remove_all_memory (GstBuffer * buffer)
Remove all the memory blocks in buffer.
Parameters:
buffer
–
a GstBuffer.
Gst.Buffer.prototype.remove_all_memory
function Gst.Buffer.prototype.remove_all_memory(): {
// javascript wrapper for 'gst_buffer_remove_all_memory'
}
Remove all the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
Gst.Buffer.remove_all_memory
def Gst.Buffer.remove_all_memory (self):
#python wrapper for 'gst_buffer_remove_all_memory'
Remove all the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
gst_buffer_remove_memory
gst_buffer_remove_memory (GstBuffer * buffer, guint idx)
Remove the memory block in b at index i.
Gst.Buffer.prototype.remove_memory
function Gst.Buffer.prototype.remove_memory(idx: Number): {
// javascript wrapper for 'gst_buffer_remove_memory'
}
Remove the memory block in b at index i.
Gst.Buffer.remove_memory
def Gst.Buffer.remove_memory (self, idx):
#python wrapper for 'gst_buffer_remove_memory'
Remove the memory block in b at index i.
gst_buffer_remove_memory_range
gst_buffer_remove_memory_range (GstBuffer * buffer, guint idx, gint length)
Remove length memory blocks in buffer starting from idx.
length can be -1, in which case all memory starting from idx is removed.
Gst.Buffer.prototype.remove_memory_range
function Gst.Buffer.prototype.remove_memory_range(idx: Number, length: Number): {
// javascript wrapper for 'gst_buffer_remove_memory_range'
}
Remove length memory blocks in buffer starting from idx.
length can be -1, in which case all memory starting from idx is removed.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length
Gst.Buffer.remove_memory_range
def Gst.Buffer.remove_memory_range (self, idx, length):
#python wrapper for 'gst_buffer_remove_memory_range'
Remove length memory blocks in buffer starting from idx.
length can be -1, in which case all memory starting from idx is removed.
gst_buffer_remove_meta
gboolean gst_buffer_remove_meta (GstBuffer * buffer, GstMeta * meta)
Remove the metadata for meta on buffer.
Gst.Buffer.prototype.remove_meta
function Gst.Buffer.prototype.remove_meta(meta: Gst.Meta): {
// javascript wrapper for 'gst_buffer_remove_meta'
}
Remove the metadata for meta on buffer.
Gst.Buffer.remove_meta
def Gst.Buffer.remove_meta (self, meta):
#python wrapper for 'gst_buffer_remove_meta'
Remove the metadata for meta on buffer.
gst_buffer_replace_all_memory
gst_buffer_replace_all_memory (GstBuffer * buffer, GstMemory * mem)
Replaces all memory in buffer with mem.
Gst.Buffer.prototype.replace_all_memory
function Gst.Buffer.prototype.replace_all_memory(mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_replace_all_memory'
}
Replaces all memory in buffer with mem.
Gst.Buffer.replace_all_memory
def Gst.Buffer.replace_all_memory (self, mem):
#python wrapper for 'gst_buffer_replace_all_memory'
Replaces all memory in buffer with mem.
gst_buffer_replace_memory
gst_buffer_replace_memory (GstBuffer * buffer, guint idx, GstMemory * mem)
Replaces the memory block at index idx in buffer with mem.
Gst.Buffer.prototype.replace_memory
function Gst.Buffer.prototype.replace_memory(idx: Number, mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_replace_memory'
}
Replaces the memory block at index idx in buffer with mem.
Gst.Buffer.replace_memory
def Gst.Buffer.replace_memory (self, idx, mem):
#python wrapper for 'gst_buffer_replace_memory'
Replaces the memory block at index idx in buffer with mem.
gst_buffer_replace_memory_range
gst_buffer_replace_memory_range (GstBuffer * buffer, guint idx, gint length, GstMemory * 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.
Parameters:
buffer
–
a GstBuffer.
idx
–
an index
length
–
a length should not be 0
mem
(
[transfer: full]
)
–
Gst.Buffer.prototype.replace_memory_range
function Gst.Buffer.prototype.replace_memory_range(idx: Number, length: Number, mem: Gst.Memory): {
// javascript wrapper for 'gst_buffer_replace_memory_range'
}
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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length should not be 0
mem
(
Gst.Memory
)
–
Gst.Buffer.replace_memory_range
def Gst.Buffer.replace_memory_range (self, idx, length, mem):
#python wrapper for 'gst_buffer_replace_memory_range'
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.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
int
)
–
an index
length
(
int
)
–
a length should not be 0
mem
(
Gst.Memory
)
–
gst_buffer_resize
gst_buffer_resize (GstBuffer * buffer, gssize offset, gssize size)
Set the offset and total size of the memory blocks in buffer.
Parameters:
buffer
–
a GstBuffer.
offset
–
the offset adjustment
size
–
the new size or -1 to just adjust the offset
Gst.Buffer.prototype.resize
function Gst.Buffer.prototype.resize(offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_resize'
}
Set the offset and total size of the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
Number
)
–
the offset adjustment
size
(
Number
)
–
the new size or -1 to just adjust the offset
Gst.Buffer.resize
def Gst.Buffer.resize (self, offset, size):
#python wrapper for 'gst_buffer_resize'
Set the offset and total size of the memory blocks in buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
offset
(
int
)
–
the offset adjustment
size
(
int
)
–
the new size or -1 to just adjust the offset
gst_buffer_resize_range
gboolean gst_buffer_resize_range (GstBuffer * buffer, guint idx, gint length, gssize offset, gssize size)
Set the total size of the length memory blocks starting at idx in buffer
Parameters:
buffer
–
a GstBuffer.
idx
–
an index
length
–
a length
offset
–
the offset adjustment
size
–
the new size or -1 to just adjust the offset
Gst.Buffer.prototype.resize_range
function Gst.Buffer.prototype.resize_range(idx: Number, length: Number, offset: Number, size: Number): {
// javascript wrapper for 'gst_buffer_resize_range'
}
Set the total size of the length memory blocks starting at idx in buffer
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
Number
)
–
an index
length
(
Number
)
–
a length
offset
(
Number
)
–
the offset adjustment
size
(
Number
)
–
the new size or -1 to just adjust the offset
Gst.Buffer.resize_range
def Gst.Buffer.resize_range (self, idx, length, offset, size):
#python wrapper for 'gst_buffer_resize_range'
Set the total size of the length memory blocks starting at idx in buffer
Parameters:
buffer
(
Gst.Buffer
)
–
a Gst.Buffer.
idx
(
int
)
–
an index
length
(
int
)
–
a length
offset
(
int
)
–
the offset adjustment
size
(
int
)
–
the new size or -1 to just adjust the offset
gst_buffer_set_flags
gboolean gst_buffer_set_flags (GstBuffer * buffer, GstBufferFlags flags)
Sets one or more buffer flags on a buffer.
TRUE if flags were successfully set on buffer.
Since : 1.10
Gst.Buffer.prototype.set_flags
function Gst.Buffer.prototype.set_flags(flags: Gst.BufferFlags): {
// javascript wrapper for 'gst_buffer_set_flags'
}
Sets one or more buffer flags on a buffer.
Since : 1.10
Gst.Buffer.set_flags
def Gst.Buffer.set_flags (self, flags):
#python wrapper for 'gst_buffer_set_flags'
Sets one or more buffer flags on a buffer.
Since : 1.10
gst_buffer_set_size
gst_buffer_set_size (GstBuffer * buffer, gssize size)
Set the total size of the memory blocks in buffer.
Gst.Buffer.prototype.set_size
function Gst.Buffer.prototype.set_size(size: Number): {
// javascript wrapper for 'gst_buffer_set_size'
}
Set the total size of the memory blocks in buffer.
Gst.Buffer.set_size
def Gst.Buffer.set_size (self, size):
#python wrapper for 'gst_buffer_set_size'
Set the total size of the memory blocks in buffer.
gst_buffer_unmap
gst_buffer_unmap (GstBuffer * buffer, GstMapInfo * info)
Release the memory previously mapped with gst_buffer_map.
Gst.Buffer.prototype.unmap
function Gst.Buffer.prototype.unmap(info: Gst.MapInfo): {
// javascript wrapper for 'gst_buffer_unmap'
}
Release the memory previously mapped with Gst.Buffer.prototype.map.
Gst.Buffer.unmap
def Gst.Buffer.unmap (self, info):
#python wrapper for 'gst_buffer_unmap'
Release the memory previously mapped with Gst.Buffer.map.
gst_buffer_unref
gst_buffer_unref (GstBuffer * buf)
Decreases the refcount of the buffer. If the refcount reaches 0, the buffer with the associated metadata and memory will be freed.
Parameters:
buf
(
[transfer: full]
)
–
a GstBuffer.
gst_buffer_unset_flags
gboolean gst_buffer_unset_flags (GstBuffer * buffer, GstBufferFlags flags)
Clears one or more buffer flags.
true if flags is successfully cleared from buffer.
Since : 1.10
Gst.Buffer.prototype.unset_flags
function Gst.Buffer.prototype.unset_flags(flags: Gst.BufferFlags): {
// javascript wrapper for 'gst_buffer_unset_flags'
}
Clears one or more buffer flags.
true if flags is successfully cleared from buffer.
Since : 1.10
Gst.Buffer.unset_flags
def Gst.Buffer.unset_flags (self, flags):
#python wrapper for 'gst_buffer_unset_flags'
Clears one or more buffer flags.
true if flags is successfully cleared from buffer.
Since : 1.10
Functions
gst_buffer_get_max_memory
guint gst_buffer_get_max_memory ()
Get 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.
the maximum amount of memory blocks that a buffer can hold.
Since : 1.2
Gst.prototype.buffer_get_max_memory
function Gst.prototype.buffer_get_max_memory(): {
// javascript wrapper for 'gst_buffer_get_max_memory'
}
Get 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.
the maximum amount of memory blocks that a buffer can hold.
Since : 1.2
Gst.buffer_get_max_memory
def Gst.buffer_get_max_memory ():
#python wrapper for 'gst_buffer_get_max_memory'
Get 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.
the maximum amount of memory blocks that a buffer can hold.
Since : 1.2
gst_buffer_replace
gboolean gst_buffer_replace (GstBuffer ** obuf, GstBuffer * nbuf)
Modifies a pointer to a GstBuffer to point to a different GstBuffer. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old buffer is unreffed, the new is reffed).
Either nbuf or the GstBuffer pointed to by obuf may be NULL.
Parameters:
obuf
(
[inout]
[transfer: full]
[nullable]
)
–
pointer to a pointer to a GstBuffer to be replaced.
nbuf
(
[transfer: none]
[allow-none]
)
–
pointer to a GstBuffer that will replace the buffer pointed to by obuf.
TRUE when obuf was different from nbuf.
GstParentBufferMeta
The GstParentBufferMeta is a GstMeta 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.
Members
Gst.ParentBufferMeta
The Gst.ParentBufferMeta is a Gst.Meta which can be attached to a Gst.Buffer to hold a reference to another buffer that is only released when the child Gst.Buffer is released.
Typically, Gst.ParentBufferMeta is used when the child buffer is directly using the Gst.Memory of the parent buffer, and wants to prevent the parent buffer from being returned to a buffer pool until the Gst.Memory is available for re-use.
Members
buffer
(Gst.Buffer)
–
the Gst.Buffer on which a reference is being held.
Gst.ParentBufferMeta
The Gst.ParentBufferMeta is a Gst.Meta which can be attached to a Gst.Buffer to hold a reference to another buffer that is only released when the child Gst.Buffer is released.
Typically, Gst.ParentBufferMeta is used when the child buffer is directly using the Gst.Memory of the parent buffer, and wants to prevent the parent buffer from being returned to a buffer pool until the Gst.Memory is available for re-use.
Members
buffer
(Gst.Buffer)
–
the Gst.Buffer on which a reference is being held.
Functions
gst_parent_buffer_meta_get_info
const GstMetaInfo * gst_parent_buffer_meta_get_info ()
Get the global GstMetaInfo describing the GstParentBufferMeta meta.
The GstMetaInfo
Since : 1.6
Gst.prototype.parent_buffer_meta_get_info
function Gst.prototype.parent_buffer_meta_get_info(): {
// javascript wrapper for 'gst_parent_buffer_meta_get_info'
}
Get the global Gst.MetaInfo describing the Gst.ParentBufferMeta meta.
The Gst.MetaInfo
Since : 1.6
Gst.parent_buffer_meta_get_info
def Gst.parent_buffer_meta_get_info ():
#python wrapper for 'gst_parent_buffer_meta_get_info'
Get the global Gst.MetaInfo describing the Gst.ParentBufferMeta meta.
The Gst.MetaInfo
Since : 1.6
GstReferenceTimestampMeta
GstReferenceTimestampMeta can be used to attach alternative timestamps and possibly durations to a GstBuffer. These are generally not according to the pipeline clock and could be e.g. the NTP timestamp when the media was captured.
The reference is stored as a GstCaps in reference. Examples of valid references would be "timestamp/x-drivername-stream" for timestamps that are locally generated by some driver named "drivername" when generating the stream, e.g. based on a frame counter, or "timestamp/x-ntp, host=pool.ntp.org, port=123" for timestamps based on a specific NTP server.
Members
reference
(GstCaps *)
–
identifier for the timestamp reference.
timestamp
(GstClockTime)
–
timestamp
duration
(GstClockTime)
–
duration, or GST_CLOCK_TIME_NONE
Gst.ReferenceTimestampMeta
Gst.ReferenceTimestampMeta can be used to attach alternative timestamps and possibly durations to a Gst.Buffer. These are generally not according to the pipeline clock and could be e.g. the NTP timestamp when the media was captured.
The reference is stored as a Gst.Caps in reference. Examples of valid references would be "timestamp/x-drivername-stream" for timestamps that are locally generated by some driver named "drivername" when generating the stream, e.g. based on a frame counter, or "timestamp/x-ntp, host=pool.ntp.org, port=123" for timestamps based on a specific NTP server.
Members
reference
(Gst.Caps)
–
identifier for the timestamp reference.
timestamp
(Number)
–
timestamp
duration
(Number)
–
duration, or Gst.CLOCK_TIME_NONE
Gst.ReferenceTimestampMeta
Gst.ReferenceTimestampMeta can be used to attach alternative timestamps and possibly durations to a Gst.Buffer. These are generally not according to the pipeline clock and could be e.g. the NTP timestamp when the media was captured.
The reference is stored as a Gst.Caps in reference. Examples of valid references would be "timestamp/x-drivername-stream" for timestamps that are locally generated by some driver named "drivername" when generating the stream, e.g. based on a frame counter, or "timestamp/x-ntp, host=pool.ntp.org, port=123" for timestamps based on a specific NTP server.
Members
reference
(Gst.Caps)
–
identifier for the timestamp reference.
timestamp
(int)
–
timestamp
duration
(int)
–
duration, or Gst.CLOCK_TIME_NONE
Functions
gst_reference_timestamp_meta_get_info
const GstMetaInfo * gst_reference_timestamp_meta_get_info ()
Get the global GstMetaInfo describing the GstReferenceTimestampMeta meta.
The GstMetaInfo
Since : 1.14
Gst.prototype.reference_timestamp_meta_get_info
function Gst.prototype.reference_timestamp_meta_get_info(): {
// javascript wrapper for 'gst_reference_timestamp_meta_get_info'
}
Get the global Gst.MetaInfo describing the Gst.ReferenceTimestampMeta meta.
The Gst.MetaInfo
Since : 1.14
Gst.reference_timestamp_meta_get_info
def Gst.reference_timestamp_meta_get_info ():
#python wrapper for 'gst_reference_timestamp_meta_get_info'
Get the global Gst.MetaInfo describing the Gst.ReferenceTimestampMeta meta.
The Gst.MetaInfo
Since : 1.14
Functions
gst_clear_buffer
gst_clear_buffer (GstBuffer ** buf_ptr)
Clears a reference to a GstBuffer.
buf_ptr must not be NULL.
If the reference is NULL then this function does nothing. Otherwise, the reference count of the buffer is decreased and the pointer is set to NULL.
Parameters:
buf_ptr
–
a pointer to a GstBuffer reference
Since : 1.16
Function Macros
GST_BUFFER
#define GST_BUFFER(obj) (GST_BUFFER_CAST(obj))
GST_BUFFER_CAST
#define GST_BUFFER_CAST(obj) ((GstBuffer *)(obj))
GST_BUFFER_DTS
#define GST_BUFFER_DTS(buf) (GST_BUFFER_CAST(buf)->dts)
The decoding timestamp (dts) in nanoseconds (as a GstClockTime) of the data in the buffer. This is the timestamp when the media should be decoded or processed otherwise. Value will be GST_CLOCK_TIME_NONE if the dts is unknown.
Parameters:
buf
–
a GstBuffer.:
GST_BUFFER_DTS_IS_VALID
#define GST_BUFFER_DTS_IS_VALID(buffer) (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (buffer)))
Tests if the dts is known.
Parameters:
buffer
–
GST_BUFFER_DTS_OR_PTS
#define GST_BUFFER_DTS_OR_PTS(buf) (GST_BUFFER_DTS_IS_VALID(buf) ? GST_BUFFER_DTS(buf) : GST_BUFFER_PTS (buf))
Returns the buffer decoding timestamp (dts) if valid, else the buffer presentation time (pts)
Parameters:
buf
–
a GstBuffer.:
GST_BUFFER_DURATION
#define GST_BUFFER_DURATION(buf) (GST_BUFFER_CAST(buf)->duration)
The duration in nanoseconds (as a GstClockTime) of the data in the buffer. Value will be GST_CLOCK_TIME_NONE if the duration is unknown.
Parameters:
buf
–
a GstBuffer.
GST_BUFFER_DURATION_IS_VALID
#define GST_BUFFER_DURATION_IS_VALID(buffer) (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)))
Tests if the duration is known.
Parameters:
buffer
–
GST_BUFFER_FLAGS
#define GST_BUFFER_FLAGS(buf) GST_MINI_OBJECT_FLAGS(buf)
A flags word containing GstBufferFlags flags set on this buffer.
Parameters:
buf
–
a GstBuffer.
GST_BUFFER_FLAG_IS_SET
#define GST_BUFFER_FLAG_IS_SET(buf,flag) GST_MINI_OBJECT_FLAG_IS_SET (buf, flag)
Gives the status of a specific flag on a buffer.
GST_BUFFER_FLAG_SET
#define GST_BUFFER_FLAG_SET(buf,flag) GST_MINI_OBJECT_FLAG_SET (buf, flag)
Sets a buffer flag on a buffer.
GST_BUFFER_FLAG_UNSET
#define GST_BUFFER_FLAG_UNSET(buf,flag) GST_MINI_OBJECT_FLAG_UNSET (buf, flag)
Clears a buffer flag.
GST_BUFFER_IS_DISCONT
#define GST_BUFFER_IS_DISCONT(buffer) (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT))
Tests if the buffer marks a discontinuity in the stream.
Parameters:
buffer
–
GST_BUFFER_OFFSET
#define GST_BUFFER_OFFSET(buf) (GST_BUFFER_CAST(buf)->offset)
The offset in the source file of the beginning of this buffer.
Parameters:
buf
–
a GstBuffer.
GST_BUFFER_OFFSET_END
#define GST_BUFFER_OFFSET_END(buf) (GST_BUFFER_CAST(buf)->offset_end)
The offset in the source file of the end of this buffer.
Parameters:
buf
–
a GstBuffer.
GST_BUFFER_OFFSET_END_IS_VALID
#define GST_BUFFER_OFFSET_END_IS_VALID(buffer) (GST_BUFFER_OFFSET_END (buffer) != GST_BUFFER_OFFSET_NONE)
Tests if the end offset is known.
Parameters:
buffer
–
GST_BUFFER_OFFSET_IS_VALID
#define GST_BUFFER_OFFSET_IS_VALID(buffer) (GST_BUFFER_OFFSET (buffer) != GST_BUFFER_OFFSET_NONE)
Tests if the start offset is known.
Parameters:
buffer
–
GST_BUFFER_PTS
#define GST_BUFFER_PTS(buf) (GST_BUFFER_CAST(buf)->pts)
The presentation timestamp (pts) in nanoseconds (as a GstClockTime) of the data in the buffer. This is the timestamp when the media should be presented to the user. Value will be GST_CLOCK_TIME_NONE if the pts is unknown.
Parameters:
buf
–
a GstBuffer.:
GST_BUFFER_PTS_IS_VALID
#define GST_BUFFER_PTS_IS_VALID(buffer) (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_PTS (buffer)))
Tests if the pts is known.
Parameters:
buffer
–
GST_IS_BUFFER
#define GST_IS_BUFFER(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_BUFFER))
gst_buffer_get_parent_buffer_meta
#define gst_buffer_get_parent_buffer_meta(b) \ ((GstParentBufferMeta*)gst_buffer_get_meta((b),GST_PARENT_BUFFER_META_API_TYPE))
Find and return a GstParentBufferMeta if one exists on the buffer
Parameters:
b
–
gst_buffer_is_writable
#define gst_buffer_is_writable(buf) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (buf))
Tests if you can safely write to a buffer's metadata or its memory array. It is only safe to change buffer metadata when the current reference is writable, i.e. nobody can see the modifications you will make.
Parameters:
buf
–
gst_buffer_make_writable
#define gst_buffer_make_writable(buf) GST_BUFFER_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (buf)))
Returns a writable copy of buf. If the source buffer is already writable, this will simply return the same buffer.
Use this function to ensure that a buffer can be safely modified before making changes to it, including changing the metadata such as PTS/DTS.
If the reference count of the source buffer buf is exactly one, the caller is the sole owner and this function will return the buffer object unchanged.
If there is more than one reference on the object, a copy will be made using gst_buffer_copy. The passed-in buf will be unreffed in that case, and the caller will now own a reference to the new returned buffer object. Note that this just copies the buffer structure itself, the underlying memory is not copied if it can be shared amongst multiple buffers.
In short, this function unrefs the buf in the argument and refs the buffer that it returns. Don't access the argument after calling this function unless you have an additional reference to it.
Parameters:
buf
(
[transfer: full]
)
–
a writable buffer which may or may not be the same as buf
gst_value_get_buffer
#define gst_value_get_buffer(v) GST_BUFFER_CAST (g_value_get_boxed(v))
Receives a GstBuffer as the value of v. Does not return a reference to the buffer, so the pointer is only valid for as long as the caller owns a reference to v.
Parameters:
v
–
a GValue to query
buffer
gst_value_set_buffer
#define gst_value_set_buffer(v,b) g_value_set_boxed((v),(b))
Sets b as the value of v. Caller retains reference to buffer.
Parameters:
v
–
a GValue to receive the data
b
(
[transfer: none]
)
–
a GstBuffer to assign to the GstValue
gst_value_take_buffer
#define gst_value_take_buffer(v,b) g_value_take_boxed(v,(b))
Sets b as the value of v. Caller gives away reference to buffer.
Parameters:
v
–
a GValue to receive the data
b
(
[transfer: full]
)
–
a GstBuffer to assign to the GstValue
Enumerations
GstBufferCopyFlags
A set of flags that can be provided to the gst_buffer_copy_into function to specify which items should be copied.
Members
GST_BUFFER_COPY_NONE
(0)
–
copy nothing
GST_BUFFER_COPY_FLAGS
(1)
–
flag indicating that buffer flags should be copied
GST_BUFFER_COPY_TIMESTAMPS
(2)
–
flag indicating that buffer pts, dts, duration, offset and offset_end should be copied
GST_BUFFER_COPY_META
(4)
–
flag indicating that buffer meta should be copied
GST_BUFFER_COPY_MEMORY
(8)
–
flag indicating that buffer memory should be reffed and appended to already existing memory. Unless the memory is marked as NO_SHARE, no actual copy of the memory is made but it is simply reffed. Add GST_BUFFER_COPY_DEEP to force a real copy.
GST_BUFFER_COPY_MERGE
(16)
–
flag indicating that buffer memory should be merged
GST_BUFFER_COPY_DEEP
(32)
–
flag indicating that memory should always be copied instead of reffed (Since: 1.2)
Gst.BufferCopyFlags
A set of flags that can be provided to the Gst.Buffer.prototype.copy_into function to specify which items should be copied.
Members
Gst.BufferCopyFlags.NONE
(0)
–
copy nothing
Gst.BufferCopyFlags.FLAGS
(1)
–
flag indicating that buffer flags should be copied
Gst.BufferCopyFlags.TIMESTAMPS
(2)
–
flag indicating that buffer pts, dts, duration, offset and offset_end should be copied
Gst.BufferCopyFlags.META
(4)
–
flag indicating that buffer meta should be copied
Gst.BufferCopyFlags.MEMORY
(8)
–
flag indicating that buffer memory should be reffed and appended to already existing memory. Unless the memory is marked as NO_SHARE, no actual copy of the memory is made but it is simply reffed. Add GST_BUFFER_COPY_DEEP to force a real copy.
Gst.BufferCopyFlags.MERGE
(16)
–
flag indicating that buffer memory should be merged
Gst.BufferCopyFlags.DEEP
(32)
–
flag indicating that memory should always be copied instead of reffed (Since: 1.2)
Gst.BufferCopyFlags
A set of flags that can be provided to the Gst.Buffer.copy_into function to specify which items should be copied.
Members
Gst.BufferCopyFlags.NONE
(0)
–
copy nothing
Gst.BufferCopyFlags.FLAGS
(1)
–
flag indicating that buffer flags should be copied
Gst.BufferCopyFlags.TIMESTAMPS
(2)
–
flag indicating that buffer pts, dts, duration, offset and offset_end should be copied
Gst.BufferCopyFlags.META
(4)
–
flag indicating that buffer meta should be copied
Gst.BufferCopyFlags.MEMORY
(8)
–
flag indicating that buffer memory should be reffed and appended to already existing memory. Unless the memory is marked as NO_SHARE, no actual copy of the memory is made but it is simply reffed. Add GST_BUFFER_COPY_DEEP to force a real copy.
Gst.BufferCopyFlags.MERGE
(16)
–
flag indicating that buffer memory should be merged
Gst.BufferCopyFlags.DEEP
(32)
–
flag indicating that memory should always be copied instead of reffed (Since: 1.2)
GstBufferFlags
A set of buffer flags used to describe properties of a GstBuffer.
Members
GST_BUFFER_FLAG_LIVE
(16)
–
the buffer is live data and should be discarded in the PAUSED state.
GST_BUFFER_FLAG_DECODE_ONLY
(32)
–
the buffer contains data that should be dropped because it will be clipped against the segment boundaries or because it does not contain data that should be shown to the user.
GST_BUFFER_FLAG_DISCONT
(64)
–
the buffer marks a data discontinuity in the stream. This typically occurs after a seek or a dropped buffer from a live or network source.
GST_BUFFER_FLAG_RESYNC
(128)
–
the buffer timestamps might have a discontinuity and this buffer is a good point to resynchronize.
GST_BUFFER_FLAG_CORRUPTED
(256)
–
the buffer data is corrupted.
GST_BUFFER_FLAG_MARKER
(512)
–
the buffer contains a media specific marker. for video this is the end of a frame boundary, for audio this is the start of a talkspurt.
GST_BUFFER_FLAG_HEADER
(1024)
–
the buffer contains header information that is needed to decode the following data.
GST_BUFFER_FLAG_GAP
(2048)
–
the buffer has been created to fill a gap in the stream and contains media neutral data (elements can switch to optimized code path that ignores the buffer content).
GST_BUFFER_FLAG_DROPPABLE
(4096)
–
the buffer can be dropped without breaking the stream, for example to reduce bandwidth.
GST_BUFFER_FLAG_DELTA_UNIT
(8192)
–
this unit cannot be decoded independently.
GST_BUFFER_FLAG_TAG_MEMORY
(16384)
–
this flag is set when memory of the buffer is added/removed
GST_BUFFER_FLAG_SYNC_AFTER
(32768)
–
Elements which write to disk or permanent storage should ensure the data is synced after writing the contents of this buffer. (Since: 1.6)
GST_BUFFER_FLAG_NON_DROPPABLE
(65536)
–
This buffer is important and should not be dropped. This can be used to mark important buffers, e.g. to flag RTP packets carrying keyframes or codec setup data for RTP Forward Error Correction purposes, or to prevent still video frames from being dropped by elements due to QoS. (Since: 1.14)
GST_BUFFER_FLAG_LAST
(1048576)
–
additional media specific flags can be added starting from this flag.
Gst.BufferFlags
A set of buffer flags used to describe properties of a Gst.Buffer.
Members
Gst.BufferFlags.LIVE
(16)
–
the buffer is live data and should be discarded in the PAUSED state.
Gst.BufferFlags.DECODE_ONLY
(32)
–
the buffer contains data that should be dropped because it will be clipped against the segment boundaries or because it does not contain data that should be shown to the user.
Gst.BufferFlags.DISCONT
(64)
–
the buffer marks a data discontinuity in the stream. This typically occurs after a seek or a dropped buffer from a live or network source.
Gst.BufferFlags.RESYNC
(128)
–
the buffer timestamps might have a discontinuity and this buffer is a good point to resynchronize.
Gst.BufferFlags.CORRUPTED
(256)
–
the buffer data is corrupted.
Gst.BufferFlags.MARKER
(512)
–
the buffer contains a media specific marker. for video this is the end of a frame boundary, for audio this is the start of a talkspurt.
Gst.BufferFlags.HEADER
(1024)
–
the buffer contains header information that is needed to decode the following data.
Gst.BufferFlags.GAP
(2048)
–
the buffer has been created to fill a gap in the stream and contains media neutral data (elements can switch to optimized code path that ignores the buffer content).
Gst.BufferFlags.DROPPABLE
(4096)
–
the buffer can be dropped without breaking the stream, for example to reduce bandwidth.
Gst.BufferFlags.DELTA_UNIT
(8192)
–
this unit cannot be decoded independently.
Gst.BufferFlags.TAG_MEMORY
(16384)
–
this flag is set when memory of the buffer is added/removed
Gst.BufferFlags.SYNC_AFTER
(32768)
–
Elements which write to disk or permanent storage should ensure the data is synced after writing the contents of this buffer. (Since: 1.6)
Gst.BufferFlags.NON_DROPPABLE
(65536)
–
This buffer is important and should not be dropped. This can be used to mark important buffers, e.g. to flag RTP packets carrying keyframes or codec setup data for RTP Forward Error Correction purposes, or to prevent still video frames from being dropped by elements due to QoS. (Since: 1.14)
Gst.BufferFlags.LAST
(1048576)
–
additional media specific flags can be added starting from this flag.
Gst.BufferFlags
A set of buffer flags used to describe properties of a Gst.Buffer.
Members
Gst.BufferFlags.LIVE
(16)
–
the buffer is live data and should be discarded in the PAUSED state.
Gst.BufferFlags.DECODE_ONLY
(32)
–
the buffer contains data that should be dropped because it will be clipped against the segment boundaries or because it does not contain data that should be shown to the user.
Gst.BufferFlags.DISCONT
(64)
–
the buffer marks a data discontinuity in the stream. This typically occurs after a seek or a dropped buffer from a live or network source.
Gst.BufferFlags.RESYNC
(128)
–
the buffer timestamps might have a discontinuity and this buffer is a good point to resynchronize.
Gst.BufferFlags.CORRUPTED
(256)
–
the buffer data is corrupted.
Gst.BufferFlags.MARKER
(512)
–
the buffer contains a media specific marker. for video this is the end of a frame boundary, for audio this is the start of a talkspurt.
Gst.BufferFlags.HEADER
(1024)
–
the buffer contains header information that is needed to decode the following data.
Gst.BufferFlags.GAP
(2048)
–
the buffer has been created to fill a gap in the stream and contains media neutral data (elements can switch to optimized code path that ignores the buffer content).
Gst.BufferFlags.DROPPABLE
(4096)
–
the buffer can be dropped without breaking the stream, for example to reduce bandwidth.
Gst.BufferFlags.DELTA_UNIT
(8192)
–
this unit cannot be decoded independently.
Gst.BufferFlags.TAG_MEMORY
(16384)
–
this flag is set when memory of the buffer is added/removed
Gst.BufferFlags.SYNC_AFTER
(32768)
–
Elements which write to disk or permanent storage should ensure the data is synced after writing the contents of this buffer. (Since: 1.6)
Gst.BufferFlags.NON_DROPPABLE
(65536)
–
This buffer is important and should not be dropped. This can be used to mark important buffers, e.g. to flag RTP packets carrying keyframes or codec setup data for RTP Forward Error Correction purposes, or to prevent still video frames from being dropped by elements due to QoS. (Since: 1.14)
Gst.BufferFlags.LAST
(1048576)
–
additional media specific flags can be added starting from this flag.
Constants
GST_BUFFER_COPY_ALL
#define GST_BUFFER_COPY_ALL ((GstBufferCopyFlags)(GST_BUFFER_COPY_METADATA | GST_BUFFER_COPY_MEMORY))
Combination of all possible fields that can be copied with gst_buffer_copy_into.
Gst.BUFFER_COPY_ALL
Combination of all possible fields that can be copied with Gst.Buffer.prototype.copy_into.
Gst.BUFFER_COPY_ALL
Combination of all possible fields that can be copied with Gst.Buffer.copy_into.
GST_BUFFER_COPY_METADATA
#define GST_BUFFER_COPY_METADATA ((GstBufferCopyFlags) (GST_BUFFER_COPY_FLAGS |\ GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_META))
Combination of all possible metadata fields that can be copied with gst_buffer_copy_into.
Gst.BUFFER_COPY_METADATA
Combination of all possible metadata fields that can be copied with Gst.Buffer.prototype.copy_into.
Gst.BUFFER_COPY_METADATA
Combination of all possible metadata fields that can be copied with Gst.Buffer.copy_into.
GST_BUFFER_OFFSET_NONE
#define GST_BUFFER_OFFSET_NONE ((guint64)-1)
Constant for no-offset return results.
Gst.BUFFER_OFFSET_NONE
Constant for no-offset return results.
Gst.BUFFER_OFFSET_NONE
Constant for no-offset return results.
GST_PARENT_BUFFER_META_API_TYPE
#define GST_PARENT_BUFFER_META_API_TYPE (gst_parent_buffer_meta_api_get_type())
GST_PARENT_BUFFER_META_INFO
#define GST_PARENT_BUFFER_META_INFO (gst_parent_buffer_meta_get_info())
GST_REFERENCE_TIMESTAMP_META_API_TYPE
#define GST_REFERENCE_TIMESTAMP_META_API_TYPE (gst_reference_timestamp_meta_api_get_type())
GST_REFERENCE_TIMESTAMP_META_INFO
#define GST_REFERENCE_TIMESTAMP_META_INFO (gst_reference_timestamp_meta_get_info())
GST_TYPE_BUFFER
#define GST_TYPE_BUFFER (_gst_buffer_type)
GST_TYPE_PARENT_BUFFER_META_API_TYPE
#define GST_TYPE_PARENT_BUFFER_META_API_TYPE GST_PARENT_BUFFER_META_API_TYPE
Callbacks
GstBufferForeachMetaFunc
gboolean (*GstBufferForeachMetaFunc) (GstBuffer * buffer, GstMeta ** meta, gpointer user_data)
A function that will be called from gst_buffer_foreach_meta. The meta field will point to a the reference of the meta.
buffer should not be modified from this callback.
When this function returns TRUE, the next meta will be returned. When FALSE is returned, gst_buffer_foreach_meta will return.
When meta is set to NULL, the item will be removed from the buffer.
Parameters:
buffer
–
meta
(
[out]
[nullable]
)
–
a pointer to a GstMeta
user_data
–
user data passed to gst_buffer_foreach_meta
FALSE when gst_buffer_foreach_meta should stop
Gst.BufferForeachMetaFunc
function Gst.BufferForeachMetaFunc(buffer: Gst.Buffer, user_data: Object): {
// javascript wrapper for 'GstBufferForeachMetaFunc'
}
A function that will be called from Gst.Buffer.prototype.foreach_meta. The meta field will point to a the reference of the meta.
buffer should not be modified from this callback.
When this function returns true, the next meta will be returned. When false is returned, Gst.Buffer.prototype.foreach_meta will return.
When meta is set to null, the item will be removed from the buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
user_data
(
Object
)
–
user data passed to Gst.Buffer.prototype.foreach_meta
Returns a tuple made of:
false when Gst.Buffer.prototype.foreach_meta should stop
meta
(
Gst.Meta
)
–
false when Gst.Buffer.prototype.foreach_meta should stop
Gst.BufferForeachMetaFunc
def Gst.BufferForeachMetaFunc (buffer, *user_data):
#python wrapper for 'GstBufferForeachMetaFunc'
A function that will be called from Gst.Buffer.foreach_meta. The meta field will point to a the reference of the meta.
buffer should not be modified from this callback.
When this function returns True, the next meta will be returned. When False is returned, Gst.Buffer.foreach_meta will return.
When meta is set to None, the item will be removed from the buffer.
Parameters:
buffer
(
Gst.Buffer
)
–
user_data
(
variadic
)
–
user data passed to Gst.Buffer.foreach_meta
Returns a tuple made of:
False when Gst.Buffer.foreach_meta should stop
meta
(
Gst.Meta
)
–
False when Gst.Buffer.foreach_meta should stop
The results of the search are