:right-sidebar: True Sample =================================================================== .. currentmodule:: gi.repository.Gst .. class:: Sample(**kwargs) :no-contents-entry: A :obj:`~gi.repository.Gst.Sample` is a small object containing data, a type, timing and extra arbitrary information. Constructors ------------ .. rst-class:: interim-class .. class:: Sample :no-index: .. classmethod:: new(buffer: ~gi.repository.Gst.Buffer | None = None, caps: ~gi.repository.Gst.Caps | None = None, segment: ~gi.repository.Gst.Segment | None = None, info: ~gi.repository.Gst.Structure | None = None) -> ~gi.repository.Gst.Sample Create a new :obj:`~gi.repository.Gst.Sample` with the provided details. Free-function: gst_sample_unref :param buffer: a :obj:`~gi.repository.Gst.Buffer`\, or :const:`None` :param caps: a :obj:`~gi.repository.Gst.Caps`\, or :const:`None` :param segment: a :obj:`~gi.repository.Gst.Segment`\, or :const:`None` :param info: a :obj:`~gi.repository.Gst.Structure`\, or :const:`None` Methods ------- .. rst-class:: interim-class .. class:: Sample :no-index: .. method:: get_buffer() -> ~gi.repository.Gst.Buffer | None Get the buffer associated with ``sample`` .. method:: get_buffer_list() -> ~gi.repository.Gst.BufferList | None Get the buffer list associated with ``sample`` .. versionadded:: 1.6 .. method:: get_caps() -> ~gi.repository.Gst.Caps | None Get the caps associated with ``sample`` .. method:: get_info() -> ~gi.repository.Gst.Structure | None Get extra information associated with ``sample``\. .. method:: get_segment() -> ~gi.repository.Gst.Segment Get the segment associated with ``sample`` .. method:: set_buffer(buffer: ~gi.repository.Gst.Buffer) -> None Set the buffer associated with ``sample``\. ``sample`` must be writable. .. versionadded:: 1.16 :param buffer: A :obj:`~gi.repository.Gst.Buffer` .. method:: set_buffer_list(buffer_list: ~gi.repository.Gst.BufferList) -> None Set the buffer list associated with ``sample``\. ``sample`` must be writable. .. versionadded:: 1.6 :param buffer_list: a :obj:`~gi.repository.Gst.BufferList` .. method:: set_caps(caps: ~gi.repository.Gst.Caps) -> None Set the caps associated with ``sample``\. ``sample`` must be writable. .. versionadded:: 1.16 :param caps: A :obj:`~gi.repository.Gst.Caps` .. method:: set_info(info: ~gi.repository.Gst.Structure) -> bool Set the info structure associated with ``sample``\. ``sample`` must be writable, and ``info`` must not have a parent set already. .. versionadded:: 1.16 :param info: A :obj:`~gi.repository.Gst.Structure` .. method:: set_segment(segment: ~gi.repository.Gst.Segment) -> None Set the segment associated with ``sample``\. ``sample`` must be writable. .. versionadded:: 1.16 :param segment: A :obj:`~gi.repository.Gst.Segment`