Gst.Sample¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gst.Sample¶
A
Gst.Sampleis a small object containing data, a type, timing and extra arbitrary information.- classmethod new(buffer, caps, segment, info)[source]¶
- Parameters:
buffer (
Gst.BufferorNone) – aGst.Buffer, orNonesegment (
Gst.SegmentorNone) – aGst.Segment, orNoneinfo (
Gst.StructureorNone) – aGst.Structure, orNone
- Returns:
the new
Gst.Sample. gst_sample_unref() after usage.- Return type:
Create a new
Gst.Samplewith the provided details.Free-function: gst_sample_unref
- get_buffer()[source]¶
- Returns:
the buffer of self or
Nonewhen there is no buffer. The buffer remains valid as long as self is valid. If you need to hold on to it for longer than that, take a ref to the buffer with gst_buffer_ref().- Return type:
Gst.BufferorNone
Get the buffer associated with self
- get_buffer_list()[source]¶
- Returns:
the buffer list of self or
Nonewhen there is no buffer list. The buffer list remains valid as long as self is valid. If you need to hold on to it for longer than that, take a ref to the buffer list with gst_mini_object_ref ().- Return type:
Get the buffer list associated with self
New in version 1.6.
- get_caps()[source]¶
- Returns:
the caps of self or
Nonewhen there is no caps. The caps remain valid as long as self is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with gst_caps_ref().- Return type:
Get the caps associated with self
- get_info()[source]¶
- Returns:
the extra info of self. The info remains valid as long as self is valid.
- Return type:
Get extra information associated with self.
- get_segment()[source]¶
- Returns:
the segment of self. The segment remains valid as long as self is valid.
- Return type:
Get the segment associated with self
- is_writable()[source]¶
- Return type:
Tests if you can safely set the buffer and / or buffer list of self.
New in version 1.16.
- make_writable()[source]¶
- Returns:
a writable sample which may or may not be the same as self
- Return type:
Returns a writable copy of self. If the source sample is already writable, this will simply return the same sample.
Use this function to ensure that a sample can be safely modified before making changes to it, for example before calling
Gst.Sample.set_buffer()If the reference count of the source sample self is exactly one, the caller is the sole owner and this function will return the sample object unchanged.
If there is more than one reference on the object, a copy will be made using gst_sample_copy(). The passed-in self will be unreffed in that case, and the caller will now own a reference to the new returned sample object.
In short, this function unrefs the sample in the argument and refs the sample that it returns. Don’t access the argument after calling this function unless you have an additional reference to it.
New in version 1.16.
- set_buffer(buffer)[source]¶
- Parameters:
buffer (
Gst.Buffer) – AGst.Buffer
Set the buffer associated with self. self must be writable.
New in version 1.16.
- set_buffer_list(buffer_list)[source]¶
- Parameters:
buffer_list (
Gst.BufferList) – aGst.BufferList
Set the buffer list associated with self. self must be writable.
New in version 1.6.
- set_caps(caps)[source]¶
-
Set the caps associated with self. self must be writable.
New in version 1.16.
- set_info(info)[source]¶
- Parameters:
info (
Gst.Structure) – AGst.Structure- Return type:
Set the info structure associated with self. self must be writable, and info must not have a parent set already.
New in version 1.16.
- set_segment(segment)[source]¶
- Parameters:
segment (
Gst.Segment) – AGst.Segment
Set the segment associated with self. self must be writable.
New in version 1.16.