Class (GI Struct)

Gst-1.0GstSample

A Gst.Sample is a small object containing data, a type, timing and extra arbitrary information.

Index

Constructors

Properties

$gtype: GType<Sample>

Methods

  • Create a copy of the given sample. This will also make a newly allocated copy of the data the source sample contains.

    Returns Sample

    a new copy of sample.

  • Get the buffer associated with sample

    Returns Gst.Buffer | null

    the buffer of sample or null when there is no buffer. The buffer remains valid as long as sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with gst_buffer_ref().

  • Get the buffer list associated with sample

    Returns BufferList | null

    the buffer list of sample or null when there is no buffer list. The buffer list remains valid as long as sample 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 ().

  • Get the caps associated with sample

    Returns Gst.Caps | null

    the caps of sample or null when there is no caps. The caps remain valid as long as sample 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().

  • Tests if you can safely set the buffer and / or buffer list of sample.

    Returns boolean

  • Returns a writable copy of sample. 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 sample 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 sample 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.

    Returns Sample

    a writable sample which may or may not be the same as sample

  • Decreases the refcount of the sample. If the refcount reaches 0, the sample will be freed.

    Returns void